aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-02-27 19:38:04 -0500
committerSteven Rostedt <srostedt@redhat.com>2009-02-28 03:06:44 -0500
commitef5580d0fffce6e0a01043bac0625128b5d409a7 (patch)
treebc6ca68064d6b5c9853227ef876b391cc8b0c939
parent3d7ba938da8481b4f7f9ed3d943dbae49389b284 (diff)
tracing: add interface to write into current tracer buffer
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>
-rw-r--r--kernel/trace/trace.c14
-rw-r--r--kernel/trace/trace.h6
2 files changed, 20 insertions, 0 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 9c5987aca74b..c5e39cd7310d 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -846,6 +846,20 @@ void trace_buffer_unlock_commit(struct trace_array *tr,
846 trace_wake_up(); 846 trace_wake_up();
847} 847}
848 848
849struct ring_buffer_event *
850trace_current_buffer_lock_reserve(unsigned char type, unsigned long len,
851 unsigned long flags, int pc)
852{
853 return trace_buffer_lock_reserve(&global_trace,
854 type, len, flags, pc);
855}
856
857void trace_current_buffer_unlock_commit(struct ring_buffer_event *event,
858 unsigned long flags, int pc)
859{
860 return trace_buffer_unlock_commit(&global_trace, event, flags, pc);
861}
862
849void 863void
850trace_function(struct trace_array *tr, 864trace_function(struct trace_array *tr,
851 unsigned long ip, unsigned long parent_ip, unsigned long flags, 865 unsigned long ip, unsigned long parent_ip, unsigned long flags,
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 632191770aac..adf161f6dd11 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -442,6 +442,12 @@ void trace_buffer_unlock_commit(struct trace_array *tr,
442 struct ring_buffer_event *event, 442 struct ring_buffer_event *event,
443 unsigned long flags, int pc); 443 unsigned long flags, int pc);
444 444
445struct ring_buffer_event *
446trace_current_buffer_lock_reserve(unsigned char type, unsigned long len,
447 unsigned long flags, int pc);
448void trace_current_buffer_unlock_commit(struct ring_buffer_event *event,
449 unsigned long flags, int pc);
450
445struct trace_entry *tracing_get_trace_entry(struct trace_array *tr, 451struct trace_entry *tracing_get_trace_entry(struct trace_array *tr,
446 struct trace_array_cpu *data); 452 struct trace_array_cpu *data);
447 453