diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2013-02-07 04:02:14 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-02-14 12:59:28 -0500 |
commit | 18c9e5c567e1bc475edc67dca3680ecd2562dc5c (patch) | |
tree | 03452dac1cbe7b5f71ce6044c78f83c7ede4273b /tools | |
parent | c0e79be74907b4654b622601692e1a27fd1dbeb3 (diff) |
perf annotate: Make it to be able to skip unannotatable symbols
Add --skip-missing option for skipping symbols that cannot be used for
annotation. It's the case of kernel symbols that user doesn't have a
vmlinux image file.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1360227734-375-8-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/Documentation/perf-annotate.txt | 3 | ||||
-rw-r--r-- | tools/perf/builtin-annotate.c | 17 |
2 files changed, 18 insertions, 2 deletions
diff --git a/tools/perf/Documentation/perf-annotate.txt b/tools/perf/Documentation/perf-annotate.txt index e5e1d06efc37..5ad07ef417f0 100644 --- a/tools/perf/Documentation/perf-annotate.txt +++ b/tools/perf/Documentation/perf-annotate.txt | |||
@@ -90,6 +90,9 @@ OPTIONS | |||
90 | --objdump=<path>:: | 90 | --objdump=<path>:: |
91 | Path to objdump binary. | 91 | Path to objdump binary. |
92 | 92 | ||
93 | --skip-missing:: | ||
94 | Skip symbols that cannot be annotated. | ||
95 | |||
93 | SEE ALSO | 96 | SEE ALSO |
94 | -------- | 97 | -------- |
95 | linkperf:perf-record[1], linkperf:perf-report[1] | 98 | linkperf:perf-record[1], linkperf:perf-report[1] |
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 68e3a16abd3d..2e6961ea3184 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c | |||
@@ -37,6 +37,7 @@ struct perf_annotate { | |||
37 | bool force, use_tui, use_stdio, use_gtk; | 37 | bool force, use_tui, use_stdio, use_gtk; |
38 | bool full_paths; | 38 | bool full_paths; |
39 | bool print_line; | 39 | bool print_line; |
40 | bool skip_missing; | ||
40 | const char *sym_hist_filter; | 41 | const char *sym_hist_filter; |
41 | const char *cpu_list; | 42 | const char *cpu_list; |
42 | DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS); | 43 | DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS); |
@@ -139,11 +140,21 @@ find_next: | |||
139 | } | 140 | } |
140 | 141 | ||
141 | if (use_browser == 2) { | 142 | if (use_browser == 2) { |
142 | hist_entry__gtk_annotate(he, evidx, NULL); | 143 | int ret; |
143 | return; | 144 | |
145 | ret = hist_entry__gtk_annotate(he, evidx, NULL); | ||
146 | if (!ret || !ann->skip_missing) | ||
147 | return; | ||
148 | |||
149 | /* skip missing symbols */ | ||
150 | nd = rb_next(nd); | ||
144 | } else if (use_browser == 1) { | 151 | } else if (use_browser == 1) { |
145 | key = hist_entry__tui_annotate(he, evidx, NULL); | 152 | key = hist_entry__tui_annotate(he, evidx, NULL); |
146 | switch (key) { | 153 | switch (key) { |
154 | case -1: | ||
155 | if (!ann->skip_missing) | ||
156 | return; | ||
157 | /* fall through */ | ||
147 | case K_RIGHT: | 158 | case K_RIGHT: |
148 | next = rb_next(nd); | 159 | next = rb_next(nd); |
149 | break; | 160 | break; |
@@ -288,6 +299,8 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused) | |||
288 | "print matching source lines (may be slow)"), | 299 | "print matching source lines (may be slow)"), |
289 | OPT_BOOLEAN('P', "full-paths", &annotate.full_paths, | 300 | OPT_BOOLEAN('P', "full-paths", &annotate.full_paths, |
290 | "Don't shorten the displayed pathnames"), | 301 | "Don't shorten the displayed pathnames"), |
302 | OPT_BOOLEAN(0, "skip-missing", &annotate.skip_missing, | ||
303 | "Skip symbols that cannot be annotated"), | ||
291 | OPT_STRING('C', "cpu", &annotate.cpu_list, "cpu", "list of cpus to profile"), | 304 | OPT_STRING('C', "cpu", &annotate.cpu_list, "cpu", "list of cpus to profile"), |
292 | OPT_STRING(0, "symfs", &symbol_conf.symfs, "directory", | 305 | OPT_STRING(0, "symfs", &symbol_conf.symfs, "directory", |
293 | "Look for files with symbols relative to this directory"), | 306 | "Look for files with symbols relative to this directory"), |