Move ns.h to 'src/common/'
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 6 Apr 2021 23:57:21 +0000 (19:57 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 13 Apr 2021 18:54:32 +0000 (14:54 -0400)
Change-Id: Ibddbf741bdc7a4b1bcc1602cf636b71ac12683df
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 files changed:
src/common/Makefile.am
src/common/ns.h [new file with mode: 0644]
src/lib/lttng-ust/Makefile.am
src/lib/lttng-ust/lttng-context-cgroup-ns.c
src/lib/lttng-ust/lttng-context-ipc-ns.c
src/lib/lttng-ust/lttng-context-mnt-ns.c
src/lib/lttng-ust/lttng-context-net-ns.c
src/lib/lttng-ust/lttng-context-pid-ns.c
src/lib/lttng-ust/lttng-context-time-ns.c
src/lib/lttng-ust/lttng-context-user-ns.c
src/lib/lttng-ust/lttng-context-uts-ns.c
src/lib/lttng-ust/lttng-tracer-core.h
src/lib/lttng-ust/ns.h [deleted file]

index 15aba9b5afae87d89cbccedf836f7a3d1c69e8d8..f89dd1c37d6e8e16375614365466bca2f1d539fc 100644 (file)
@@ -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/common/ns.h b/src/common/ns.h
new file mode 100644 (file)
index 0000000..6f28a82
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ * Copyright (C) 2019 Michael Jeanson <mjeanson@efficios.com>
+ */
+
+#ifndef _LTTNG_NS_H
+#define _LTTNG_NS_H
+
+/*
+ * The lowest valid inode number that can be allocated in the proc filesystem
+ * is 0xF0000000. Any number below can be used internally as an error code.
+ *
+ * Zero is used in the kernel as an error code, it's the value we will return
+ * when we fail to read the proper inode number.
+ *
+ * One is used internally to identify an uninitialized cache entry, it should
+ * never be returned.
+ */
+
+enum ns_ino_state {
+       NS_INO_UNAVAILABLE      = 0x0,
+       NS_INO_UNINITIALIZED    = 0x1,
+       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 */
index 7537bb7d7fa3f2188d34b5777ac18e2e0acb6bc2..4bd39a3cc7f6fd77ddc533c93ce921d29c9a6e5b 100644 (file)
@@ -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 \
index 305ed8cd40ac56f9ce3ba290670c233b3fa0b59c..0a688db102e27b2684e70e6c94f715b89d9c5e93 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "context-internal.h"
 #include "lttng-tracer-core.h"
-#include "ns.h"
+#include "common/ns.h"
 
 
 /*
index c5867fb494771edc760030d500c5e75228964fb2..a122d4236e7c7bf7fedea20286530ffd3924c4b1 100644 (file)
@@ -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
index 61812625c2b74b50c9c358c096b15f889fe0560c..3642b023adb27e316733ba19ec42d41bc5271a4e 100644 (file)
@@ -18,7 +18,7 @@
 #include <lttng/ringbuffer-context.h>
 
 #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
index e7c8f9f9c5a181a830af4d2544980c5600e0465c..242b2e80772621957494e007d483ad9d229197a2 100644 (file)
@@ -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
index 4e42e6b54d033925601c447b0577516c4c841e0f..05b309b8d218777d47f24e9157d872c1d2fd091e 100644 (file)
@@ -18,7 +18,7 @@
 #include <lttng/ringbuffer-context.h>
 
 #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
index 75e3e36506f1bf7608ec9818830779d3584c36b6..e8a9e01a3c3329467b36285626962bf78720db0d 100644 (file)
@@ -19,7 +19,7 @@
 #include "common/compat/tid.h"
 #include <urcu/tls-compat.h>
 #include "lttng-tracer-core.h"
-#include "ns.h"
+#include "common/ns.h"
 #include "context-internal.h"
 
 
index 9d31da5e8e4f2487f718548c837a8a3052d659f2..ead9f14c26c417880d64ee34028c5000de60971c 100644 (file)
@@ -18,7 +18,7 @@
 #include <lttng/ringbuffer-context.h>
 
 #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
index b28fe8749a7f3f22da94fb9291a9e6b962216cc7..5e37ae8f479a196953585826cb0eb7478cc9de8c 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "context-internal.h"
 #include "lttng-tracer-core.h"
-#include "ns.h"
+#include "common/ns.h"
 
 
 /*
index 04ba642e917065512f8f724d29f78459cbc398b5..096ed28fae97b3bc28af55370428bf31beec79ff 100644 (file)
 #include <lttng/ringbuffer-context.h>
 #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;
diff --git a/src/lib/lttng-ust/ns.h b/src/lib/lttng-ust/ns.h
deleted file mode 100644 (file)
index 1a848cc..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * SPDX-License-Identifier: LGPL-2.1-only
- *
- * Copyright (C) 2019 Michael Jeanson <mjeanson@efficios.com>
- */
-
-#ifndef _LTTNG_NS_H
-#define _LTTNG_NS_H
-
-/*
- * The lowest valid inode number that can be allocated in the proc filesystem
- * is 0xF0000000. Any number below can be used internally as an error code.
- *
- * Zero is used in the kernel as an error code, it's the value we will return
- * when we fail to read the proper inode number.
- *
- * One is used internally to identify an uninitialized cache entry, it should
- * never be returned.
- */
-
-enum ns_ino_state {
-       NS_INO_UNAVAILABLE      = 0x0,
-       NS_INO_UNINITIALIZED    = 0x1,
-       NS_INO_MIN              = 0xF0000000,
-};
-
-#endif /* _LTTNG_NS_H */
This page took 0.030255 seconds and 4 git commands to generate.