X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fmain.c;h=f57a5c911d11095a7efbdc1a5ad8a87d400f3d9f;hp=f7bb53ef7ead038e479964b6e11bb2259eeb1cd7;hb=7972aab22f74b18faa168c0482216a3dd711a075;hpb=45893984238b2e2c12fc0d84b90336c98a6d98c9 diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index f7bb53ef7..f57a5c911 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -45,6 +45,7 @@ #include #include "lttng-sessiond.h" +#include "buffer-registry.h" #include "channel.h" #include "cmd.h" #include "consumer.h" @@ -435,6 +436,7 @@ static void cleanup(void) DBG("Closing all UST sockets"); ust_app_clean_list(); + buffer_reg_destroy_registries(); if (is_root && !opt_no_kernel) { DBG2("Closing kernel fd"); @@ -1299,6 +1301,7 @@ static void *thread_dispatch_ust_registration(void *data) do { struct ust_app *app = NULL; + ust_cmd = NULL; /* Dequeue command for registration */ node = cds_wfq_dequeue_blocking(&ust_cmd_queue.queue); @@ -1321,6 +1324,7 @@ static void *thread_dispatch_ust_registration(void *data) wait_node = zmalloc(sizeof(*wait_node)); if (!wait_node) { PERROR("zmalloc wait_node dispatch"); + free(ust_cmd); goto error; } CDS_INIT_LIST_HEAD(&wait_node->head); @@ -1335,6 +1339,7 @@ static void *thread_dispatch_ust_registration(void *data) } lttng_fd_put(1, LTTNG_FD_APPS); free(wait_node); + free(ust_cmd); continue; } /* @@ -1343,6 +1348,7 @@ static void *thread_dispatch_ust_registration(void *data) */ cds_list_add(&wait_node->head, &wait_queue); + free(ust_cmd); /* * We have to continue here since we don't have the notify * socket and the application MUST be added to the hash table @@ -1365,6 +1371,7 @@ static void *thread_dispatch_ust_registration(void *data) break; } } + free(ust_cmd); } if (app) { @@ -1433,7 +1440,6 @@ static void *thread_dispatch_ust_registration(void *data) } lttng_fd_put(1, LTTNG_FD_APPS); } - free(ust_cmd); } while (node != NULL); /* Futex wait on queue. Blocking call on futex() */ @@ -2610,13 +2616,13 @@ skip_domain: } case LTTNG_ENABLE_CHANNEL: { - ret = cmd_enable_channel(cmd_ctx->session, cmd_ctx->lsm->domain.type, + ret = cmd_enable_channel(cmd_ctx->session, &cmd_ctx->lsm->domain, &cmd_ctx->lsm->u.channel.chan, kernel_poll_pipe[1]); break; } case LTTNG_ENABLE_EVENT: { - ret = cmd_enable_event(cmd_ctx->session, cmd_ctx->lsm->domain.type, + ret = cmd_enable_event(cmd_ctx->session, &cmd_ctx->lsm->domain, cmd_ctx->lsm->u.enable.channel_name, &cmd_ctx->lsm->u.enable.event, NULL, kernel_poll_pipe[1]); break; @@ -2625,7 +2631,7 @@ skip_domain: { DBG("Enabling all events"); - ret = cmd_enable_event_all(cmd_ctx->session, cmd_ctx->lsm->domain.type, + ret = cmd_enable_event_all(cmd_ctx->session, &cmd_ctx->lsm->domain, cmd_ctx->lsm->u.enable.channel_name, cmd_ctx->lsm->u.enable.event.type, NULL, kernel_poll_pipe[1]); break; @@ -2974,7 +2980,7 @@ skip_domain: goto error; } - ret = cmd_enable_event(cmd_ctx->session, cmd_ctx->lsm->domain.type, + ret = cmd_enable_event(cmd_ctx->session, &cmd_ctx->lsm->domain, cmd_ctx->lsm->u.enable.channel_name, &cmd_ctx->lsm->u.enable.event, bytecode, kernel_poll_pipe[1]); break; @@ -4217,6 +4223,10 @@ int main(int argc, char **argv) goto exit; } + /* Initialize global buffer per UID and PID registry. */ + buffer_reg_init_uid_registry(); + buffer_reg_init_pid_registry(); + /* Init UST command queue. */ cds_wfq_init(&ust_cmd_queue.queue);