diff options
author | Jiri Olsa <jolsa@redhat.com> | 2011-06-03 10:58:51 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2011-06-14 22:48:49 -0400 |
commit | 749230b06a753a22f6ed96e5dd60815d6ab12865 (patch) | |
tree | 32aa2fb64a4fe4c7a9effee21f379486703ecd28 /kernel/trace/trace_functions_graph.c | |
parent | 199abfab40389963b397c2982222e68ea782b2cf (diff) |
tracing, function_graph: Add context-info support for function_graph tracer
The function_graph tracer does not follow global context-info option.
Adding TRACE_ITER_CONTEXT_INFO trace_flags check to enable it.
With following commands:
# echo function_graph > ./current_tracer
# echo 0 > options/context-info
# cat trace
This is what it looked like before:
# tracer: function_graph
#
# TIME CPU DURATION FUNCTION CALLS
# | | | | | | | |
1) 0.079 us | } /* __vma_link_rb */
1) 0.056 us | copy_page_range();
1) | security_vm_enough_memory() {
...
This is what it looks like now:
# tracer: function_graph
#
} /* update_ts_time_stats */
timekeeping_max_deferment();
...
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1307113131-10045-6-git-send-email-jolsa@redhat.com
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace_functions_graph.c')
-rw-r--r-- | kernel/trace/trace_functions_graph.c | 53 |
1 files changed, 31 insertions, 22 deletions
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c index 1da5b97d2288..e8d6bb55d719 100644 --- a/kernel/trace/trace_functions_graph.c +++ b/kernel/trace/trace_functions_graph.c | |||
@@ -613,28 +613,30 @@ print_graph_irq(struct trace_iterator *iter, unsigned long addr, | |||
613 | addr >= (unsigned long)__irqentry_text_end) | 613 | addr >= (unsigned long)__irqentry_text_end) |
614 | return TRACE_TYPE_UNHANDLED; | 614 | return TRACE_TYPE_UNHANDLED; |
615 | 615 | ||
616 | /* Absolute time */ | 616 | if (trace_flags & TRACE_ITER_CONTEXT_INFO) { |
617 | if (flags & TRACE_GRAPH_PRINT_ABS_TIME) { | 617 | /* Absolute time */ |
618 | ret = print_graph_abs_time(iter->ts, s); | 618 | if (flags & TRACE_GRAPH_PRINT_ABS_TIME) { |
619 | if (!ret) | 619 | ret = print_graph_abs_time(iter->ts, s); |
620 | return TRACE_TYPE_PARTIAL_LINE; | 620 | if (!ret) |
621 | } | 621 | return TRACE_TYPE_PARTIAL_LINE; |
622 | } | ||
622 | 623 | ||
623 | /* Cpu */ | 624 | /* Cpu */ |
624 | if (flags & TRACE_GRAPH_PRINT_CPU) { | 625 | if (flags & TRACE_GRAPH_PRINT_CPU) { |
625 | ret = print_graph_cpu(s, cpu); | 626 | ret = print_graph_cpu(s, cpu); |
626 | if (ret == TRACE_TYPE_PARTIAL_LINE) | 627 | if (ret == TRACE_TYPE_PARTIAL_LINE) |
627 | return TRACE_TYPE_PARTIAL_LINE; | 628 | return TRACE_TYPE_PARTIAL_LINE; |
628 | } | 629 | } |
629 | 630 | ||
630 | /* Proc */ | 631 | /* Proc */ |
631 | if (flags & TRACE_GRAPH_PRINT_PROC) { | 632 | if (flags & TRACE_GRAPH_PRINT_PROC) { |
632 | ret = print_graph_proc(s, pid); | 633 | ret = print_graph_proc(s, pid); |
633 | if (ret == TRACE_TYPE_PARTIAL_LINE) | 634 | if (ret == TRACE_TYPE_PARTIAL_LINE) |
634 | return TRACE_TYPE_PARTIAL_LINE; | 635 | return TRACE_TYPE_PARTIAL_LINE; |
635 | ret = trace_seq_printf(s, " | "); | 636 | ret = trace_seq_printf(s, " | "); |
636 | if (!ret) | 637 | if (!ret) |
637 | return TRACE_TYPE_PARTIAL_LINE; | 638 | return TRACE_TYPE_PARTIAL_LINE; |
639 | } | ||
638 | } | 640 | } |
639 | 641 | ||
640 | /* No overhead */ | 642 | /* No overhead */ |
@@ -710,8 +712,9 @@ print_graph_duration(unsigned long long duration, struct trace_seq *s, | |||
710 | { | 712 | { |
711 | int ret = -1; | 713 | int ret = -1; |
712 | 714 | ||
713 | if (!(flags & TRACE_GRAPH_PRINT_DURATION)) | 715 | if (!(flags & TRACE_GRAPH_PRINT_DURATION) || |
714 | return TRACE_TYPE_HANDLED; | 716 | !(trace_flags & TRACE_ITER_CONTEXT_INFO)) |
717 | return TRACE_TYPE_HANDLED; | ||
715 | 718 | ||
716 | /* No real adata, just filling the column with spaces */ | 719 | /* No real adata, just filling the column with spaces */ |
717 | switch (duration) { | 720 | switch (duration) { |
@@ -879,6 +882,9 @@ print_graph_prologue(struct trace_iterator *iter, struct trace_seq *s, | |||
879 | return TRACE_TYPE_PARTIAL_LINE; | 882 | return TRACE_TYPE_PARTIAL_LINE; |
880 | } | 883 | } |
881 | 884 | ||
885 | if (!(trace_flags & TRACE_ITER_CONTEXT_INFO)) | ||
886 | return 0; | ||
887 | |||
882 | /* Absolute time */ | 888 | /* Absolute time */ |
883 | if (flags & TRACE_GRAPH_PRINT_ABS_TIME) { | 889 | if (flags & TRACE_GRAPH_PRINT_ABS_TIME) { |
884 | ret = print_graph_abs_time(iter->ts, s); | 890 | ret = print_graph_abs_time(iter->ts, s); |
@@ -1346,6 +1352,9 @@ void print_graph_headers_flags(struct seq_file *s, u32 flags) | |||
1346 | { | 1352 | { |
1347 | struct trace_iterator *iter = s->private; | 1353 | struct trace_iterator *iter = s->private; |
1348 | 1354 | ||
1355 | if (!(trace_flags & TRACE_ITER_CONTEXT_INFO)) | ||
1356 | return; | ||
1357 | |||
1349 | if (trace_flags & TRACE_ITER_LATENCY_FMT) { | 1358 | if (trace_flags & TRACE_ITER_LATENCY_FMT) { |
1350 | /* print nothing if the buffers are empty */ | 1359 | /* print nothing if the buffers are empty */ |
1351 | if (trace_empty(iter)) | 1360 | if (trace_empty(iter)) |