Commit 9b9db275 authored by Steven Rostedt (Red Hat)'s avatar Steven Rostedt (Red Hat) Committed by Steven Rostedt

tracing: Remove one use of trace_current_buffer_lock_reserve()

The only user of trace_current_buffer_lock_reserve() is in the boot up self
tests. Restructure the code a little to have that code use what everything
else uses: trace_event_buffer_lock_reserve().
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 33fddff2
...@@ -3392,7 +3392,7 @@ static __init void event_trace_self_tests(void) ...@@ -3392,7 +3392,7 @@ static __init void event_trace_self_tests(void)
static DEFINE_PER_CPU(atomic_t, ftrace_test_event_disable); static DEFINE_PER_CPU(atomic_t, ftrace_test_event_disable);
static struct trace_array *event_tr; static struct trace_event_file event_trace_file __initdata;
static void __init static void __init
function_test_events_call(unsigned long ip, unsigned long parent_ip, function_test_events_call(unsigned long ip, unsigned long parent_ip,
...@@ -3416,7 +3416,7 @@ function_test_events_call(unsigned long ip, unsigned long parent_ip, ...@@ -3416,7 +3416,7 @@ function_test_events_call(unsigned long ip, unsigned long parent_ip,
local_save_flags(flags); local_save_flags(flags);
event = trace_current_buffer_lock_reserve(&buffer, event = trace_event_buffer_lock_reserve(&buffer, &event_trace_file,
TRACE_FN, sizeof(*entry), TRACE_FN, sizeof(*entry),
flags, pc); flags, pc);
if (!event) if (!event)
...@@ -3425,8 +3425,8 @@ function_test_events_call(unsigned long ip, unsigned long parent_ip, ...@@ -3425,8 +3425,8 @@ function_test_events_call(unsigned long ip, unsigned long parent_ip,
entry->ip = ip; entry->ip = ip;
entry->parent_ip = parent_ip; entry->parent_ip = parent_ip;
trace_buffer_unlock_commit(event_tr, buffer, event, flags, pc); event_trigger_unlock_commit(&event_trace_file, buffer, event,
entry, flags, pc);
out: out:
atomic_dec(&per_cpu(ftrace_test_event_disable, cpu)); atomic_dec(&per_cpu(ftrace_test_event_disable, cpu));
preempt_enable_notrace(); preempt_enable_notrace();
...@@ -3441,9 +3441,11 @@ static struct ftrace_ops trace_ops __initdata = ...@@ -3441,9 +3441,11 @@ static struct ftrace_ops trace_ops __initdata =
static __init void event_trace_self_test_with_function(void) static __init void event_trace_self_test_with_function(void)
{ {
int ret; int ret;
event_tr = top_trace_array();
if (WARN_ON(!event_tr)) event_trace_file.tr = top_trace_array();
if (WARN_ON(!event_trace_file.tr))
return; return;
ret = register_ftrace_function(&trace_ops); ret = register_ftrace_function(&trace_ops);
if (WARN_ON(ret < 0)) { if (WARN_ON(ret < 0)) {
pr_info("Failed to enable function tracer for event tests\n"); pr_info("Failed to enable function tracer for event tests\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment