diff options
author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2009-03-06 11:21:47 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-06 11:59:11 -0500 |
commit | 1427cdf0592368bdec57276edaf714040ee8744f (patch) | |
tree | 4b214ee49643db383328cf53a31959eb0627a167 /kernel/trace/trace.h | |
parent | 546e5354a6e4ec760ac03ef1148e9a4762abb5f5 (diff) |
tracing: infrastructure for supporting binary record
Impact: save on memory for tracing
Current tracers are typically using a struct(like struct ftrace_entry,
struct ctx_switch_entry, struct special_entr etc...)to record a binary
event. These structs can only record a their own kind of events.
A new kind of tracer need a new struct and a lot of code too handle it.
So we need a generic binary record for events. This infrastructure
is for this purpose.
[fweisbec@gmail.com: rebase against latest -tip, make it safe while sched
tracing as reported by Steven Rostedt]
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <1236356510-8381-3-git-send-email-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 | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 8beff03fda68..0f5077f8f957 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -20,6 +20,7 @@ enum trace_type { | |||
20 | TRACE_WAKE, | 20 | TRACE_WAKE, |
21 | TRACE_STACK, | 21 | TRACE_STACK, |
22 | TRACE_PRINT, | 22 | TRACE_PRINT, |
23 | TRACE_BPRINTK, | ||
23 | TRACE_SPECIAL, | 24 | TRACE_SPECIAL, |
24 | TRACE_MMIO_RW, | 25 | TRACE_MMIO_RW, |
25 | TRACE_MMIO_MAP, | 26 | TRACE_MMIO_MAP, |
@@ -124,6 +125,16 @@ struct print_entry { | |||
124 | char buf[]; | 125 | char buf[]; |
125 | }; | 126 | }; |
126 | 127 | ||
128 | struct bprintk_entry { | ||
129 | struct trace_entry ent; | ||
130 | unsigned long ip; | ||
131 | const char *fmt; | ||
132 | u32 buf[]; | ||
133 | }; | ||
134 | #ifdef CONFIG_TRACE_BPRINTK | ||
135 | extern int trace_bprintk_enable; | ||
136 | #endif | ||
137 | |||
127 | #define TRACE_OLD_SIZE 88 | 138 | #define TRACE_OLD_SIZE 88 |
128 | 139 | ||
129 | struct trace_field_cont { | 140 | struct trace_field_cont { |
@@ -285,6 +296,7 @@ extern void __ftrace_bad_type(void); | |||
285 | IF_ASSIGN(var, ent, struct stack_entry, TRACE_STACK); \ | 296 | IF_ASSIGN(var, ent, struct stack_entry, TRACE_STACK); \ |
286 | IF_ASSIGN(var, ent, struct userstack_entry, TRACE_USER_STACK);\ | 297 | IF_ASSIGN(var, ent, struct userstack_entry, TRACE_USER_STACK);\ |
287 | IF_ASSIGN(var, ent, struct print_entry, TRACE_PRINT); \ | 298 | IF_ASSIGN(var, ent, struct print_entry, TRACE_PRINT); \ |
299 | IF_ASSIGN(var, ent, struct bprintk_entry, TRACE_BPRINTK);\ | ||
288 | IF_ASSIGN(var, ent, struct special_entry, 0); \ | 300 | IF_ASSIGN(var, ent, struct special_entry, 0); \ |
289 | IF_ASSIGN(var, ent, struct trace_mmiotrace_rw, \ | 301 | IF_ASSIGN(var, ent, struct trace_mmiotrace_rw, \ |
290 | TRACE_MMIO_RW); \ | 302 | TRACE_MMIO_RW); \ |