]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
main: better support for profiling
authorVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 3 Jul 2019 11:30:04 +0000 (13:30 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 12 Jul 2019 14:21:09 +0000 (16:21 +0200)
daemon/main.c

index 3237b8f18e3bc5e81eb1fcc46c145d5ce5324d3e..9ab8f1019ccb03c013aa1fb6b1498c7338bb360f 100644 (file)
@@ -795,6 +795,13 @@ int main(int argc, char **argv)
                ret = EXIT_FAILURE;
                goto cleanup;
        }
+       /* Profiling: avoid SIGPROF waking up the event loop.  Otherwise the profiles
+        * (of the usual type) may skew results, e.g. epoll_pwait() taking lots of time. */
+       ret = uv_loop_configure(loop, UV_LOOP_BLOCK_SIGNAL, SIGPROF);
+       if (ret) {
+               kr_log_info("[system] failed to block SIGPROF in event loop, ignoring: %s\n",
+                               uv_strerror(ret));
+       }
 
        /* Start listening, in the sense of network_listen_fd(). */
        if (start_listening(&engine.net, &args.fds) != 0) {