Add userspace namespace contexts
[lttng-ust.git] / liblttng-ust / lttng-context.c
index 4e5b308466212563acc2342ecb929c00349dad35..ad6c38f0241486f78392cb82f5348a15d83187a6 100644 (file)
@@ -20,7 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-
+#define _LGPL_SOURCE
 #include <lttng/ust-events.h>
 #include <lttng/ust-tracer.h>
 #include <lttng/ust-context-provider.h>
@@ -372,6 +372,41 @@ int lttng_session_context_init(struct lttng_ctx **ctx)
                WARN("Cannot add context lttng_add_cpu_id_to_ctx");
                goto error;
        }
+       ret = lttng_add_cgroup_ns_to_ctx(ctx);
+       if (ret) {
+               WARN("Cannot add context lttng_add_cgroup_ns_to_ctx");
+               goto error;
+       }
+       ret = lttng_add_ipc_ns_to_ctx(ctx);
+       if (ret) {
+               WARN("Cannot add context lttng_add_ipc_ns_to_ctx");
+               goto error;
+       }
+       ret = lttng_add_mnt_ns_to_ctx(ctx);
+       if (ret) {
+               WARN("Cannot add context lttng_add_mnt_ns_to_ctx");
+               goto error;
+       }
+       ret = lttng_add_net_ns_to_ctx(ctx);
+       if (ret) {
+               WARN("Cannot add context lttng_add_net_ns_to_ctx");
+               goto error;
+       }
+       ret = lttng_add_pid_ns_to_ctx(ctx);
+       if (ret) {
+               WARN("Cannot add context lttng_add_pid_ns_to_ctx");
+               goto error;
+       }
+       ret = lttng_add_user_ns_to_ctx(ctx);
+       if (ret) {
+               WARN("Cannot add context lttng_add_user_ns_to_ctx");
+               goto error;
+       }
+       ret = lttng_add_uts_ns_to_ctx(ctx);
+       if (ret) {
+               WARN("Cannot add context lttng_add_uts_ns_to_ctx");
+               goto error;
+       }
        lttng_context_update(*ctx);
        return 0;
 
@@ -379,3 +414,14 @@ error:
        lttng_destroy_context(*ctx);
        return ret;
 }
+
+/* For backward compatibility. Leave those exported symbols in place. */
+struct lttng_ctx *lttng_static_ctx;
+
+void lttng_context_init(void)
+{
+}
+
+void lttng_context_exit(void)
+{
+}
This page took 0.024053 seconds and 4 git commands to generate.