|
|
4edfa2 |
From 4ae3f13373ab43824ddca62d3482584a6296641d Mon Sep 17 00:00:00 2001
|
|
|
4edfa2 |
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
|
|
|
4edfa2 |
Date: Thu, 9 Apr 2020 11:29:18 -0400
|
|
|
4edfa2 |
Subject: [PATCH] Fix: namespace contexts !CONFIG_RCU_TLS variable
|
|
|
4edfa2 |
initialization
|
|
|
4edfa2 |
|
|
|
4edfa2 |
The namespace contexts introduced in lttng-ust 2.12 require to
|
|
|
4edfa2 |
initialize TLS variable to nonzero values. However, in !CONFIG_RCU_TLS
|
|
|
4edfa2 |
(compatibility mode using pthread setspecific), this initialization
|
|
|
4edfa2 |
does not build.
|
|
|
4edfa2 |
|
|
|
4edfa2 |
Use the new DEFINE_URCU_TLS_INIT from liburcu when building
|
|
|
4edfa2 |
!CONFIG_RCU_TLS to fix this issue. Since this requires a dependency on
|
|
|
4edfa2 |
a new liburcu version, only !CONFIG_RCU_TLS adds this dependency in the
|
|
|
4edfa2 |
fix. A followup cleanup patch will use DEFINE_URCU_TLS_INIT as we add
|
|
|
4edfa2 |
a strict version dependency.
|
|
|
4edfa2 |
|
|
|
4edfa2 |
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
|
|
|
4edfa2 |
---
|
|
|
4edfa2 |
liblttng-ust/lttng-context-cgroup-ns.c | 4 ++++
|
|
|
4edfa2 |
liblttng-ust/lttng-context-ipc-ns.c | 5 ++++-
|
|
|
4edfa2 |
liblttng-ust/lttng-context-net-ns.c | 5 ++++-
|
|
|
4edfa2 |
liblttng-ust/lttng-context-uts-ns.c | 4 ++++
|
|
|
4edfa2 |
4 files changed, 16 insertions(+), 2 deletions(-)
|
|
|
4edfa2 |
|
|
|
4edfa2 |
diff --git a/liblttng-ust/lttng-context-cgroup-ns.c b/liblttng-ust/lttng-context-cgroup-ns.c
|
|
|
4edfa2 |
index d4053150..97af2759 100644
|
|
|
4edfa2 |
--- a/liblttng-ust/lttng-context-cgroup-ns.c
|
|
|
4edfa2 |
+++ b/liblttng-ust/lttng-context-cgroup-ns.c
|
|
|
4edfa2 |
@@ -38,7 +38,11 @@
|
|
|
4edfa2 |
* We cache the result to ensure we don't stat(2) the proc filesystem on
|
|
|
4edfa2 |
* each event.
|
|
|
4edfa2 |
*/
|
|
|
4edfa2 |
+#ifdef CONFIG_RCU_TLS
|
|
|
4edfa2 |
static DEFINE_URCU_TLS(ino_t, cached_cgroup_ns) = NS_INO_UNINITIALIZED;
|
|
|
4edfa2 |
+#else
|
|
|
4edfa2 |
+static DEFINE_URCU_TLS_INIT(ino_t, cached_cgroup_ns, NS_INO_UNINITIALIZED);
|
|
|
4edfa2 |
+#endif
|
|
|
4edfa2 |
|
|
|
4edfa2 |
static
|
|
|
4edfa2 |
ino_t get_cgroup_ns(void)
|
|
|
4edfa2 |
diff --git a/liblttng-ust/lttng-context-ipc-ns.c b/liblttng-ust/lttng-context-ipc-ns.c
|
|
|
4edfa2 |
index c973dc86..a05a6c61 100644
|
|
|
4edfa2 |
--- a/liblttng-ust/lttng-context-ipc-ns.c
|
|
|
4edfa2 |
+++ b/liblttng-ust/lttng-context-ipc-ns.c
|
|
|
4edfa2 |
@@ -33,12 +33,15 @@
|
|
|
4edfa2 |
#include "lttng-tracer-core.h"
|
|
|
4edfa2 |
#include "ns.h"
|
|
|
4edfa2 |
|
|
|
4edfa2 |
-
|
|
|
4edfa2 |
/*
|
|
|
4edfa2 |
* We cache the result to ensure we don't stat(2) the proc filesystem on
|
|
|
4edfa2 |
* each event.
|
|
|
4edfa2 |
*/
|
|
|
4edfa2 |
+#ifdef CONFIG_RCU_TLS
|
|
|
4edfa2 |
static DEFINE_URCU_TLS(ino_t, cached_ipc_ns) = NS_INO_UNINITIALIZED;
|
|
|
4edfa2 |
+#else
|
|
|
4edfa2 |
+static DEFINE_URCU_TLS_INIT(ino_t, cached_ipc_ns, NS_INO_UNINITIALIZED);
|
|
|
4edfa2 |
+#endif
|
|
|
4edfa2 |
|
|
|
4edfa2 |
static
|
|
|
4edfa2 |
ino_t get_ipc_ns(void)
|
|
|
4edfa2 |
diff --git a/liblttng-ust/lttng-context-net-ns.c b/liblttng-ust/lttng-context-net-ns.c
|
|
|
4edfa2 |
index 9d6ded12..c0aaa9d4 100644
|
|
|
4edfa2 |
--- a/liblttng-ust/lttng-context-net-ns.c
|
|
|
4edfa2 |
+++ b/liblttng-ust/lttng-context-net-ns.c
|
|
|
4edfa2 |
@@ -33,12 +33,15 @@
|
|
|
4edfa2 |
#include "lttng-tracer-core.h"
|
|
|
4edfa2 |
#include "ns.h"
|
|
|
4edfa2 |
|
|
|
4edfa2 |
-
|
|
|
4edfa2 |
/*
|
|
|
4edfa2 |
* We cache the result to ensure we don't stat(2) the proc filesystem on
|
|
|
4edfa2 |
* each event.
|
|
|
4edfa2 |
*/
|
|
|
4edfa2 |
+#ifdef CONFIG_RCU_TLS
|
|
|
4edfa2 |
static DEFINE_URCU_TLS(ino_t, cached_net_ns) = NS_INO_UNINITIALIZED;
|
|
|
4edfa2 |
+#else
|
|
|
4edfa2 |
+static DEFINE_URCU_TLS_INIT(ino_t, cached_net_ns, NS_INO_UNINITIALIZED);
|
|
|
4edfa2 |
+#endif
|
|
|
4edfa2 |
|
|
|
4edfa2 |
static
|
|
|
4edfa2 |
ino_t get_net_ns(void)
|
|
|
4edfa2 |
diff --git a/liblttng-ust/lttng-context-uts-ns.c b/liblttng-ust/lttng-context-uts-ns.c
|
|
|
4edfa2 |
index fb2d89f9..778ccb46 100644
|
|
|
4edfa2 |
--- a/liblttng-ust/lttng-context-uts-ns.c
|
|
|
4edfa2 |
+++ b/liblttng-ust/lttng-context-uts-ns.c
|
|
|
4edfa2 |
@@ -38,7 +38,11 @@
|
|
|
4edfa2 |
* We cache the result to ensure we don't stat(2) the proc filesystem on
|
|
|
4edfa2 |
* each event.
|
|
|
4edfa2 |
*/
|
|
|
4edfa2 |
+#ifdef CONFIG_RCU_TLS
|
|
|
4edfa2 |
static DEFINE_URCU_TLS(ino_t, cached_uts_ns) = NS_INO_UNINITIALIZED;
|
|
|
4edfa2 |
+#else
|
|
|
4edfa2 |
+static DEFINE_URCU_TLS_INIT(ino_t, cached_uts_ns, NS_INO_UNINITIALIZED);
|
|
|
4edfa2 |
+#endif
|
|
|
4edfa2 |
|
|
|
4edfa2 |
static
|
|
|
4edfa2 |
ino_t get_uts_ns(void)
|
|
|
4edfa2 |
--
|
|
|
4edfa2 |
2.25.1
|
|
|
4edfa2 |
|