X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=lttng-sessiond%2Fmain.c;h=dda9168bb48222c3f9b5081baaadc6f4eb8cc48b;hb=0a1459bbc48796c0891c53d9ce0fde62d91dc69a;hp=46fcba9391d6dba216a726b8771cd897263709ea;hpb=13dce3b738049495c54e14b7401c6f2aa421f5ed;p=lttng-tools.git diff --git a/lttng-sessiond/main.c b/lttng-sessiond/main.c index 46fcba939..dda9168bb 100644 --- a/lttng-sessiond/main.c +++ b/lttng-sessiond/main.c @@ -1527,16 +1527,17 @@ static pid_t spawn_consumerd(struct consumer_data *consumer_data) switch (consumer_data->type) { case LTTNG_CONSUMER_KERNEL: /* - * Find out which consumerd to execute. We will first - * try the 64-bit path, then the 32-bit one, then - * fallback on sessiond's installation directory. + * Find out which consumerd to execute. We will + * first try the 64-bit path, then the + * sessiond's installation directory, and + * fallback on the 32-bit one, */ if (stat(consumerd64_bin, &st) == 0) { consumer_to_use = consumerd64_bin; - } else if (stat(consumerd32_bin, &st) == 0) { - consumer_to_use = consumerd32_bin; } else if (stat(INSTALL_BIN_PATH "/" CONSUMERD_FILE, &st) == 0) { consumer_to_use = INSTALL_BIN_PATH "/" CONSUMERD_FILE; + } else if (stat(consumerd32_bin, &st) == 0) { + consumer_to_use = consumerd32_bin; } else { break; } @@ -2093,9 +2094,7 @@ static int list_lttng_ust_global_events(char *channel_name, tmp[i].type = LTTNG_EVENT_FUNCTION; break; case LTTNG_UST_TRACEPOINT_LOGLEVEL: - /* TODO */ - ret = -LTTCOMM_NOT_IMPLEMENTED; - goto error; + tmp[i].type = LTTNG_EVENT_TRACEPOINT_LOGLEVEL; break; } i++; @@ -2715,11 +2714,11 @@ static int cmd_enable_event_all(struct ltt_session *session, int domain, } switch (event_type) { - case LTTNG_KERNEL_SYSCALL: + case LTTNG_EVENT_SYSCALL: ret = event_kernel_enable_all_syscalls(session->kernel_session, kchan, kernel_tracer_fd); break; - case LTTNG_KERNEL_TRACEPOINT: + case LTTNG_EVENT_TRACEPOINT: /* * This call enables all LTTNG_KERNEL_TRACEPOINTS and * events already registered to the channel. @@ -2727,7 +2726,7 @@ static int cmd_enable_event_all(struct ltt_session *session, int domain, ret = event_kernel_enable_all_tracepoints(session->kernel_session, kchan, kernel_tracer_fd); break; - case LTTNG_KERNEL_ALL: + case LTTNG_EVENT_ALL: /* Enable syscalls and tracepoints */ ret = event_kernel_enable_all(session->kernel_session, kchan, kernel_tracer_fd); @@ -2744,8 +2743,69 @@ static int cmd_enable_event_all(struct ltt_session *session, int domain, kernel_wait_quiescent(kernel_tracer_fd); break; + case LTTNG_DOMAIN_UST: + { + struct lttng_channel *attr; + struct ltt_ust_channel *uchan; + struct ltt_ust_session *usess = session->ust_session; + + /* Get channel from global UST domain */ + uchan = trace_ust_find_channel_by_name(usess->domain_global.channels, + channel_name); + if (uchan == NULL) { + /* Create default channel */ + attr = channel_new_default_attr(domain); + if (attr == NULL) { + ret = LTTCOMM_FATAL; + goto error; + } + snprintf(attr->name, NAME_MAX, "%s", channel_name); + attr->name[NAME_MAX - 1] = '\0'; + + /* Use the internal command enable channel */ + ret = cmd_enable_channel(session, domain, attr); + if (ret != LTTCOMM_OK) { + free(attr); + goto error; + } + free(attr); + + /* Get the newly created channel reference back */ + uchan = trace_ust_find_channel_by_name( + usess->domain_global.channels, channel_name); + if (uchan == NULL) { + /* Something is really wrong */ + ret = LTTCOMM_FATAL; + goto error; + } + } + + /* At this point, the session and channel exist on the tracer */ + + switch (event_type) { + case LTTNG_EVENT_ALL: + case LTTNG_EVENT_TRACEPOINT: + ret = event_ust_enable_all_tracepoints(usess, domain, uchan); + if (ret != LTTCOMM_OK) { + goto error; + } + break; + default: + ret = LTTCOMM_UST_ENABLE_FAIL; + goto error; + } + + /* Manage return value */ + if (ret != LTTCOMM_OK) { + goto error; + } + + break; + } + case LTTNG_DOMAIN_UST_EXEC_NAME: + case LTTNG_DOMAIN_UST_PID: + case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN: default: - /* TODO: Userspace tracing */ ret = LTTCOMM_NOT_IMPLEMENTED; goto error; }