From: Vladimír Čunát Date: Wed, 3 Jul 2019 11:30:04 +0000 (+0200) Subject: main: better support for profiling X-Git-Tag: v4.2.0~9^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f74829e145a25ecf3aced2ee7c9407ce06c57c3;p=thirdparty%2Fknot-resolver.git main: better support for profiling --- diff --git a/daemon/main.c b/daemon/main.c index 3237b8f18..9ab8f1019 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -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) {