diff options
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, |