tracing: fixes
Steven Rostedt
maintainerIngo,
Please pull the latest tip/perf/urgent tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
tip/perf/urgent
Head SHA1: 348f0fc238efb441a28e7644c51f9fd3001b228a
Mark Brown (1):
tracing: Fix build breakage without CONFIG_PERF_EVENTS (again)
Steven Rostedt (1):
tracing: Fix regression with tracing_on
----
kernel/trace/trace.c | 8 +++++--- kernel/trace/trace.h | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-)
Steven Rostedt
maintainerPATCH 1/2 tracing: Fix build breakage without CONFIG_PERF_EVENTS (again)
From: Mark Brown <[email protected]>
Today's -next fails to link for me:
kernel/built-in.o:(.data+0x178e50): undefined reference to `perf_ftrace_event_register'
It looks like multiple fixes have been merged for the issue fixed by commit fa73dc9 (tracing: Fix build breakage without CONFIG_PERF_EVENTS) though I can't identify the other changes that have gone in at the minute, it's possible that the changes which caused the breakage fixed by the previous commit got dropped but the fix made it in.
--- kernel/trace/trace.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/trace/trace.h +2 -2
@@ -836,11 +836,11 @@ extern const char *__stop___trace_bprintk_fmt[]; filter)#include "trace_entries.h" -#ifdef CONFIG_FUNCTION_TRACER +#if defined(CONFIG_PERF_EVENTS ) && defined(CONFIG_FUNCTION_TRACER )int perf_ftrace_event_register (struct ftrace_event_call *call,enum trace_reg type,void *data);#else #define perf_ftrace_event_register NULL -#endif /* CONFIG_FUNCTION_TRACER */ +#endif #endif /* _LINUX_KERNEL_TRACE_H */
Signature · 1 line
1.7.9.5
Steven Rostedt
maintainerPATCH 2/2 tracing: Fix regression with tracing_on
In reply to Steven RostedtFrom: Steven Rostedt <[email protected]>
The change to make tracing_on affect only the ftrace ring buffer, caused a bug where it wont affect any ring buffer. The problem was that the buffer of the trace_array was passed to the write function and not the trace array itself.
The trace_array can change the buffer when running a latency tracer. If this happens, then the buffer being disabled may not be the buffer currently used by ftrace. This will cause the tracing_on file to become useless.
The simple fix is to pass the trace_array to the write function instead of the buffer. Then the actual buffer may be changed.
--- kernel/trace/trace.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
kernel/trace/trace.c +5 -3
@@ -4629,7 +4629,8 @@ static ssize_t rb_simple_read(struct file *filp, char __user *ubuf, size_t cnt, loff_t *ppos) { - struct ring_buffer *buffer = filp->private_data; + struct trace_array *tr = filp->private_data; +struct ring_buffer *buffer = tr->buffer;char buf[64 ];int r;
@@ -4647,7 +4648,8 @@ static ssize_t rb_simple_write(struct file *filp, const char __user *ubuf, size_t cnt, loff_t *ppos) { - struct ring_buffer *buffer = filp->private_data; + struct trace_array *tr = filp->private_data; +struct ring_buffer *buffer = tr->buffer;unsigned long val;int ret;
@@ -4734,7 +4736,7 @@ static __init int tracer_init_debugfs(void) &trace_clock_fops);trace_create_file ("tracing_on" ,0644 , d_tracer, - global_trace.buffer, &rb_simple_fops); + &global_trace, &rb_simple_fops);#ifdef CONFIG_DYNAMIC_FTRACE trace_create_file("dyn_ftrace_total_info", 0444, d_tracer,
Signature · 1 line
1.7.9.5