From: Michael Jeanson Date: Fri, 18 Nov 2022 17:07:09 +0000 (-0500) Subject: Drop 'wrapper/namespace.h' wrapper X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=93e5bcec1d8d550a1983bbc013248dbd83573cc7;p=lttng-modules.git Drop 'wrapper/namespace.h' wrapper Change-Id: Ib7ff96f36310cdcbe29fed279ab4a03ca96195e8 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/include/instrumentation/events/lttng-statedump.h b/include/instrumentation/events/lttng-statedump.h index 345beee5..e88fec57 100644 --- a/include/instrumentation/events/lttng-statedump.h +++ b/include/instrumentation/events/lttng-statedump.h @@ -15,7 +15,6 @@ #include #include #include -#include #include #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 diff --git a/include/instrumentation/events/sched.h b/include/instrumentation/events/sched.h index c1c3df15..f10f94d4 100644 --- a/include/instrumentation/events/sched.h +++ b/include/instrumentation/events/sched.h @@ -13,7 +13,6 @@ #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0)) #include #endif -#include #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 index 97eb235c..00000000 --- a/include/wrapper/namespace.h +++ /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 - * 2019 Michael Jeanson - * - */ - -#ifndef _LTTNG_WRAPPER_NAMESPACE_H -#define _LTTNG_WRAPPER_NAMESPACE_H - -#include - -#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 */ diff --git a/src/lttng-context-cgroup-ns.c b/src/lttng-context-cgroup-ns.c index 656ab8fb..27659db8 100644 --- a/src/lttng-context-cgroup-ns.c +++ b/src/lttng-context-cgroup-ns.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #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; } diff --git a/src/lttng-context-ipc-ns.c b/src/lttng-context-ipc-ns.c index 80ef40c9..e6d662bb 100644 --- a/src/lttng-context-ipc-ns.c +++ b/src/lttng-context-ipc-ns.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #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; } diff --git a/src/lttng-context-mnt-ns.c b/src/lttng-context-mnt-ns.c index 1757d5a4..cc41dc7d 100644 --- a/src/lttng-context-mnt-ns.c +++ b/src/lttng-context-mnt-ns.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #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; } diff --git a/src/lttng-context-net-ns.c b/src/lttng-context-net-ns.c index 3e3c3944..4bc046db 100644 --- a/src/lttng-context-net-ns.c +++ b/src/lttng-context-net-ns.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #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; } diff --git a/src/lttng-context-pid-ns.c b/src/lttng-context-pid-ns.c index 965580ba..fa66b1dd 100644 --- a/src/lttng-context-pid-ns.c +++ b/src/lttng-context-pid-ns.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #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; } diff --git a/src/lttng-context-time-ns.c b/src/lttng-context-time-ns.c index 78a8f2ed..ff8e802f 100644 --- a/src/lttng-context-time-ns.c +++ b/src/lttng-context-time-ns.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #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; } diff --git a/src/lttng-context-user-ns.c b/src/lttng-context-user-ns.c index 5ed0cc03..ab9afa4e 100644 --- a/src/lttng-context-user-ns.c +++ b/src/lttng-context-user-ns.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #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; } diff --git a/src/lttng-context-uts-ns.c b/src/lttng-context-uts-ns.c index 76e7b3d7..455b1603 100644 --- a/src/lttng-context-uts-ns.c +++ b/src/lttng-context-uts-ns.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #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; } diff --git a/src/lttng-statedump-impl.c b/src/lttng-statedump-impl.c index 95032f87..65efc54b 100644 --- a/src/lttng-statedump-impl.c +++ b/src/lttng-statedump-impl.c @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include @@ -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); /*