diff options
-rw-r--r-- | tools/perf/Documentation/perf-probe.txt | 3 | ||||
-rw-r--r-- | tools/perf/Documentation/perf-report.txt | 3 | ||||
-rw-r--r-- | tools/perf/Documentation/perf-top.txt | 3 | ||||
-rw-r--r-- | tools/perf/builtin-probe.c | 2 | ||||
-rw-r--r-- | tools/perf/builtin-report.c | 2 | ||||
-rw-r--r-- | tools/perf/builtin-top.c | 2 | ||||
-rw-r--r-- | tools/perf/util/symbol-elf.c | 7 | ||||
-rw-r--r-- | tools/perf/util/symbol.c | 1 | ||||
-rw-r--r-- | tools/perf/util/symbol.h | 1 |
9 files changed, 23 insertions, 1 deletions
diff --git a/tools/perf/Documentation/perf-probe.txt b/tools/perf/Documentation/perf-probe.txt index 1513935c399b..aaa869be3dc1 100644 --- a/tools/perf/Documentation/perf-probe.txt +++ b/tools/perf/Documentation/perf-probe.txt | |||
@@ -104,6 +104,9 @@ OPTIONS | |||
104 | Specify path to the executable or shared library file for user | 104 | Specify path to the executable or shared library file for user |
105 | space tracing. Can also be used with --funcs option. | 105 | space tracing. Can also be used with --funcs option. |
106 | 106 | ||
107 | --demangle-kernel:: | ||
108 | Demangle kernel symbols. | ||
109 | |||
107 | In absence of -m/-x options, perf probe checks if the first argument after | 110 | In absence of -m/-x options, perf probe checks if the first argument after |
108 | the options is an absolute path name. If its an absolute path, perf probe | 111 | the options is an absolute path name. If its an absolute path, perf probe |
109 | uses it as a target module/target user space binary to probe. | 112 | uses it as a target module/target user space binary to probe. |
diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt index d561e0214f52..0927bf4e6c2a 100644 --- a/tools/perf/Documentation/perf-report.txt +++ b/tools/perf/Documentation/perf-report.txt | |||
@@ -276,6 +276,9 @@ OPTIONS | |||
276 | Demangle symbol names to human readable form. It's enabled by default, | 276 | Demangle symbol names to human readable form. It's enabled by default, |
277 | disable with --no-demangle. | 277 | disable with --no-demangle. |
278 | 278 | ||
279 | --demangle-kernel:: | ||
280 | Demangle kernel symbol names to human readable form (for C++ kernels). | ||
281 | |||
279 | --mem-mode:: | 282 | --mem-mode:: |
280 | Use the data addresses of samples in addition to instruction addresses | 283 | Use the data addresses of samples in addition to instruction addresses |
281 | to build the histograms. To generate meaningful output, the perf.data | 284 | to build the histograms. To generate meaningful output, the perf.data |
diff --git a/tools/perf/Documentation/perf-top.txt b/tools/perf/Documentation/perf-top.txt index 28fdee394880..3265b1070518 100644 --- a/tools/perf/Documentation/perf-top.txt +++ b/tools/perf/Documentation/perf-top.txt | |||
@@ -98,6 +98,9 @@ Default is to monitor all CPUS. | |||
98 | --hide_user_symbols:: | 98 | --hide_user_symbols:: |
99 | Hide user symbols. | 99 | Hide user symbols. |
100 | 100 | ||
101 | --demangle-kernel:: | ||
102 | Demangle kernel symbols. | ||
103 | |||
101 | -D:: | 104 | -D:: |
102 | --dump-symtab:: | 105 | --dump-symtab:: |
103 | Dump the symbol table used for profiling. | 106 | Dump the symbol table used for profiling. |
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c index 347729e29a92..4d6858dbebea 100644 --- a/tools/perf/builtin-probe.c +++ b/tools/perf/builtin-probe.c | |||
@@ -376,6 +376,8 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused) | |||
376 | "target executable name or path", opt_set_target), | 376 | "target executable name or path", opt_set_target), |
377 | OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle, | 377 | OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle, |
378 | "Disable symbol demangling"), | 378 | "Disable symbol demangling"), |
379 | OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel, | ||
380 | "Enable kernel symbol demangling"), | ||
379 | OPT_END() | 381 | OPT_END() |
380 | }; | 382 | }; |
381 | int ret; | 383 | int ret; |
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 3da59a87ec7c..8c0b3f22412a 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -680,6 +680,8 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused) | |||
680 | "objdump binary to use for disassembly and annotations"), | 680 | "objdump binary to use for disassembly and annotations"), |
681 | OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle, | 681 | OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle, |
682 | "Disable symbol demangling"), | 682 | "Disable symbol demangling"), |
683 | OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel, | ||
684 | "Enable kernel symbol demangling"), | ||
683 | OPT_BOOLEAN(0, "mem-mode", &report.mem_mode, "mem access profile"), | 685 | OPT_BOOLEAN(0, "mem-mode", &report.mem_mode, "mem access profile"), |
684 | OPT_CALLBACK(0, "percent-limit", &report, "percent", | 686 | OPT_CALLBACK(0, "percent-limit", &report, "percent", |
685 | "Don't show entries under that percent", parse_percent_limit), | 687 | "Don't show entries under that percent", parse_percent_limit), |
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 9848e270b92c..7da2c46ea38f 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -1142,6 +1142,8 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused) | |||
1142 | "Interleave source code with assembly code (default)"), | 1142 | "Interleave source code with assembly code (default)"), |
1143 | OPT_BOOLEAN(0, "asm-raw", &symbol_conf.annotate_asm_raw, | 1143 | OPT_BOOLEAN(0, "asm-raw", &symbol_conf.annotate_asm_raw, |
1144 | "Display raw encoding of assembly instructions (default)"), | 1144 | "Display raw encoding of assembly instructions (default)"), |
1145 | OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel, | ||
1146 | "Enable kernel symbol demangling"), | ||
1145 | OPT_STRING(0, "objdump", &objdump_path, "path", | 1147 | OPT_STRING(0, "objdump", &objdump_path, "path", |
1146 | "objdump binary to use for disassembly and annotations"), | 1148 | "objdump binary to use for disassembly and annotations"), |
1147 | OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style", | 1149 | OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style", |
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index 9fb5e9e9f161..9c9b27fbc78d 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c | |||
@@ -680,6 +680,11 @@ static u64 ref_reloc(struct kmap *kmap) | |||
680 | return 0; | 680 | return 0; |
681 | } | 681 | } |
682 | 682 | ||
683 | static bool want_demangle(bool is_kernel_sym) | ||
684 | { | ||
685 | return is_kernel_sym ? symbol_conf.demangle_kernel : symbol_conf.demangle; | ||
686 | } | ||
687 | |||
683 | int dso__load_sym(struct dso *dso, struct map *map, | 688 | int dso__load_sym(struct dso *dso, struct map *map, |
684 | struct symsrc *syms_ss, struct symsrc *runtime_ss, | 689 | struct symsrc *syms_ss, struct symsrc *runtime_ss, |
685 | symbol_filter_t filter, int kmodule) | 690 | symbol_filter_t filter, int kmodule) |
@@ -938,7 +943,7 @@ new_symbol: | |||
938 | * DWARF DW_compile_unit has this, but we don't always have access | 943 | * DWARF DW_compile_unit has this, but we don't always have access |
939 | * to it... | 944 | * to it... |
940 | */ | 945 | */ |
941 | if (symbol_conf.demangle) { | 946 | if (want_demangle(dso->kernel || kmodule)) { |
942 | int demangle_flags = DMGL_NO_OPTS; | 947 | int demangle_flags = DMGL_NO_OPTS; |
943 | if (verbose) | 948 | if (verbose) |
944 | demangle_flags = DMGL_PARAMS | DMGL_ANSI; | 949 | demangle_flags = DMGL_PARAMS | DMGL_ANSI; |
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index ac098a3c2a31..1adb143867e3 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -34,6 +34,7 @@ struct symbol_conf symbol_conf = { | |||
34 | .try_vmlinux_path = true, | 34 | .try_vmlinux_path = true, |
35 | .annotate_src = true, | 35 | .annotate_src = true, |
36 | .demangle = true, | 36 | .demangle = true, |
37 | .demangle_kernel = false, | ||
37 | .cumulate_callchain = true, | 38 | .cumulate_callchain = true, |
38 | .show_hist_headers = true, | 39 | .show_hist_headers = true, |
39 | .symfs = "", | 40 | .symfs = "", |
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index 3f95ea0357e3..bec4b7bd09de 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h | |||
@@ -120,6 +120,7 @@ struct symbol_conf { | |||
120 | annotate_src, | 120 | annotate_src, |
121 | event_group, | 121 | event_group, |
122 | demangle, | 122 | demangle, |
123 | demangle_kernel, | ||
123 | filter_relative, | 124 | filter_relative, |
124 | show_hist_headers; | 125 | show_hist_headers; |
125 | const char *vmlinux_name, | 126 | const char *vmlinux_name, |