mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [for-next][PATCH 7/8] tracing: Remove one use of trace_current_buffer_lock_reserve()
Date: Sat, 30 Apr 2016 08:13:49 -0400	[thread overview]
Message-ID: <20160430121411.372003411@goodmis.org> (raw)
In-Reply-To: <20160430121342.397837568@goodmis.org>

[-- Attachment #1: 0007-tracing-Remove-one-use-of-trace_current_buffer_lock_.patch --]
[-- Type: text/plain, Size: 2101 bytes --]

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

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: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/trace_events.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index e7cb983ee93c..da1eeb6190e3 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -3392,7 +3392,7 @@ static __init void event_trace_self_tests(void)
 
 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
 function_test_events_call(unsigned long ip, unsigned long parent_ip,
@@ -3416,17 +3416,17 @@ function_test_events_call(unsigned long ip, unsigned long parent_ip,
 
 	local_save_flags(flags);
 
-	event = trace_current_buffer_lock_reserve(&buffer,
-						  TRACE_FN, sizeof(*entry),
-						  flags, pc);
+	event = trace_event_buffer_lock_reserve(&buffer, &event_trace_file,
+						TRACE_FN, sizeof(*entry),
+						flags, pc);
 	if (!event)
 		goto out;
 	entry	= ring_buffer_event_data(event);
 	entry->ip			= 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:
 	atomic_dec(&per_cpu(ftrace_test_event_disable, cpu));
 	preempt_enable_notrace();
@@ -3441,9 +3441,11 @@ static struct ftrace_ops trace_ops __initdata  =
 static __init void event_trace_self_test_with_function(void)
 {
 	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;
+
 	ret = register_ftrace_function(&trace_ops);
 	if (WARN_ON(ret < 0)) {
 		pr_info("Failed to enable function tracer for event tests\n");
-- 
2.8.0.rc3

  parent reply	other threads:[~2016-04-30 12:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-30 12:13 [for-next][PATCH 0/8] tracing: Various cleanups Steven Rostedt
2016-04-30 12:13 ` [for-next][PATCH 1/8] tracing: Move event_trigger_unlock_commit{_regs}() to local header Steven Rostedt
2016-04-30 12:13 ` [for-next][PATCH 2/8] tracing: Make filter_check_discard() local Steven Rostedt
2016-04-30 12:13 ` [for-next][PATCH 3/8] tracing: Fold filter_check_discard() into its only user Steven Rostedt
2016-04-30 12:13 ` [for-next][PATCH 4/8] tracing: Move trace_buffer_unlock_commit{_regs}() to local header Steven Rostedt
2016-04-30 12:13 ` [for-next][PATCH 5/8] tracing: Remove unused function trace_current_buffer_discard_commit() Steven Rostedt
2016-04-30 12:13 ` [for-next][PATCH 6/8] tracing: Have trace_buffer_unlock_commit() call the _regs version with NULL Steven Rostedt
2016-04-30 12:13 ` Steven Rostedt [this message]
2016-04-30 12:13 ` [for-next][PATCH 8/8] tracing: Remove unused function trace_current_buffer_lock_reserve() Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160430121411.372003411@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome