diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2009-06-03 09:52:03 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2009-06-03 10:29:48 -0400 |
commit | 56d8bd3f0b98972312cad683947ec90b21011199 (patch) | |
tree | 8ed2bb43d0f00923dd81b5b2c19c91b09e3977c6 | |
parent | 048dc50c5e7eada19ebabbad70b7966d14283d41 (diff) |
tracing: fix multiple use of __print_flags and __print_symbolic
Here is an updated patch to include the extra call to
trace_seq_init() as requested. This is vs. the latest
-tip tree and fixes the use of multiple __print_flags
and __print_symbolic in a single tracer. Also tested
to ensure its working now:
mount.gfs2-2534 [000] 235.850587: gfs2_glock_queue: 8.7 glock 1:2 dequeue PR
mount.gfs2-2534 [000] 235.850591: gfs2_demote_rq: 8.7 glock 1:0 demote EX to NL flags:DI
mount.gfs2-2534 [000] 235.850591: gfs2_glock_queue: 8.7 glock 1:0 dequeue EX
glock_workqueue-2529 [000] 235.850666: gfs2_glock_state_change: 8.7 glock 1:0 state EX => NL tgt:NL dmt:NL flags:lDpI
glock_workqueue-2529 [000] 235.850672: gfs2_glock_put: 8.7 glock 1:0 state NL => IV flags:I
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
LKML-Reference: <1244037123.29604.603.camel@localhost.localdomain>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | include/trace/ftrace.h | 2 | ||||
-rw-r--r-- | kernel/trace/trace_output.c | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index b5478dab579b..40ede4db4d88 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -104,6 +104,7 @@ | |||
104 | * field = (typeof(field))entry; | 104 | * field = (typeof(field))entry; |
105 | * | 105 | * |
106 | * p = get_cpu_var(ftrace_event_seq); | 106 | * p = get_cpu_var(ftrace_event_seq); |
107 | * trace_seq_init(p); | ||
107 | * ret = trace_seq_printf(s, <TP_printk> "\n"); | 108 | * ret = trace_seq_printf(s, <TP_printk> "\n"); |
108 | * put_cpu(); | 109 | * put_cpu(); |
109 | * if (!ret) | 110 | * if (!ret) |
@@ -167,6 +168,7 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | |||
167 | field = (typeof(field))entry; \ | 168 | field = (typeof(field))entry; \ |
168 | \ | 169 | \ |
169 | p = &get_cpu_var(ftrace_event_seq); \ | 170 | p = &get_cpu_var(ftrace_event_seq); \ |
171 | trace_seq_init(p); \ | ||
170 | ret = trace_seq_printf(s, #call ": " print); \ | 172 | ret = trace_seq_printf(s, #call ": " print); \ |
171 | put_cpu(); \ | 173 | put_cpu(); \ |
172 | if (!ret) \ | 174 | if (!ret) \ |
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index 8dadbbbd2d5c..8afeea412e77 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c | |||
@@ -223,10 +223,9 @@ ftrace_print_flags_seq(struct trace_seq *p, const char *delim, | |||
223 | { | 223 | { |
224 | unsigned long mask; | 224 | unsigned long mask; |
225 | const char *str; | 225 | const char *str; |
226 | const char *ret = p->buffer + p->len; | ||
226 | int i; | 227 | int i; |
227 | 228 | ||
228 | trace_seq_init(p); | ||
229 | |||
230 | for (i = 0; flag_array[i].name && flags; i++) { | 229 | for (i = 0; flag_array[i].name && flags; i++) { |
231 | 230 | ||
232 | mask = flag_array[i].mask; | 231 | mask = flag_array[i].mask; |
@@ -249,7 +248,7 @@ ftrace_print_flags_seq(struct trace_seq *p, const char *delim, | |||
249 | 248 | ||
250 | trace_seq_putc(p, 0); | 249 | trace_seq_putc(p, 0); |
251 | 250 | ||
252 | return p->buffer; | 251 | return ret; |
253 | } | 252 | } |
254 | EXPORT_SYMBOL(ftrace_print_flags_seq); | 253 | EXPORT_SYMBOL(ftrace_print_flags_seq); |
255 | 254 | ||
@@ -258,8 +257,7 @@ ftrace_print_symbols_seq(struct trace_seq *p, unsigned long val, | |||
258 | const struct trace_print_flags *symbol_array) | 257 | const struct trace_print_flags *symbol_array) |
259 | { | 258 | { |
260 | int i; | 259 | int i; |
261 | 260 | const char *ret = p->buffer + p->len; | |
262 | trace_seq_init(p); | ||
263 | 261 | ||
264 | for (i = 0; symbol_array[i].name; i++) { | 262 | for (i = 0; symbol_array[i].name; i++) { |
265 | 263 | ||
@@ -275,7 +273,7 @@ ftrace_print_symbols_seq(struct trace_seq *p, unsigned long val, | |||
275 | 273 | ||
276 | trace_seq_putc(p, 0); | 274 | trace_seq_putc(p, 0); |
277 | 275 | ||
278 | return p->buffer; | 276 | return ret; |
279 | } | 277 | } |
280 | EXPORT_SYMBOL(ftrace_print_symbols_seq); | 278 | EXPORT_SYMBOL(ftrace_print_symbols_seq); |
281 | 279 | ||