diff options
| author | Frederic Weisbecker <fweisbec@gmail.com> | 2008-12-07 19:56:06 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-12-08 07:24:52 -0500 |
| commit | decbec3838d10ecd7aabdb4c0e05aac0e5f5dc0c (patch) | |
| tree | e4427f55892b9ab4cd80c0f18d22dbb21e78699f | |
| parent | 21bbecdaaef3a6acc19905ab88c0587817318870 (diff) | |
tracing/function-graph-tracer: implement a print_headers function
Impact: provide trace headers to explain a bit the output
This patch implements the print_headers callback for the function graph
tracer. These headers are output according to the current trace options.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
| -rw-r--r-- | kernel/trace/trace_functions_graph.c | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c index 32b7fb9a19df..af60eef4cbcc 100644 --- a/kernel/trace/trace_functions_graph.c +++ b/kernel/trace/trace_functions_graph.c | |||
| @@ -570,11 +570,36 @@ print_graph_function(struct trace_iterator *iter) | |||
| 570 | } | 570 | } |
| 571 | } | 571 | } |
| 572 | 572 | ||
| 573 | static void print_graph_headers(struct seq_file *s) | ||
| 574 | { | ||
| 575 | /* 1st line */ | ||
| 576 | seq_printf(s, "# "); | ||
| 577 | if (tracer_flags.val & TRACE_GRAPH_PRINT_CPU) | ||
| 578 | seq_printf(s, "CPU "); | ||
| 579 | if (tracer_flags.val & TRACE_GRAPH_PRINT_PROC) | ||
| 580 | seq_printf(s, "TASK/PID "); | ||
| 581 | if (tracer_flags.val & TRACE_GRAPH_PRINT_OVERHEAD) | ||
| 582 | seq_printf(s, "OVERHEAD/"); | ||
| 583 | seq_printf(s, "DURATION FUNCTION CALLS\n"); | ||
| 584 | |||
| 585 | /* 2nd line */ | ||
| 586 | seq_printf(s, "# "); | ||
| 587 | if (tracer_flags.val & TRACE_GRAPH_PRINT_CPU) | ||
| 588 | seq_printf(s, "| "); | ||
| 589 | if (tracer_flags.val & TRACE_GRAPH_PRINT_PROC) | ||
| 590 | seq_printf(s, "| | "); | ||
| 591 | if (tracer_flags.val & TRACE_GRAPH_PRINT_OVERHEAD) { | ||
| 592 | seq_printf(s, "| "); | ||
| 593 | seq_printf(s, "| | | | |\n"); | ||
| 594 | } else | ||
| 595 | seq_printf(s, " | | | | |\n"); | ||
| 596 | } | ||
| 573 | static struct tracer graph_trace __read_mostly = { | 597 | static struct tracer graph_trace __read_mostly = { |
| 574 | .name = "function_graph", | 598 | .name = "function_graph", |
| 575 | .init = graph_trace_init, | 599 | .init = graph_trace_init, |
| 576 | .reset = graph_trace_reset, | 600 | .reset = graph_trace_reset, |
| 577 | .print_line = print_graph_function, | 601 | .print_line = print_graph_function, |
| 602 | .print_header = print_graph_headers, | ||
| 578 | .flags = &tracer_flags, | 603 | .flags = &tracer_flags, |
| 579 | }; | 604 | }; |
| 580 | 605 | ||
