From: Michael Jeanson Date: Tue, 12 Feb 2019 16:51:21 +0000 (-0500) Subject: Add UST namespace contexts X-Git-Tag: v2.12.0-rc1~287 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f17b873261bab722b58f21aabd3fcb44a0bbc20d;p=lttng-tools.git Add UST namespace contexts Add the following userspace namespace contexts: - cgroup_ns Cgroup root directory namespace: inode number of the current cgroup namespace in the proc filesystem. - ipc_ns System V IPC, POSIX message queues namespace: inode number of the current IPC namespace in the proc filesystem. - mnt_ns Mount points namespace: inode number of the current mount namespace in the proc filesystem. - net_ns Network devices, stacks, ports namespace: inode number of the current network namespace in the proc filesystem. - pid_ns Process IDs namespace: inode number of the current pid namespace in the proc filesystem. - user_ns User and group IDs namespace: inode number of the current user namespace in the proc filesystem. - uts_ns Hostname and NIS domain name namespace: inode number of the current uts namespace in the proc filesystem. Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/save.c b/src/bin/lttng-sessiond/save.c index f3cd9bca9..6c7ca6757 100644 --- a/src/bin/lttng-sessiond/save.c +++ b/src/bin/lttng-sessiond/save.c @@ -347,6 +347,27 @@ const char *get_ust_context_type_string( case LTTNG_UST_CONTEXT_APP_CONTEXT: context_type_string = config_event_context_app; break; + case LTTNG_UST_CONTEXT_CGROUP_NS: + context_type_string = config_event_context_cgroup_ns; + break; + case LTTNG_UST_CONTEXT_IPC_NS: + context_type_string = config_event_context_ipc_ns; + break; + case LTTNG_UST_CONTEXT_MNT_NS: + context_type_string = config_event_context_mnt_ns; + break; + case LTTNG_UST_CONTEXT_NET_NS: + context_type_string = config_event_context_net_ns; + break; + case LTTNG_UST_CONTEXT_PID_NS: + context_type_string = config_event_context_pid_ns; + break; + case LTTNG_UST_CONTEXT_USER_NS: + context_type_string = config_event_context_user_ns; + break; + case LTTNG_UST_CONTEXT_UTS_NS: + context_type_string = config_event_context_uts_ns; + break; case LTTNG_UST_CONTEXT_PERF_THREAD_COUNTER: /* * Error, should not be stored in the XML, perf contexts diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c index cc166fd6f..e91102a6d 100644 --- a/src/bin/lttng-sessiond/trace-ust.c +++ b/src/bin/lttng-sessiond/trace-ust.c @@ -564,6 +564,27 @@ int trace_ust_context_type_event_to_ust( case LTTNG_EVENT_CONTEXT_APP_CONTEXT: utype = LTTNG_UST_CONTEXT_APP_CONTEXT; break; + case LTTNG_EVENT_CONTEXT_CGROUP_NS: + utype = LTTNG_UST_CONTEXT_CGROUP_NS; + break; + case LTTNG_EVENT_CONTEXT_IPC_NS: + utype = LTTNG_UST_CONTEXT_IPC_NS; + break; + case LTTNG_EVENT_CONTEXT_MNT_NS: + utype = LTTNG_UST_CONTEXT_MNT_NS; + break; + case LTTNG_EVENT_CONTEXT_NET_NS: + utype = LTTNG_UST_CONTEXT_NET_NS; + break; + case LTTNG_EVENT_CONTEXT_PID_NS: + utype = LTTNG_UST_CONTEXT_PID_NS; + break; + case LTTNG_EVENT_CONTEXT_USER_NS: + utype = LTTNG_UST_CONTEXT_USER_NS; + break; + case LTTNG_EVENT_CONTEXT_UTS_NS: + utype = LTTNG_UST_CONTEXT_UTS_NS; + break; default: utype = -1; break;