diff options
author | Markus Metzger <markus.t.metzger@intel.com> | 2008-11-25 03:12:31 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-25 11:31:13 -0500 |
commit | 8bba1bf5e2434c83f2fe8b1422604ace9bbe4cb8 (patch) | |
tree | 3df07de04de7e3a838dbf544e6a98eadac37b027 /kernel/trace/trace.c | |
parent | 6abb11aecd888d1da6276399380b7355f127c006 (diff) |
x86, ftrace: call trace->open() before stopping tracing; add trace->print_header()
Add a callback to allow an ftrace plug-in to write its own header.
Move the call to trace->open() up a few lines.
The changes are required by the BTS ftrace plug-in.
Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index a45b59e53fbc..8df8fdd69c95 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -2298,7 +2298,9 @@ static int s_show(struct seq_file *m, void *v) | |||
2298 | seq_printf(m, "# tracer: %s\n", iter->trace->name); | 2298 | seq_printf(m, "# tracer: %s\n", iter->trace->name); |
2299 | seq_puts(m, "#\n"); | 2299 | seq_puts(m, "#\n"); |
2300 | } | 2300 | } |
2301 | if (iter->iter_flags & TRACE_FILE_LAT_FMT) { | 2301 | if (iter->trace && iter->trace->print_header) |
2302 | iter->trace->print_header(m); | ||
2303 | else if (iter->iter_flags & TRACE_FILE_LAT_FMT) { | ||
2302 | /* print nothing if the buffers are empty */ | 2304 | /* print nothing if the buffers are empty */ |
2303 | if (trace_empty(iter)) | 2305 | if (trace_empty(iter)) |
2304 | return 0; | 2306 | return 0; |
@@ -2350,6 +2352,10 @@ __tracing_open(struct inode *inode, struct file *file, int *ret) | |||
2350 | iter->trace = current_trace; | 2352 | iter->trace = current_trace; |
2351 | iter->pos = -1; | 2353 | iter->pos = -1; |
2352 | 2354 | ||
2355 | /* Notify the tracer early; before we stop tracing. */ | ||
2356 | if (iter->trace && iter->trace->open) | ||
2357 | iter->trace->open(iter); | ||
2358 | |||
2353 | /* Annotate start of buffers if we had overruns */ | 2359 | /* Annotate start of buffers if we had overruns */ |
2354 | if (ring_buffer_overruns(iter->tr->buffer)) | 2360 | if (ring_buffer_overruns(iter->tr->buffer)) |
2355 | iter->iter_flags |= TRACE_FILE_ANNOTATE; | 2361 | iter->iter_flags |= TRACE_FILE_ANNOTATE; |
@@ -2375,9 +2381,6 @@ __tracing_open(struct inode *inode, struct file *file, int *ret) | |||
2375 | /* stop the trace while dumping */ | 2381 | /* stop the trace while dumping */ |
2376 | tracing_stop(); | 2382 | tracing_stop(); |
2377 | 2383 | ||
2378 | if (iter->trace && iter->trace->open) | ||
2379 | iter->trace->open(iter); | ||
2380 | |||
2381 | mutex_unlock(&trace_types_lock); | 2384 | mutex_unlock(&trace_types_lock); |
2382 | 2385 | ||
2383 | out: | 2386 | out: |