/* Quiescent wait after starting trace */
kernel_wait_quiescent(kernel_tracer_fd);
- ksess->started = 1;
+ ksess->active = 1;
ret = LTTNG_OK;
/* Flag session that trace should start automatically */
if (usess) {
- usess->start_trace = 1;
+ /*
+ * Even though the start trace might fail, flag this session active so
+ * other application coming in are started by default.
+ */
+ usess->active = 1;
ret = ust_app_start_trace_all(usess);
if (ret < 0) {
}
/* Kernel tracer */
- if (ksession && ksession->started) {
+ if (ksession && ksession->active) {
DBG("Stop kernel tracing");
/* Flush metadata if exist */
kernel_wait_quiescent(kernel_tracer_fd);
- ksession->started = 0;
+ ksession->active = 0;
}
- if (usess && usess->start_trace) {
- usess->start_trace = 0;
+ if (usess && usess->active) {
+ /*
+ * Even though the stop trace might fail, flag this session inactive so
+ * other application coming in are not started by default.
+ */
+ usess->active = 0;
ret = ust_app_stop_trace_all(usess);
if (ret < 0) {
struct consumer_output *tmp_consumer;
/* Tracing session id */
uint64_t id;
- /* Session is started and active */
- unsigned int started;
+ /* Session is active or not meaning it has been started or stopped. */
+ unsigned int active:1;
/* Tell or not if the session has to output the traces. */
unsigned int output_traces;
unsigned int snapshot_mode;
/* Init data structure */
lus->id = session_id;
- lus->start_trace = 0;
+ lus->active = 0;
/* Set default metadata channel attribute. */
lus->metadata_attr.overwrite = DEFAULT_CHANNEL_OVERWRITE;
/* UST session */
struct ltt_ust_session {
uint64_t id; /* Unique identifier of session */
- int start_trace;
struct ltt_ust_domain_global domain_global;
struct jul_domain domain_jul;
/* UID/GID of the user owning the session */
uid_t uid;
gid_t gid;
+ /* Is the session active meaning has is been started or stopped. */
+ unsigned int active:1;
/*
* Two consumer_output object are needed where one is for the current
* output object and the second one is the temporary object used to store
pthread_mutex_unlock(&ua_sess->lock);
- if (usess->start_trace) {
+ if (usess->active) {
ret = ust_app_start_trace(usess, app);
if (ret < 0) {
goto error;
ok(usess != NULL, "Create UST session");
ok(usess->id == 42 &&
- usess->start_trace == 0 &&
+ usess->active == 0 &&
usess->domain_global.channels != NULL &&
usess->uid == 0 &&
usess->gid == 0,