X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fmain.c;h=9c2fe4a3ef084751429c12955642a207f8a7b3a7;hb=f02edd9ef8d49e675f0b0d7c27e2991bb918221b;hp=b1e0767a9d813e826db87caa97bd0a51619a65c5;hpb=92d6debb310dffe60e501adfb6bd5be6fb6af4f4;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index b1e0767a9..9c2fe4a3e 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -797,6 +797,8 @@ static void sessiond_cleanup_options(void) free(kmod_probes_list); free(kmod_extra_probes_list); + run_as_destroy_worker(); + /* */ DBG("%c[%d;%dm*** assert failed :-) *** ==> %c[%dm%c[%d;%dm" "Matthew, BEET driven development works!%c[%dm", @@ -5474,6 +5476,10 @@ int main(int argc, char **argv) } } + if (run_as_create_worker(argv[0]) < 0) { + goto exit_create_run_as_worker_cleanup; + } + /* * Starting from here, we can create threads. This needs to be after * lttng_daemonize due to RCU. @@ -6091,13 +6097,15 @@ exit_ht_cleanup_quit_pipe: health_app_destroy(health_sessiond); exit_health_sessiond_cleanup: +exit_create_run_as_worker_cleanup: exit_options: + /* Ensure all prior call_rcu are done. */ + rcu_barrier(); + sessiond_cleanup_options(); exit_set_signal_handler: - /* Ensure all prior call_rcu are done. */ - rcu_barrier(); if (!retval) { exit(EXIT_SUCCESS);