summaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_events.c
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2015-09-25 17:38:44 -0400
committerSteven Rostedt <rostedt@goodmis.org>2015-09-25 17:38:44 -0400
commitb7f0c959edfb4448f94bd33c39fda08e10ce6ede (patch)
tree0fa8e235ddef84d30f83a520ce259f787c15b7b4 /kernel/trace/trace_events.c
parent41907416bc24412f839559ea10a2b9e4eeb21aa7 (diff)
downloadlinux-b7f0c959edfb4448f94bd33c39fda08e10ce6ede.tar.bz2
tracing: Pass trace_array into trace_buffer_unlock_commit()
In preparation for having trace options be per instance, the trace_array needs to be passed to the trace_buffer_unlock_commit(). The trace_event_buffer_lock_reserve() already passes in the trace_event_file where the trace_array can be derived from. Also added a "__init" to the boot up test event plus function tracing function function_test_events_call(). Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace_events.c')
-rw-r--r--kernel/trace/trace_events.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 7ca09cdc20c2..b2e3d8d80df8 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -2891,7 +2891,9 @@ static __init void event_trace_self_tests(void)
static DEFINE_PER_CPU(atomic_t, ftrace_test_event_disable);
-static void
+static struct trace_array *event_tr;
+
+static void __init
function_test_events_call(unsigned long ip, unsigned long parent_ip,
struct ftrace_ops *op, struct pt_regs *pt_regs)
{
@@ -2922,7 +2924,7 @@ function_test_events_call(unsigned long ip, unsigned long parent_ip,
entry->ip = ip;
entry->parent_ip = parent_ip;
- trace_buffer_unlock_commit(buffer, event, flags, pc);
+ trace_buffer_unlock_commit(event_tr, buffer, event, flags, pc);
out:
atomic_dec(&per_cpu(ftrace_test_event_disable, cpu));
@@ -2944,6 +2946,9 @@ static __init void event_trace_self_test_with_function(void)
return;
}
pr_info("Running tests again, along with the function tracer\n");
+ event_tr = top_trace_array();
+ if (WARN_ON(!event_tr))
+ return;
event_trace_self_tests();
unregister_ftrace_function(&trace_ops);
}