/* Set transient enabler state to "enabled" */
session->tstate = 1;
+ /* We need to sync enablers with session before activation. */
+ lttng_session_sync_enablers(session);
+
/*
* Snapshot the number of events per channel to know the type of header
* we need to use.
}
}
- /* We need to sync enablers with session before activation. */
- lttng_session_sync_enablers(session);
-
/* Set atomically the state to "active" */
CMM_ACCESS_ONCE(session->active) = 1;
CMM_ACCESS_ONCE(session->been_active) = 1;
head = &session->events_ht.table[hash & (LTTNG_UST_EVENT_HT_SIZE - 1)];
cds_hlist_for_each_entry(event, node, head, hlist) {
if (event->desc == desc
- && event->chan == enabler->chan)
+ && event->chan == enabler->chan) {
found = 1;
+ break;
+ }
}
if (found)
continue;
struct lttng_session *session = enabler->chan->session;
struct lttng_event *event;
+ if (!enabler->enabled)
+ goto end;
+
/* First ensure that probe events are created for this enabler. */
lttng_create_event_if_missing(enabler);
/* TODO: merge event context. */
}
+end:
return 0;
}
case LTTNG_UST_CONTEXT_APP_CONTEXT:
return lttng_ust_add_app_context_to_ctx_rcu(uargs->app_context.ctxname,
ctx);
+ case LTTNG_UST_CONTEXT_CGROUP_NS:
+ return lttng_add_cgroup_ns_to_ctx(ctx);
+ case LTTNG_UST_CONTEXT_IPC_NS:
+ return lttng_add_ipc_ns_to_ctx(ctx);
+ case LTTNG_UST_CONTEXT_MNT_NS:
+ return lttng_add_mnt_ns_to_ctx(ctx);
+ case LTTNG_UST_CONTEXT_NET_NS:
+ return lttng_add_net_ns_to_ctx(ctx);
+ case LTTNG_UST_CONTEXT_PID_NS:
+ return lttng_add_pid_ns_to_ctx(ctx);
+ case LTTNG_UST_CONTEXT_USER_NS:
+ return lttng_add_user_ns_to_ctx(ctx);
+ case LTTNG_UST_CONTEXT_UTS_NS:
+ return lttng_add_uts_ns_to_ctx(ctx);
+ case LTTNG_UST_CONTEXT_VUID:
+ return lttng_add_vuid_to_ctx(ctx);
+ case LTTNG_UST_CONTEXT_VEUID:
+ return lttng_add_veuid_to_ctx(ctx);
+ case LTTNG_UST_CONTEXT_VSUID:
+ return lttng_add_vsuid_to_ctx(ctx);
+ case LTTNG_UST_CONTEXT_VGID:
+ return lttng_add_vgid_to_ctx(ctx);
+ case LTTNG_UST_CONTEXT_VEGID:
+ return lttng_add_vegid_to_ctx(ctx);
+ case LTTNG_UST_CONTEXT_VSGID:
+ return lttng_add_vsgid_to_ctx(ctx);
default:
return -EINVAL;
}