X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fmain.c;h=114e9c21d7a10432613ea480aef7ba0bc6d2c3e4;hb=366a9222abc182bf77de1b806256aa9a9dc8832a;hp=4c3a1796c8aa58abac502fbee00195b68c0d262d;hpb=ddaec4a2b9b7c8be74166525bdcdff115c80d7c4;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 4c3a1796c..114e9c21d 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -94,6 +94,9 @@ static int lockfile_fd = -1; /* Set to 1 when a SIGUSR1 signal is received. */ static int recv_child_signal; +static struct lttng_kernel_tracer_version kernel_tracer_version; +static struct lttng_kernel_tracer_abi_version kernel_tracer_abi_version; + /* * Consumer daemon specific control data. Every value not initialized here is * set to 0 by the static definition. @@ -1270,6 +1273,7 @@ restart: if (!cmd_socket_wrapper) { goto error; } + cmd_socket_wrapper->lock = &consumer_data->lock; ret = consumer_send_channel_monitor_pipe(cmd_socket_wrapper, consumer_data->channel_monitor_pipe); @@ -1445,7 +1449,17 @@ error_poll: } /* - * This thread manage application communication. + * This thread receives application command sockets (FDs) on the + * apps_cmd_pipe and waits (polls) on them until they are closed + * or an error occurs. + * + * At that point, it flushes the data (tracing and metadata) associated + * with this application and tears down ust app sessions and other + * associated data structures through ust_app_unregister(). + * + * Note that this thread never sends commands to the applications + * through the command sockets; it merely listens for hang-ups + * and errors on those sockets and cleans-up as they occur. */ static void *thread_manage_apps(void *data) { @@ -2610,7 +2624,8 @@ static int init_kernel_tracer(void) } /* Validate kernel version */ - ret = kernel_validate_version(kernel_tracer_fd); + ret = kernel_validate_version(kernel_tracer_fd, &kernel_tracer_version, + &kernel_tracer_abi_version); if (ret < 0) { goto error_version; } @@ -2819,9 +2834,9 @@ static int create_kernel_session(struct ltt_session *session) /* Create directory(ies) on local filesystem. */ if (session->kernel_session->consumer->type == CONSUMER_DST_LOCAL && - strlen(session->kernel_session->consumer->dst.trace_path) > 0) { + strlen(session->kernel_session->consumer->dst.session_root_path) > 0) { ret = run_as_mkdir_recursive( - session->kernel_session->consumer->dst.trace_path, + session->kernel_session->consumer->dst.session_root_path, S_IRWXU | S_IRWXG, session->uid, session->gid); if (ret < 0) { if (errno != EEXIST) {