X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-consumerd%2Flttng-consumerd.c;h=1cc1eb9ae567c5a957bbf4d0704a2805337050f8;hb=22dad56815ce0201c5ae7d5ef5d79cc0c6a42c5e;hp=0d34feeb342904ddc599c84fbc7c7359ade16872;hpb=6a0caa9baf6913eacea486ac84f14ee65c62108b;p=lttng-tools.git diff --git a/src/bin/lttng-consumerd/lttng-consumerd.c b/src/bin/lttng-consumerd/lttng-consumerd.c index 0d34feeb3..1cc1eb9ae 100644 --- a/src/bin/lttng-consumerd/lttng-consumerd.c +++ b/src/bin/lttng-consumerd/lttng-consumerd.c @@ -16,7 +16,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE #define _LGPL_SOURCE #include #include @@ -38,14 +37,13 @@ #include #include #include -#include #include #include #include #include -#include -#include +#include +#include #include #include #include @@ -103,7 +101,7 @@ static void sighandler(int sig) /* * Ignore SIGPIPE because it should not stop the consumer whenever a - * SIGPIPE is catched through a FD operation. + * SIGPIPE is caught through a FD operation. */ if (sig == SIGPIPE) { return; @@ -364,12 +362,6 @@ int main(int argc, char **argv) goto exit_health_consumerd_cleanup; } - /* Set up max poll set size */ - if (lttng_poll_set_max_size()) { - retval = -1; - goto exit_init_data; - } - if (*command_sock_path == '\0') { switch (opt_type) { case LTTNG_CONSUMER_KERNEL: @@ -422,6 +414,10 @@ int main(int argc, char **argv) set_ulimit(); } + if (run_as_create_worker(argv[0]) < 0) { + goto exit_init_data; + } + /* create the consumer instance with and assign the callbacks */ ctx = lttng_consumer_create(opt_type, lttng_consumer_read_subbuffer, NULL, lttng_consumer_on_recv_stream, NULL); @@ -638,13 +634,14 @@ exit_init_data: if (health_consumerd) { health_app_destroy(health_consumerd); } -exit_health_consumerd_cleanup: + /* Ensure all prior call_rcu are done. */ + rcu_barrier(); -exit_options: + run_as_destroy_worker(); +exit_health_consumerd_cleanup: +exit_options: exit_set_signal_handler: - /* Ensure all prior call_rcu are done. */ - rcu_barrier(); if (!retval) { exit(EXIT_SUCCESS);