*/
static struct ltt_session_list *session_list_ptr;
+int ust_consumer_fd;
+
/*
* Create a poll set with O_CLOEXEC and add the thread quit pipe to the set.
*/
sessions[i].path[PATH_MAX - 1] = '\0';
strncpy(sessions[i].name, session->name, NAME_MAX);
sessions[i].name[NAME_MAX - 1] = '\0';
+ sessions[i].enabled = session->enabled;
i++;
}
}
ksession = session->kernel_session;
usess = session->ust_session;
+ if (session->enabled)
+ return LTTCOMM_UST_START_FAIL;
+ session->enabled = 1;
+
/* Kernel tracing */
if (ksession != NULL) {
struct ltt_kernel_channel *kchan;
/* Short cut */
ksession = session->kernel_session;
+ if (!session->enabled)
+ return LTTCOMM_UST_START_FAIL;
+ session->enabled = 0;
+
/* Kernel tracer */
if (ksession != NULL) {
DBG("Stop kernel tracing");
goto error;
}
- cmd_ctx->session->ust_session->consumer_fd =
- ustconsumer_data.cmd_sock;
+ ust_consumer_fd = ustconsumer_data.cmd_sock;
}
pthread_mutex_unlock(&ustconsumer_data.pid_mutex);
}