2022-03-30 05:06:23

by Jeff Xie

[permalink] [raw]
Subject: [PATCH 1/3] tracing: make tracepoint_iter_lock public

The syscall tracepoints need tracepoint_iter_lock for the tp_printk work.

Signed-off-by: Jeff Xie <[email protected]>
---
kernel/trace/trace.c | 2 +-
kernel/trace/trace.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index eaf7d30ca6f1..867f00473f9f 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2833,7 +2833,7 @@ trace_event_buffer_lock_reserve(struct trace_buffer **current_rb,
}
EXPORT_SYMBOL_GPL(trace_event_buffer_lock_reserve);

-static DEFINE_SPINLOCK(tracepoint_iter_lock);
+DEFINE_SPINLOCK(tracepoint_iter_lock);
static DEFINE_MUTEX(tracepoint_printk_mutex);

static void output_printk(struct trace_event_buffer *fbuffer)
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 0f5e22238cd2..7ce345699ac2 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -1523,6 +1523,7 @@ static inline void *event_file_data(struct file *filp)

extern struct mutex event_mutex;
extern struct list_head ftrace_events;
+extern spinlock_t tracepoint_iter_lock;

extern const struct file_operations event_trigger_fops;
extern const struct file_operations event_hist_fops;
--
2.25.1