diff options
author | David Ahern <dsahern@gmail.com> | 2013-11-18 15:32:44 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-11-27 12:58:37 -0500 |
commit | d2ff1b1499c8e0ad2fc79376a4215ba37771823f (patch) | |
tree | ac2dcb9536fff5a8232519e5306ad05b3ed8900d | |
parent | 6f8d67fa0c6bdca535ecab137c44b095023cc1b4 (diff) |
perf evsel: Skip ignored symbols while printing callchain
Allows a command to have a symbol_filter controlled by the user to skip
certain functions in a backtrace. One example is to allow the user to
reduce repeating patterns like:
do_select core_sys_select sys_select
to just sys_select when dumping callchains, consuming less real estate
on the screen while still conveying the essential message - the process
is in a select call.
This option is leveraged by the upcoming timehist command.
Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1384806771-2945-2-git-send-email-dsahern@gmail.com
[ Checked if al.sym is NULL before touching al.sym->ignored, as noted by Adrian Hunter ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/util/session.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index f36d24a02445..b0b15e213df5 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c | |||
@@ -1522,6 +1522,9 @@ void perf_evsel__print_ip(struct perf_evsel *evsel, union perf_event *event, | |||
1522 | if (!node) | 1522 | if (!node) |
1523 | break; | 1523 | break; |
1524 | 1524 | ||
1525 | if (node->sym && node->sym->ignore) | ||
1526 | goto next; | ||
1527 | |||
1525 | if (print_ip) | 1528 | if (print_ip) |
1526 | printf("%c%16" PRIx64, s, node->ip); | 1529 | printf("%c%16" PRIx64, s, node->ip); |
1527 | 1530 | ||
@@ -1544,12 +1547,15 @@ void perf_evsel__print_ip(struct perf_evsel *evsel, union perf_event *event, | |||
1544 | if (!print_oneline) | 1547 | if (!print_oneline) |
1545 | printf("\n"); | 1548 | printf("\n"); |
1546 | 1549 | ||
1547 | callchain_cursor_advance(&callchain_cursor); | ||
1548 | |||
1549 | stack_depth--; | 1550 | stack_depth--; |
1551 | next: | ||
1552 | callchain_cursor_advance(&callchain_cursor); | ||
1550 | } | 1553 | } |
1551 | 1554 | ||
1552 | } else { | 1555 | } else { |
1556 | if (al.sym && al.sym->ignore) | ||
1557 | return; | ||
1558 | |||
1553 | if (print_ip) | 1559 | if (print_ip) |
1554 | printf("%16" PRIx64, sample->ip); | 1560 | printf("%16" PRIx64, sample->ip); |
1555 | 1561 | ||