From c5e8ef85e4c09e2f91a226195dc59f8b0bd6fd60 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Tue, 6 Apr 2021 19:57:21 -0400 Subject: [PATCH] Move ns.h to 'src/common/' Change-Id: Ibddbf741bdc7a4b1bcc1602cf636b71ac12683df Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- src/common/Makefile.am | 1 + src/{lib/lttng-ust => common}/ns.h | 8 ++++++++ src/lib/lttng-ust/Makefile.am | 1 - src/lib/lttng-ust/lttng-context-cgroup-ns.c | 2 +- src/lib/lttng-ust/lttng-context-ipc-ns.c | 2 +- src/lib/lttng-ust/lttng-context-mnt-ns.c | 2 +- src/lib/lttng-ust/lttng-context-net-ns.c | 2 +- src/lib/lttng-ust/lttng-context-pid-ns.c | 2 +- src/lib/lttng-ust/lttng-context-time-ns.c | 2 +- src/lib/lttng-ust/lttng-context-user-ns.c | 2 +- src/lib/lttng-ust/lttng-context-uts-ns.c | 2 +- src/lib/lttng-ust/lttng-tracer-core.h | 8 -------- 12 files changed, 17 insertions(+), 17 deletions(-) rename src/{lib/lttng-ust => common}/ns.h (76%) diff --git a/src/common/Makefile.am b/src/common/Makefile.am index 15aba9b5..f89dd1c3 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -20,6 +20,7 @@ noinst_HEADERS = \ jhash.h \ logging.h \ macros.h \ + ns.h \ patient.h \ procname.h \ safe-snprintf.h \ diff --git a/src/lib/lttng-ust/ns.h b/src/common/ns.h similarity index 76% rename from src/lib/lttng-ust/ns.h rename to src/common/ns.h index 1a848ccc..6f28a825 100644 --- a/src/lib/lttng-ust/ns.h +++ b/src/common/ns.h @@ -24,4 +24,12 @@ enum ns_ino_state { NS_INO_MIN = 0xF0000000, }; +/* + * The longest possible namespace proc path is with the cgroup ns + * and the maximum theoretical linux pid of 536870912 : + * + * /proc/self/task/536870912/ns/cgroup + */ +#define LTTNG_PROC_NS_PATH_MAX 40 + #endif /* _LTTNG_NS_H */ diff --git a/src/lib/lttng-ust/Makefile.am b/src/lib/lttng-ust/Makefile.am index 7537bb7d..4bd39a3c 100644 --- a/src/lib/lttng-ust/Makefile.am +++ b/src/lib/lttng-ust/Makefile.am @@ -85,7 +85,6 @@ liblttng_ust_runtime_la_SOURCES = \ string-utils.c \ string-utils.h \ event-notifier-notification.c \ - ns.h \ rculfhash.c \ rculfhash.h \ rculfhash-internal.h \ diff --git a/src/lib/lttng-ust/lttng-context-cgroup-ns.c b/src/lib/lttng-ust/lttng-context-cgroup-ns.c index 305ed8cd..0a688db1 100644 --- a/src/lib/lttng-ust/lttng-context-cgroup-ns.c +++ b/src/lib/lttng-ust/lttng-context-cgroup-ns.c @@ -21,7 +21,7 @@ #include "context-internal.h" #include "lttng-tracer-core.h" -#include "ns.h" +#include "common/ns.h" /* diff --git a/src/lib/lttng-ust/lttng-context-ipc-ns.c b/src/lib/lttng-ust/lttng-context-ipc-ns.c index c5867fb4..a122d423 100644 --- a/src/lib/lttng-ust/lttng-context-ipc-ns.c +++ b/src/lib/lttng-ust/lttng-context-ipc-ns.c @@ -21,7 +21,7 @@ #include "context-internal.h" #include "lttng-tracer-core.h" -#include "ns.h" +#include "common/ns.h" /* * We cache the result to ensure we don't stat(2) the proc filesystem on diff --git a/src/lib/lttng-ust/lttng-context-mnt-ns.c b/src/lib/lttng-ust/lttng-context-mnt-ns.c index 61812625..3642b023 100644 --- a/src/lib/lttng-ust/lttng-context-mnt-ns.c +++ b/src/lib/lttng-ust/lttng-context-mnt-ns.c @@ -18,7 +18,7 @@ #include #include "context-internal.h" -#include "ns.h" +#include "common/ns.h" /* * We cache the result to ensure we don't stat(2) the proc filesystem on diff --git a/src/lib/lttng-ust/lttng-context-net-ns.c b/src/lib/lttng-ust/lttng-context-net-ns.c index e7c8f9f9..242b2e80 100644 --- a/src/lib/lttng-ust/lttng-context-net-ns.c +++ b/src/lib/lttng-ust/lttng-context-net-ns.c @@ -21,7 +21,7 @@ #include "context-internal.h" #include "lttng-tracer-core.h" -#include "ns.h" +#include "common/ns.h" /* * We cache the result to ensure we don't stat(2) the proc filesystem on diff --git a/src/lib/lttng-ust/lttng-context-pid-ns.c b/src/lib/lttng-ust/lttng-context-pid-ns.c index 4e42e6b5..05b309b8 100644 --- a/src/lib/lttng-ust/lttng-context-pid-ns.c +++ b/src/lib/lttng-ust/lttng-context-pid-ns.c @@ -18,7 +18,7 @@ #include #include "context-internal.h" -#include "ns.h" +#include "common/ns.h" /* * We cache the result to ensure we don't stat(2) the proc filesystem on diff --git a/src/lib/lttng-ust/lttng-context-time-ns.c b/src/lib/lttng-ust/lttng-context-time-ns.c index 75e3e365..e8a9e01a 100644 --- a/src/lib/lttng-ust/lttng-context-time-ns.c +++ b/src/lib/lttng-ust/lttng-context-time-ns.c @@ -19,7 +19,7 @@ #include "common/compat/tid.h" #include #include "lttng-tracer-core.h" -#include "ns.h" +#include "common/ns.h" #include "context-internal.h" diff --git a/src/lib/lttng-ust/lttng-context-user-ns.c b/src/lib/lttng-ust/lttng-context-user-ns.c index 9d31da5e..ead9f14c 100644 --- a/src/lib/lttng-ust/lttng-context-user-ns.c +++ b/src/lib/lttng-ust/lttng-context-user-ns.c @@ -18,7 +18,7 @@ #include #include "context-internal.h" -#include "ns.h" +#include "common/ns.h" /* * We cache the result to ensure we don't stat(2) the proc filesystem on diff --git a/src/lib/lttng-ust/lttng-context-uts-ns.c b/src/lib/lttng-ust/lttng-context-uts-ns.c index b28fe874..5e37ae8f 100644 --- a/src/lib/lttng-ust/lttng-context-uts-ns.c +++ b/src/lib/lttng-ust/lttng-context-uts-ns.c @@ -21,7 +21,7 @@ #include "context-internal.h" #include "lttng-tracer-core.h" -#include "ns.h" +#include "common/ns.h" /* diff --git a/src/lib/lttng-ust/lttng-tracer-core.h b/src/lib/lttng-ust/lttng-tracer-core.h index 04ba642e..096ed28f 100644 --- a/src/lib/lttng-ust/lttng-tracer-core.h +++ b/src/lib/lttng-ust/lttng-tracer-core.h @@ -16,14 +16,6 @@ #include #include "common/logging.h" -/* - * The longuest possible namespace proc path is with the cgroup ns - * and the maximum theoretical linux pid of 536870912 : - * - * /proc/self/task/536870912/ns/cgroup - */ -#define LTTNG_PROC_NS_PATH_MAX 40 - struct lttng_ust_session; struct lttng_ust_channel_buffer; struct lttng_ust_ctx_field; -- 2.34.1