diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-02-05 13:14:13 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-05 19:01:41 -0500 |
commit | 51a763dd84253bab1d0a1e68e11a7753d1b702ca (patch) | |
tree | 2cc2cf0509db480391c585786285267e360c1338 /kernel/trace/trace.h | |
parent | 0a9877514c4fed10a70720293b37213dd172ee3e (diff) |
tracing: Introduce trace_buffer_{lock_reserve,unlock_commit}
Impact: new API
These new functions do what previously was being open coded, reducing
the number of details ftrace plugin writers have to worry about.
It also standardizes the handling of stacktrace, userstacktrace and
other trace options we may introduce in the future.
With this patch, for instance, the blk tracer (and some others already
in the tree) can use the "userstacktrace" /d/tracing/trace_options
facility.
$ codiff /tmp/vmlinux.before /tmp/vmlinux.after
linux-2.6-tip/kernel/trace/trace.c:
trace_vprintk | -5
trace_graph_return | -22
trace_graph_entry | -26
trace_function | -45
__ftrace_trace_stack | -27
ftrace_trace_userstack | -29
tracing_sched_switch_trace | -66
tracing_stop | +1
trace_seq_to_user | -1
ftrace_trace_special | -63
ftrace_special | +1
tracing_sched_wakeup_trace | -70
tracing_reset_online_cpus | -1
13 functions changed, 2 bytes added, 355 bytes removed, diff: -353
linux-2.6-tip/block/blktrace.c:
__blk_add_trace | -58
1 function changed, 58 bytes removed, diff: -58
linux-2.6-tip/kernel/trace/trace.c:
trace_buffer_lock_reserve | +88
trace_buffer_unlock_commit | +86
2 functions changed, 174 bytes added, diff: +174
/tmp/vmlinux.after:
16 functions changed, 176 bytes added, 413 bytes removed, diff: -237
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Frédéric Weisbecker <fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r-- | kernel/trace/trace.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index df627a948694..e03f157c772e 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -403,6 +403,17 @@ int tracing_open_generic(struct inode *inode, struct file *filp); | |||
403 | struct dentry *tracing_init_dentry(void); | 403 | struct dentry *tracing_init_dentry(void); |
404 | void init_tracer_sysprof_debugfs(struct dentry *d_tracer); | 404 | void init_tracer_sysprof_debugfs(struct dentry *d_tracer); |
405 | 405 | ||
406 | struct ring_buffer_event; | ||
407 | |||
408 | struct ring_buffer_event *trace_buffer_lock_reserve(struct trace_array *tr, | ||
409 | unsigned char type, | ||
410 | unsigned long len, | ||
411 | unsigned long flags, | ||
412 | int pc); | ||
413 | void trace_buffer_unlock_commit(struct trace_array *tr, | ||
414 | struct ring_buffer_event *event, | ||
415 | unsigned long flags, int pc); | ||
416 | |||
406 | struct trace_entry *tracing_get_trace_entry(struct trace_array *tr, | 417 | struct trace_entry *tracing_get_trace_entry(struct trace_array *tr, |
407 | struct trace_array_cpu *data); | 418 | struct trace_array_cpu *data); |
408 | 419 | ||