diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2013-03-25 05:18:18 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-03-26 15:38:21 -0400 |
commit | 328ccdace8855289ad114b70ee1464ba5e3f6436 (patch) | |
tree | 66c2f0abe8ab330b3e2213046bf8f4eb454c20e4 /tools | |
parent | 12c08a9f591aeda57fb3b05897169e7da5439a79 (diff) |
perf report: Add --no-demangle option
It's sometimes useful to see undemangled raw symbol name for example
other tools using the perf output to do manipulation of binaries.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Suggested-by: William Cohen <wcohen@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: William Cohen <wcohen@redhat.com>
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=55571
Link: http://lkml.kernel.org/r/1364203098-17741-1-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-report.txt | 4 | ||||
-rw-r--r-- | tools/perf/builtin-report.c | 2 | ||||
-rw-r--r-- | tools/perf/util/symbol-elf.c | 9 | ||||
-rw-r--r-- | tools/perf/util/symbol.c | 1 | ||||
-rw-r--r-- | tools/perf/util/symbol.h | 3 |
5 files changed, 15 insertions, 4 deletions
diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt index 02284a0067f0..71f15510ca0b 100644 --- a/tools/perf/Documentation/perf-report.txt +++ b/tools/perf/Documentation/perf-report.txt | |||
@@ -206,6 +206,10 @@ OPTIONS | |||
206 | --group:: | 206 | --group:: |
207 | Show event group information together. | 207 | Show event group information together. |
208 | 208 | ||
209 | --demangle:: | ||
210 | Demangle symbol names to human readable form. It's enabled by default, | ||
211 | disable with --no-demangle. | ||
212 | |||
209 | SEE ALSO | 213 | SEE ALSO |
210 | -------- | 214 | -------- |
211 | linkperf:perf-stat[1], linkperf:perf-annotate[1] | 215 | linkperf:perf-stat[1], linkperf:perf-annotate[1] |
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 296bd219977a..b5ea26cc7eb1 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -692,6 +692,8 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused) | |||
692 | "use branch records for histogram filling", parse_branch_mode), | 692 | "use branch records for histogram filling", parse_branch_mode), |
693 | OPT_STRING(0, "objdump", &objdump_path, "path", | 693 | OPT_STRING(0, "objdump", &objdump_path, "path", |
694 | "objdump binary to use for disassembly and annotations"), | 694 | "objdump binary to use for disassembly and annotations"), |
695 | OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle, | ||
696 | "Disable symbol demangling"), | ||
695 | OPT_END() | 697 | OPT_END() |
696 | }; | 698 | }; |
697 | 699 | ||
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index 54efcb5659ac..4b12bf850325 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c | |||
@@ -806,9 +806,12 @@ int dso__load_sym(struct dso *dso, struct map *map, | |||
806 | * DWARF DW_compile_unit has this, but we don't always have access | 806 | * DWARF DW_compile_unit has this, but we don't always have access |
807 | * to it... | 807 | * to it... |
808 | */ | 808 | */ |
809 | demangled = bfd_demangle(NULL, elf_name, DMGL_PARAMS | DMGL_ANSI); | 809 | if (symbol_conf.demangle) { |
810 | if (demangled != NULL) | 810 | demangled = bfd_demangle(NULL, elf_name, |
811 | elf_name = demangled; | 811 | DMGL_PARAMS | DMGL_ANSI); |
812 | if (demangled != NULL) | ||
813 | elf_name = demangled; | ||
814 | } | ||
812 | new_symbol: | 815 | new_symbol: |
813 | f = symbol__new(sym.st_value, sym.st_size, | 816 | f = symbol__new(sym.st_value, sym.st_size, |
814 | GELF_ST_BIND(sym.st_info), elf_name); | 817 | GELF_ST_BIND(sym.st_info), elf_name); |
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index e6432d85b43d..8cf3b5426a9a 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -36,6 +36,7 @@ struct symbol_conf symbol_conf = { | |||
36 | .use_modules = true, | 36 | .use_modules = true, |
37 | .try_vmlinux_path = true, | 37 | .try_vmlinux_path = true, |
38 | .annotate_src = true, | 38 | .annotate_src = true, |
39 | .demangle = true, | ||
39 | .symfs = "", | 40 | .symfs = "", |
40 | }; | 41 | }; |
41 | 42 | ||
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index b62ca37c4b77..d7654c23861a 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h | |||
@@ -97,7 +97,8 @@ struct symbol_conf { | |||
97 | kptr_restrict, | 97 | kptr_restrict, |
98 | annotate_asm_raw, | 98 | annotate_asm_raw, |
99 | annotate_src, | 99 | annotate_src, |
100 | event_group; | 100 | event_group, |
101 | demangle; | ||
101 | const char *vmlinux_name, | 102 | const char *vmlinux_name, |
102 | *kallsyms_name, | 103 | *kallsyms_name, |
103 | *source_prefix, | 104 | *source_prefix, |