goto error;
}
+ /*
+ * Add channel(s) and event(s) to newly registered apps
+ * from lttng global UST domain.
+ */
+ update_ust_app(ust_cmd.sock);
+
ret = ustctl_register_done(ust_cmd.sock);
if (ret < 0) {
/*
ust_cmd.sock);
}
- /*
- * Add channel(s) and event(s) to newly registered apps
- * from lttng global UST domain.
- */
- update_ust_app(ust_cmd.sock);
break;
}
} else {
goto error;
}
- /* Socket closed */
+ /* Socket closed on remote end. */
ust_app_unregister(pollfd);
break;
}
cds_lfht_for_each_entry(uchan->events, &iter, uevent, node) {
strncpy(tmp[i].name, uevent->attr.name, LTTNG_SYMBOL_NAME_LEN);
tmp[i].name[LTTNG_SYMBOL_NAME_LEN - 1] = '\0';
+ tmp[i].enabled = uevent->enabled;
switch (uevent->attr.instrumentation) {
case LTTNG_UST_TRACEPOINT:
tmp[i].type = LTTNG_EVENT_TRACEPOINT;
int ret;
struct ltt_ust_session *usess = session->ust_session;
- DBG("Enabling channel %s for session %s", session->name, attr->name);
+ DBG("Enabling channel %s for session %s", attr->name, session->name);
switch (domain->type) {
case LTTNG_DOMAIN_KERNEL:
ret = LTTCOMM_UST_CHAN_FAIL;
goto error;
}
+
rcu_read_lock();
hashtable_add_unique(usess->domain_global.channels, &uchan->node);
rcu_read_unlock();
}
/* Add channel to all registered applications */
- ret = ust_app_add_channel_all(usess, uchan);
- if (ret != LTTCOMM_OK) {
+ ret = ust_app_create_channel_all(usess, uchan);
+ if (ret != 0) {
goto error;
}
+ uchan->enabled = 1;
+
break;
}
case LTTNG_DOMAIN_UST_PID:
ret = LTTCOMM_FATAL;
goto error;
}
+
}
- ret = ust_app_add_event_all(usess, uchan, uevent);
+ ret = ust_app_create_event_all(usess, uchan, uevent);
if (ret < 0) {
ret = LTTCOMM_UST_ENABLE_FAIL;
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:
{
int ret;
struct ltt_kernel_session *ksession;
- struct ltt_ust_session *usess = session->ust_session;
+ struct ltt_ust_session *usess;
/* Short cut */
ksession = session->kernel_session;
+ usess = session->ust_session;
/* Kernel tracing */
if (ksession != NULL) {
}
/* Flag session that trace should start automatically */
- usess->start_trace = 1;
+ if (usess) {
+ usess->start_trace = 1;
- ret = ust_app_start_trace_all(usess);
- if (ret < 0) {
- ret = LTTCOMM_UST_START_FAIL;
- goto error;
+ ret = ust_app_start_trace_all(usess);
+ if (ret < 0) {
+ ret = LTTCOMM_UST_START_FAIL;
+ goto error;
+ }
}
ret = LTTCOMM_OK;