public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Mathieu Desnoyers <compudj@krystal.dyndns.org>,
	Tom Zanussi <tzanussi@gmail.com>,
	Masami Hiramatsu <mhiramat@redhat.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Jason Baron <jbaron@redhat.com>,
	"Frank Ch. Eigler" <fche@redhat.com>,
	acme@ghostprotocols.net, Steven Rostedt <srostedt@redhat.com>
Subject: [PATCH 06/10] tracing: add interface to write into current tracer buffer
Date: Sat, 28 Feb 2009 04:06:52 -0500	[thread overview]
Message-ID: <20090228090938.051649847@goodmis.org> (raw)
In-Reply-To: 20090228090646.265765024@goodmis.org

[-- Attachment #1: 0006-tracing-add-interface-to-write-into-current-tracer.patch --]
[-- Type: text/plain, Size: 2139 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

Right now all tracers must manage their own trace buffers. This was
to enforce tracers to be independent in case we finally decide to
allow each tracer to have their own trace buffer.

But now we are adding event tracing that writes to the current tracer's
buffer. This adds an interface to allow events to write to the current
tracer buffer without having to manage its own. Since event tracing
has no "tracer", and is just a way to hook into any other tracer.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
---
 kernel/trace/trace.c |   14 ++++++++++++++
 kernel/trace/trace.h |    6 ++++++
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 9c5987a..c5e39cd 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -846,6 +846,20 @@ void trace_buffer_unlock_commit(struct trace_array *tr,
 	trace_wake_up();
 }
 
+struct ring_buffer_event *
+trace_current_buffer_lock_reserve(unsigned char type, unsigned long len,
+				  unsigned long flags, int pc)
+{
+	return trace_buffer_lock_reserve(&global_trace,
+					 type, len, flags, pc);
+}
+
+void trace_current_buffer_unlock_commit(struct ring_buffer_event *event,
+					unsigned long flags, int pc)
+{
+	return trace_buffer_unlock_commit(&global_trace, event, flags, pc);
+}
+
 void
 trace_function(struct trace_array *tr,
 	       unsigned long ip, unsigned long parent_ip, unsigned long flags,
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 6321917..adf161f 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -442,6 +442,12 @@ void trace_buffer_unlock_commit(struct trace_array *tr,
 				struct ring_buffer_event *event,
 				unsigned long flags, int pc);
 
+struct ring_buffer_event *
+trace_current_buffer_lock_reserve(unsigned char type, unsigned long len,
+				  unsigned long flags, int pc);
+void trace_current_buffer_unlock_commit(struct ring_buffer_event *event,
+					unsigned long flags, int pc);
+
 struct trace_entry *tracing_get_trace_entry(struct trace_array *tr,
 						struct trace_array_cpu *data);
 
-- 
1.5.6.5

-- 

  parent reply	other threads:[~2009-02-28  9:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-28  9:06 [PATCH 00/10] [git pull] for tip/tracing/ftrace Steven Rostedt
2009-02-28  9:06 ` [PATCH 01/10] tracing: move trace point formats to files in include/trace directory Steven Rostedt
2009-02-28  9:06 ` [PATCH 02/10] tracing: add subsystem level to trace events Steven Rostedt
2009-02-28  9:06 ` [PATCH 03/10] tracing: make the set_event and available_events subsystem aware Steven Rostedt
2009-02-28  9:06 ` [PATCH 04/10] tracing: add subsystem irq for irq events Steven Rostedt
2009-02-28  9:06 ` [PATCH 05/10] tracing: add subsystem sched for sched events Steven Rostedt
2009-02-28  9:06 ` Steven Rostedt [this message]
2009-02-28  9:06 ` [PATCH 07/10] tracing: add raw trace point recording infrastructure Steven Rostedt
2009-03-02  7:51   ` Tom Zanussi
2009-03-02 12:22     ` Frédéric Weisbecker
2009-03-02 13:23     ` Steven Rostedt
2009-02-28  9:06 ` [PATCH 08/10] tracing: add raw fast tracing interface for trace events Steven Rostedt
2009-02-28  9:06 ` [PATCH 09/10] tracing: create the C style tracing for the sched subsystem Steven Rostedt
2009-02-28  9:06 ` [PATCH 10/10] tracing: create the C style tracing for the irq subsystem Steven Rostedt
2009-02-28  9:17 ` [PATCH 00/10] [git pull] for tip/tracing/ftrace Ingo Molnar

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=20090228090938.051649847@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=acme@ghostprotocols.net \
    --cc=akpm@linux-foundation.org \
    --cc=compudj@krystal.dyndns.org \
    --cc=fche@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=jbaron@redhat.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@redhat.com \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=srostedt@redhat.com \
    --cc=tzanussi@gmail.com \
    /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