Skip to contentSkip to conversation

Fix BTF confusion in rv.h

PATCH New Gabriele Monaco 1 participant 1 message Nov 23

Subsystems (2)
lore
Share & tools
lore

Gabriele Monaco

author maintainer
#0 lore raw

PATCH 1/1 Fix BTF confusion in rv.h

The private rv.h header includes directly the private ../trace.h header, this brings a series of unneeded dependencies and, if included with da_monitor.h, may cause failures for duplicated symbols in BTF (namely, the events symbol).

Only import what is really necessary:
* trace.h is necessary only in rv.c (init function)
* the public tracepoint.h covers most uses
* other specific headers are now needed (interrupt.h)
* re-define RV_MODE_* as it is only private in trace

---
 kernel/trace/rv/monitors/sts/sts_kunit.c | 1 +
 kernel/trace/rv/rv.c                     | 1 +
 kernel/trace/rv/rv.h                     | 6 +++---
 3 files changed, 5 insertions(+), 3 deletions(-)
kernel/trace/rv/monitors/sts/sts_kunit.c +1 -0
index a07316fff091..92836adbc620 100644
@@ -3,6 +3,7 @@
 #include <linux/rv.h>
 #include <rv/kunit.h>
 #include <trace/events/sched.h>
+#include <linux/interrupt.h>
 #include "sts_kunit.h"
 
 #if IS_REACHABLE(CONFIG_RV_MON_STS)
kernel/trace/rv/rv.c +1 -0
index 29f155c6968b..e37f0f7c990b 100644
@@ -142,6 +142,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
+#include "../trace.h"
 
 #ifdef CONFIG_RV_MON_EVENTS
 #define CREATE_TRACE_POINTS
kernel/trace/rv/rv.h +3 -3
index 62779e6b74bd..dbcb7a3a41a8 100644
@@ -9,12 +9,12 @@ struct rv_interface {
 	struct dentry		*monitors_dir;
 };
 
-#include "../trace.h"
+#include <linux/tracepoint.h>
 #include <linux/tracefs.h>
 #include <linux/rv.h>
 
-#define RV_MODE_WRITE			TRACE_MODE_WRITE
-#define RV_MODE_READ			TRACE_MODE_READ
+#define RV_MODE_WRITE			0640
+#define RV_MODE_READ			0440
 
 #define rv_create_dir			tracefs_create_dir
 #define rv_create_file			tracefs_create_file

base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb

Signature · 1 line
2.56.1