summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/symbol-elf.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@cloudius-systems.com>2014-09-13 07:15:05 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-09-17 17:08:09 -0300
commit763122ade725592402190f5ff3b8d2edf42b87e8 (patch)
tree1ce5493cc830c0cd23c221665e7c143e668e43ac /tools/perf/util/symbol-elf.c
parent29a3ce31c38c8f73f4e076b7ffc0876b4f5dd6c3 (diff)
downloadblackbird-obmc-linux-763122ade725592402190f5ff3b8d2edf42b87e8.tar.gz
blackbird-obmc-linux-763122ade725592402190f5ff3b8d2edf42b87e8.zip
perf tools: Disable kernel symbol demangling by default
Some Linux symbols (for example __vt_event_wait) are interpreted by the demangler as C++ mangled names, which of course they aren't. Disable kernel symbol demangling by default to avoid this, and allow enabling it with a new option --demangle-kernel for those who wish it. Reported-by: Jiri Olsa <jolsa@redhat.com> Signed-off-by: Avi Kivity <avi@cloudius-systems.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lkml.kernel.org/r/1410581705-26968-1-git-send-email-avi@cloudius-systems.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/symbol-elf.c')
-rw-r--r--tools/perf/util/symbol-elf.c7
1 files changed, 6 insertions, 1 deletions
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)
return 0;
}
+static bool want_demangle(bool is_kernel_sym)
+{
+ return is_kernel_sym ? symbol_conf.demangle_kernel : symbol_conf.demangle;
+}
+
int dso__load_sym(struct dso *dso, struct map *map,
struct symsrc *syms_ss, struct symsrc *runtime_ss,
symbol_filter_t filter, int kmodule)
@@ -938,7 +943,7 @@ new_symbol:
* DWARF DW_compile_unit has this, but we don't always have access
* to it...
*/
- if (symbol_conf.demangle) {
+ if (want_demangle(dso->kernel || kmodule)) {
int demangle_flags = DMGL_NO_OPTS;
if (verbose)
demangle_flags = DMGL_PARAMS | DMGL_ANSI;
OpenPOWER on IntegriCloud