X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=lttng-sessiond%2Fmain.c;h=63d7f0e2d3e0ab48a68104183e5054454bde7db6;hb=be4f0921fc6786d2e58d793622d4e1016b739e92;hp=89a42528cd13ebf87d97923e572e207e729bb2cf;hpb=8f4905da7879943cd744ff55074ff0bc0e4f61cf;p=lttng-tools.git diff --git a/lttng-sessiond/main.c b/lttng-sessiond/main.c index 89a42528c..63d7f0e2d 100644 --- a/lttng-sessiond/main.c +++ b/lttng-sessiond/main.c @@ -50,7 +50,7 @@ #include "event.h" #include "futex.h" #include "hashtable.h" -#include "kernel-ctl.h" +#include "kernel.h" #include "lttng-sessiond.h" #include "shm.h" #include "ust-app.h" @@ -192,7 +192,7 @@ void setup_consumerd_path(void) */ #if (CAA_BITS_PER_LONG == 32) if (!consumerd32_path[0]) { - consumerd32_bindir = INSTALL_BIN_PATH "/" CONSUMERD_FILE; + consumerd32_path = INSTALL_BIN_PATH "/" CONSUMERD_FILE; } if (!consumerd32_libdir[0]) { consumerd32_libdir = INSTALL_LIB_PATH; @@ -1575,7 +1575,7 @@ static pid_t spawn_consumerd(struct consumer_data *consumer_data) } case LTTNG_CONSUMER32_UST: { - char *tmpnew; + char *tmpnew = NULL; if (consumerd32_libdir[0] != '\0') { char *tmp; @@ -2580,10 +2580,10 @@ static int cmd_enable_event(struct ltt_session *session, int domain, } case LTTNG_DOMAIN_UST: { - struct ltt_ust_channel *uchan; - struct ltt_ust_event *uevent; struct lttng_channel *attr; + struct ltt_ust_channel *uchan; + /* Get channel from global UST domain */ uchan = trace_ust_find_channel_by_name(usess->domain_global.channels, channel_name); if (uchan == NULL) { @@ -2594,14 +2594,14 @@ static int cmd_enable_event(struct ltt_session *session, int domain, 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 < 0) { + if (ret != LTTCOMM_OK) { free(attr); goto error; } - free(attr); /* Get the newly created channel reference back */ @@ -2614,31 +2614,12 @@ static int cmd_enable_event(struct ltt_session *session, int domain, } } - uevent = trace_ust_find_event_by_name(uchan->events, event->name); - if (uevent == NULL) { - uevent = trace_ust_create_event(event); - if (uevent == NULL) { - ret = LTTCOMM_FATAL; - goto error; - } - - } + /* At this point, the session and channel exist on the tracer */ - ret = ust_app_create_event_all(usess, uchan, uevent); - if (ret < 0) { - ret = LTTCOMM_UST_ENABLE_FAIL; + ret = event_ust_enable_tracepoint(usess, domain, uchan, event); + if (ret != LTTCOMM_OK) { goto error; } - - /* Add ltt ust event to channel */ - rcu_read_lock(); - hashtable_add_unique(uchan->events, &uevent->node); - rcu_read_unlock(); - - uevent->enabled = 1; - - DBG3("UST ltt event %s added to channel %s", uevent->attr.name, - uchan->name); break; } case LTTNG_DOMAIN_UST_EXEC_NAME: