Drop 'wrapper/namespace.h' wrapper
authorMichael Jeanson <mjeanson@efficios.com>
Fri, 18 Nov 2022 17:07:09 +0000 (12:07 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 23 Nov 2022 20:02:41 +0000 (15:02 -0500)
Change-Id: Ib7ff96f36310cdcbe29fed279ab4a03ca96195e8
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 files changed:
include/instrumentation/events/lttng-statedump.h
include/instrumentation/events/sched.h
include/wrapper/namespace.h [deleted file]
src/lttng-context-cgroup-ns.c
src/lttng-context-ipc-ns.c
src/lttng-context-mnt-ns.c
src/lttng-context-net-ns.c
src/lttng-context-pid-ns.c
src/lttng-context-time-ns.c
src/lttng-context-user-ns.c
src/lttng-context-uts-ns.c
src/lttng-statedump-impl.c

index 345beee504fcbde65e8474011997c8a4959e5fca..e88fec575aa2cf38e97058c7d8b254c635148bc9 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/utsname.h>
 #include <linux/types.h>
 #include <lttng/kernel-version.h>
-#include <wrapper/namespace.h>
 #include <wrapper/user_namespace.h>
 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0) || \
        LTTNG_RHEL_KERNEL_RANGE(4,18,0,305,0,0, 4,19,0,0,0,0))
@@ -77,7 +76,7 @@ LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_cgroup_ns,
        TP_ARGS(session, p, cgroup_ns),
        TP_FIELDS(
                ctf_integer(pid_t, tid, p->pid)
-               ctf_integer(unsigned int, ns_inum, cgroup_ns ? cgroup_ns->lttng_ns_inum : 0)
+               ctf_integer(unsigned int, ns_inum, cgroup_ns ? cgroup_ns->ns.inum : 0)
        )
 )
 #endif
@@ -90,7 +89,7 @@ LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_ipc_ns,
        TP_FIELDS(
                ctf_integer(pid_t, tid, p->pid)
 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
-               ctf_integer(unsigned int, ns_inum, ipc_ns ? ipc_ns->lttng_ns_inum : 0)
+               ctf_integer(unsigned int, ns_inum, ipc_ns ? ipc_ns->ns.inum : 0)
 #endif
        )
 )
@@ -104,7 +103,7 @@ LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_mnt_ns,
        TP_FIELDS(
                ctf_integer(pid_t, tid, p->pid)
 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
-               ctf_integer(unsigned int, ns_inum, mnt_ns ? mnt_ns->lttng_ns_inum : 0)
+               ctf_integer(unsigned int, ns_inum, mnt_ns ? mnt_ns->ns.inum : 0)
 #endif
        )
 )
@@ -118,7 +117,7 @@ LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_net_ns,
        TP_FIELDS(
                ctf_integer(pid_t, tid, p->pid)
 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
-               ctf_integer(unsigned int, ns_inum, net_ns ? net_ns->lttng_ns_inum : 0)
+               ctf_integer(unsigned int, ns_inum, net_ns ? net_ns->ns.inum : 0)
 #endif
        )
 )
@@ -147,7 +146,7 @@ LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_pid_ns,
                        }))
                ctf_integer(int, ns_level, pid_ns ? pid_ns->level : 0)
 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
-               ctf_integer(unsigned int, ns_inum, pid_ns ? pid_ns->lttng_ns_inum : 0)
+               ctf_integer(unsigned int, ns_inum, pid_ns ? pid_ns->ns.inum : 0)
 #endif
        )
 )
@@ -165,7 +164,7 @@ LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_user_ns,
                ctf_integer(int, ns_level, user_ns ? user_ns->level : 0)
 #endif
 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
-               ctf_integer(unsigned int, ns_inum, user_ns ? user_ns->lttng_ns_inum : 0)
+               ctf_integer(unsigned int, ns_inum, user_ns ? user_ns->ns.inum : 0)
 #endif
        )
 )
@@ -178,7 +177,7 @@ LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_uts_ns,
        TP_FIELDS(
                ctf_integer(pid_t, tid, p->pid)
 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
-               ctf_integer(unsigned int, ns_inum, uts_ns ? uts_ns->lttng_ns_inum : 0)
+               ctf_integer(unsigned int, ns_inum, uts_ns ? uts_ns->ns.inum : 0)
 #endif
        )
 )
@@ -192,7 +191,7 @@ LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_time_ns,
        TP_ARGS(session, p, time_ns),
        TP_FIELDS(
                ctf_integer(pid_t, tid, p->pid)
-               ctf_integer(unsigned int, ns_inum, time_ns ? time_ns->lttng_ns_inum : 0)
+               ctf_integer(unsigned int, ns_inum, time_ns ? time_ns->ns.inum : 0)
        )
 )
 #endif
index c1c3df15c2617b23aa42fb09dbadcf3577e2e7a8..f10f94d4d8bfacf61b10f455f7f863e80a541e51 100644 (file)
@@ -13,7 +13,6 @@
 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0))
 #include <linux/sched/rt.h>
 #endif
-#include <wrapper/namespace.h>
 
 #define LTTNG_MAX_PID_NS_LEVEL 32
 
@@ -544,7 +543,7 @@ LTTNG_TRACEPOINT_EVENT_CODE(sched_process_fork,
                                        pid_ns = task_active_pid_ns(parent);
                                        if (pid_ns)
                                                parent_ns_inum =
-                                                       pid_ns->lttng_ns_inum;
+                                                       pid_ns->ns.inum;
                                }
                                parent_ns_inum;
                        }))
@@ -564,7 +563,7 @@ LTTNG_TRACEPOINT_EVENT_CODE(sched_process_fork,
                                        pid_ns = task_active_pid_ns(child);
                                        if (pid_ns)
                                                child_ns_inum =
-                                                       pid_ns->lttng_ns_inum;
+                                                       pid_ns->ns.inum;
                                }
                                child_ns_inum;
                        }))
diff --git a/include/wrapper/namespace.h b/include/wrapper/namespace.h
deleted file mode 100644 (file)
index 97eb235..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
- *
- * wrapper/namespace.h
- *
- * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- *               2019 Michael Jeanson <mjeanson@efficios.com>
- *
- */
-
-#ifndef _LTTNG_WRAPPER_NAMESPACE_H
-#define _LTTNG_WRAPPER_NAMESPACE_H
-
-#include <lttng/kernel-version.h>
-
-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,0))
-#define lttng_ns_inum ns.inum
-#else
-#define lttng_ns_inum proc_inum
-#endif
-
-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,5,0))
-#define lttng_user_ns_parent parent
-#else
-#define lttng_user_ns_parent creator->user_ns
-#endif
-
-#endif /* _LTTNG_WRAPPER_NAMESPACE_H */
index 656ab8fb1d445444433be98fa475f7e47110fb39..27659db8334e92adcc8dbbc2bfa9da71402020a2 100644 (file)
@@ -17,7 +17,6 @@
 #include <lttng/events-internal.h>
 #include <ringbuffer/frontend_types.h>
 #include <wrapper/vmalloc.h>
-#include <wrapper/namespace.h>
 #include <lttng/tracer.h>
 
 #if defined(CONFIG_CGROUPS) && \
@@ -49,7 +48,7 @@ void cgroup_ns_record(void *priv, struct lttng_kernel_probe_ctx *probe_ctx,
         * namespaces, just dereference the pointers.
         */
        if (current->nsproxy)
-               cgroup_ns_inum = current->nsproxy->cgroup_ns->lttng_ns_inum;
+               cgroup_ns_inum = current->nsproxy->cgroup_ns->ns.inum;
 
        chan->ops->event_write(ctx, &cgroup_ns_inum, sizeof(cgroup_ns_inum), lttng_alignof(cgroup_ns_inum));
 }
@@ -69,7 +68,7 @@ void cgroup_ns_get_value(void *priv,
         * namespaces, just dereference the pointers.
         */
        if (current->nsproxy)
-               cgroup_ns_inum = current->nsproxy->cgroup_ns->lttng_ns_inum;
+               cgroup_ns_inum = current->nsproxy->cgroup_ns->ns.inum;
 
        value->u.s64 = cgroup_ns_inum;
 }
index 80ef40c92b9d509f7cf9d534705565d33d936f99..e6d662bbc146c2dec7ba45024022f487c1800b2e 100644 (file)
@@ -17,7 +17,6 @@
 #include <lttng/events-internal.h>
 #include <ringbuffer/frontend_types.h>
 #include <wrapper/vmalloc.h>
-#include <wrapper/namespace.h>
 #include <lttng/tracer.h>
 
 #if defined(CONFIG_IPC_NS) && \
@@ -48,7 +47,7 @@ void ipc_ns_record(void *priv, struct lttng_kernel_probe_ctx *probe_ctx,
         * namespaces, just dereference the pointers.
         */
        if (current->nsproxy)
-               ipc_ns_inum = current->nsproxy->ipc_ns->lttng_ns_inum;
+               ipc_ns_inum = current->nsproxy->ipc_ns->ns.inum;
 
        chan->ops->event_write(ctx, &ipc_ns_inum, sizeof(ipc_ns_inum), lttng_alignof(ipc_ns_inum));
 }
@@ -68,7 +67,7 @@ void ipc_ns_get_value(void *priv,
         * namespaces, just dereference the pointers.
         */
        if (current->nsproxy)
-               ipc_ns_inum = current->nsproxy->ipc_ns->lttng_ns_inum;
+               ipc_ns_inum = current->nsproxy->ipc_ns->ns.inum;
 
        value->u.s64 = ipc_ns_inum;
 }
index 1757d5a40994ecfdc28088b745db734604dfe590..cc41dc7d489380ca89c69c2bfa8e2047598bb5a7 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/nsproxy.h>
 #include <ringbuffer/frontend_types.h>
 #include <wrapper/vmalloc.h>
-#include <wrapper/namespace.h>
 #include <lttng/tracer.h>
 
 #if !defined(LTTNG_MNT_NS_MISSING_HEADER) && \
@@ -50,7 +49,7 @@ void mnt_ns_record(void *priv, struct lttng_kernel_probe_ctx *probe_ctx,
         * namespaces, just dereference the pointers.
         */
        if (current->nsproxy)
-               mnt_ns_inum = current->nsproxy->mnt_ns->lttng_ns_inum;
+               mnt_ns_inum = current->nsproxy->mnt_ns->ns.inum;
 
        chan->ops->event_write(ctx, &mnt_ns_inum, sizeof(mnt_ns_inum), lttng_alignof(mnt_ns_inum));
 }
@@ -70,7 +69,7 @@ void mnt_ns_get_value(void *priv,
         * namespaces, just dereference the pointers.
         */
        if (current->nsproxy)
-               mnt_ns_inum = current->nsproxy->mnt_ns->lttng_ns_inum;
+               mnt_ns_inum = current->nsproxy->mnt_ns->ns.inum;
 
        value->u.s64 = mnt_ns_inum;
 }
index 3e3c3944a48e5e0b9af849da646a7f0cf2307396..4bc046db1bf494363dc5dbc41f502e88ebad4808 100644 (file)
@@ -18,7 +18,6 @@
 #include <lttng/events-internal.h>
 #include <ringbuffer/frontend_types.h>
 #include <wrapper/vmalloc.h>
-#include <wrapper/namespace.h>
 #include <lttng/tracer.h>
 
 #if defined(CONFIG_NET_NS) && \
@@ -49,7 +48,7 @@ void net_ns_record(void *priv, struct lttng_kernel_probe_ctx *probe_ctx,
         * namespaces, just dereference the pointers.
         */
        if (current->nsproxy)
-               net_ns_inum = current->nsproxy->net_ns->lttng_ns_inum;
+               net_ns_inum = current->nsproxy->net_ns->ns.inum;
 
        chan->ops->event_write(ctx, &net_ns_inum, sizeof(net_ns_inum), lttng_alignof(net_ns_inum));
 }
@@ -69,7 +68,7 @@ void net_ns_get_value(void *priv,
         * namespaces, just dereference the pointers.
         */
        if (current->nsproxy)
-               net_ns_inum = current->nsproxy->net_ns->lttng_ns_inum;
+               net_ns_inum = current->nsproxy->net_ns->ns.inum;
 
        value->u.s64 = net_ns_inum;
 }
index 965580bad0171261fc1c842c4a7b839428fe524c..fa66b1dda277c7549c38fb57e6feec0b5837bf06 100644 (file)
@@ -17,7 +17,6 @@
 #include <lttng/events-internal.h>
 #include <ringbuffer/frontend_types.h>
 #include <wrapper/vmalloc.h>
-#include <wrapper/namespace.h>
 #include <lttng/tracer.h>
 
 #if defined(CONFIG_PID_NS) && \
@@ -49,7 +48,7 @@ void pid_ns_record(void *priv, struct lttng_kernel_probe_ctx *probe_ctx,
        ns = task_active_pid_ns(current);
 
        if (ns)
-               pid_ns_inum = ns->lttng_ns_inum;
+               pid_ns_inum = ns->ns.inum;
 
        chan->ops->event_write(ctx, &pid_ns_inum, sizeof(pid_ns_inum), lttng_alignof(pid_ns_inum));
 }
@@ -70,7 +69,7 @@ void pid_ns_get_value(void *priv,
        ns = task_active_pid_ns(current);
 
        if (ns)
-               pid_ns_inum = ns->lttng_ns_inum;
+               pid_ns_inum = ns->ns.inum;
 
        value->u.s64 = pid_ns_inum;
 }
index 78a8f2edd50d1d028b152520b7c32da78932563e..ff8e802fcc4116495438029fd066108789ddfdc2 100644 (file)
@@ -18,7 +18,6 @@
 #include <lttng/events-internal.h>
 #include <ringbuffer/frontend_types.h>
 #include <wrapper/vmalloc.h>
-#include <wrapper/namespace.h>
 #include <lttng/tracer.h>
 
 #if defined(CONFIG_TIME_NS)
@@ -48,7 +47,7 @@ void time_ns_record(void *priv, struct lttng_kernel_probe_ctx *probe_ctx,
         * namespaces, just dereference the pointers.
         */
        if (current->nsproxy)
-               time_ns_inum = current->nsproxy->time_ns->lttng_ns_inum;
+               time_ns_inum = current->nsproxy->time_ns->ns.inum;
 
        chan->ops->event_write(ctx, &time_ns_inum, sizeof(time_ns_inum), lttng_alignof(time_ns_inum));
 }
@@ -68,7 +67,7 @@ void time_ns_get_value(void *priv,
         * namespaces, just dereference the pointers.
         */
        if (current->nsproxy)
-               time_ns_inum = current->nsproxy->time_ns->lttng_ns_inum;
+               time_ns_inum = current->nsproxy->time_ns->ns.inum;
 
        value->u.s64 = time_ns_inum;
 }
index 5ed0cc037abde64eac0e4c41187f523021d1e1ba..ab9afa4edade5c9fe47cfb52cb3cfc37e81e7385 100644 (file)
@@ -17,7 +17,6 @@
 #include <lttng/events-internal.h>
 #include <ringbuffer/frontend_types.h>
 #include <wrapper/vmalloc.h>
-#include <wrapper/namespace.h>
 #include <lttng/tracer.h>
 
 #if defined(CONFIG_USER_NS) && \
@@ -41,7 +40,7 @@ void user_ns_record(void *priv, struct lttng_kernel_probe_ctx *probe_ctx,
        unsigned int user_ns_inum = 0;
 
        if (current_user_ns())
-               user_ns_inum = current_user_ns()->lttng_ns_inum;
+               user_ns_inum = current_user_ns()->ns.inum;
 
        chan->ops->event_write(ctx, &user_ns_inum, sizeof(user_ns_inum), lttng_alignof(user_ns_inum));
 }
@@ -54,7 +53,7 @@ void user_ns_get_value(void *priv,
        unsigned int user_ns_inum = 0;
 
        if (current_user_ns())
-               user_ns_inum = current_user_ns()->lttng_ns_inum;
+               user_ns_inum = current_user_ns()->ns.inum;
 
        value->u.s64 = user_ns_inum;
 }
index 76e7b3d7d01394253d6acba64bfbb5fbbdadb1ec..455b16038bdad31edef3457ddd3fb4168761449e 100644 (file)
@@ -17,7 +17,6 @@
 #include <lttng/events-internal.h>
 #include <ringbuffer/frontend_types.h>
 #include <wrapper/vmalloc.h>
-#include <wrapper/namespace.h>
 #include <lttng/tracer.h>
 
 #if defined(CONFIG_UTS_NS) && \
@@ -48,7 +47,7 @@ void uts_ns_record(void *priv, struct lttng_kernel_probe_ctx *probe_ctx,
         * namespaces, just dereference the pointers.
         */
        if (current->nsproxy)
-               uts_ns_inum = current->nsproxy->uts_ns->lttng_ns_inum;
+               uts_ns_inum = current->nsproxy->uts_ns->ns.inum;
 
        chan->ops->event_write(ctx, &uts_ns_inum, sizeof(uts_ns_inum), lttng_alignof(uts_ns_inum));
 }
@@ -68,7 +67,7 @@ void uts_ns_get_value(void *priv,
         * namespaces, just dereference the pointers.
         */
        if (current->nsproxy)
-               uts_ns_inum = current->nsproxy->uts_ns->lttng_ns_inum;
+               uts_ns_inum = current->nsproxy->uts_ns->ns.inum;
 
        value->u.s64 = uts_ns_inum;
 }
index 95032f87a2db4f2cefa0a4bcf31a9b61c41ccb48..65efc54b2741e7dc6f2e9230e7a0760edc2929aa 100644 (file)
@@ -39,7 +39,6 @@
 #include <wrapper/cpu.h>
 #include <wrapper/irqdesc.h>
 #include <wrapper/fdtable.h>
-#include <wrapper/namespace.h>
 #include <wrapper/tracepoint.h>
 #include <wrapper/blkdev.h>
 #include <wrapper/fdtable.h>
@@ -599,7 +598,7 @@ void lttng_statedump_process_ns(struct lttng_kernel_session *session,
                 * paranoid behavior of
                 * trace_lttng_statedump_process_user_ns().
                 */
-               user_ns = user_ns ? user_ns->lttng_user_ns_parent : NULL;
+               user_ns = user_ns ? user_ns->parent : NULL;
        } while (user_ns);
 
        /*
This page took 0.050363 seconds and 4 git commands to generate.