X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fmain.cpp;h=34e881c4d219aee6aea0d237982920fe0b2e4ba6;hb=1c9a0b0e83c7e073c4e576c0bed95de335b0e502;hp=e5e71889147aad8fb0076375e3f0ba3314ec1736;hpb=7966af5763c4aaca39df9bbfa9277ff15715c720;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/main.cpp b/src/bin/lttng-sessiond/main.cpp index e5e718891..34e881c4d 100644 --- a/src/bin/lttng-sessiond/main.cpp +++ b/src/bin/lttng-sessiond/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 David Goulet + * Copyright (C) 2011 EfficiOS Inc. * Copyright (C) 2011 Mathieu Desnoyers * Copyright (C) 2013 Jérémie Galarneau * @@ -37,8 +37,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -65,7 +67,6 @@ #include "notification-thread-commands.h" #include "rotation-thread.h" #include "agent.h" -#include "ht-cleanup.h" #include "sessiond-config.h" #include "timer.h" #include "thread.h" @@ -794,7 +795,8 @@ end: * See config_entry_handler_cb comment in common/config/session-config.h for the * return value conventions. */ -static int config_entry_handler(const struct config_entry *entry, void *unused) +static int config_entry_handler(const struct config_entry *entry, + void *unused __attribute__((unused))) { int ret = 0, i; @@ -1171,7 +1173,8 @@ error: * Simply stop all worker threads, leaving main() return gracefully after * joining all threads and calling cleanup(). */ -static void sighandler(int sig, siginfo_t *siginfo, void *arg) +static void sighandler(int sig, siginfo_t *siginfo, + void *arg __attribute__((unused))) { switch (sig) { case SIGINT: @@ -1358,6 +1361,7 @@ static void unregister_all_triggers(void) unsigned int trigger_count, i; const struct lttng_credentials creds = { .uid = LTTNG_OPTIONAL_INIT_VALUE(0), + .gid = LTTNG_OPTIONAL_INIT_UNSET, }; DBG("Unregistering all triggers"); @@ -1446,7 +1450,6 @@ int main(int argc, char **argv) struct lttng_pipe *ust32_channel_monitor_pipe = NULL, *ust64_channel_monitor_pipe = NULL, *kernel_channel_monitor_pipe = NULL; - struct lttng_thread *ht_cleanup_thread = NULL; struct timer_thread_parameters timer_thread_parameters; /* Rotation thread handle. */ struct rotation_thread_handle *rotation_thread_handle = NULL; @@ -1495,9 +1498,7 @@ int main(int argc, char **argv) * Parse arguments and load the daemon configuration file. * * We have an exit_options exit path to free memory reserved by - * set_options. This is needed because the rest of sessiond_cleanup() - * depends on ht_cleanup_thread, which depends on lttng_daemonize, which - * depends on set_options. + * set_options. */ progname = argv[0]; if (set_options(argc, argv)) { @@ -1598,13 +1599,6 @@ int main(int argc, char **argv) goto stop_threads; } - /* Create thread to clean up RCU hash tables */ - ht_cleanup_thread = launch_ht_cleanup_thread(); - if (!ht_cleanup_thread) { - retval = -1; - goto stop_threads; - } - /* Create thread quit pipe */ if (sessiond_init_thread_quit_pipe()) { retval = -1; @@ -1959,10 +1953,7 @@ stop_threads: * perform lookups in those structures. */ rcu_barrier(); - /* - * sessiond_cleanup() is called when no other thread is running, except - * the ht_cleanup thread, which is needed to destroy the hash tables. - */ + rcu_thread_online(); sessiond_cleanup(); @@ -1999,18 +1990,6 @@ stop_threads: modprobe_remove_lttng_all(); } - /* - * Ensure all prior call_rcu are done. call_rcu callbacks may push - * hash tables to the ht_cleanup thread. Therefore, we ensure that - * the queue is empty before shutting down the clean-up thread. - */ - rcu_barrier(); - - if (ht_cleanup_thread) { - lttng_thread_shutdown(ht_cleanup_thread); - lttng_thread_put(ht_cleanup_thread); - } - rcu_thread_offline(); rcu_unregister_thread();