Add userspace namespace contexts
[lttng-ust.git] / liblttng-ust / lttng-events.c
index 255c4b953f9055141e72fae3449c37da5e56cb6b..855f8d8739d1ff0ecb07d6779957c4f11153f9db 100644 (file)
@@ -415,6 +415,9 @@ int lttng_session_enable(struct lttng_session *session)
        /* 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.
@@ -458,9 +461,6 @@ int lttng_session_enable(struct lttng_session *session)
                }
        }
 
-       /* 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;
@@ -1112,6 +1112,20 @@ int lttng_attach_context(struct lttng_ust_context *context_param,
        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);
        default:
                return -EINVAL;
        }
This page took 0.024464 seconds and 4 git commands to generate.