perf report: Add --no-demangle option
Namhyung Kim
maintainerPATCH 1/1 perf report: Add --no-demangle option
From: Namhyung Kim <[email protected]>
It's sometimes useful to see undemangled raw symbol name for example other tools using the perf output to do manipulation of binaries.
Suggested-by William Cohen <[email protected]>
Signed-off-by Namhyung Kim <[email protected]>
--- tools/perf/builtin-report.c | 2 ++ tools/perf/util/symbol-elf.c | 9 ++++++--- tools/perf/util/symbol.c | 1 + tools/perf/util/symbol.h | 3 ++- 4 files changed, 11 insertions(+), 4 deletions(-)
tools/perf/builtin-report.c +2 -0
@@ -692,6 +692,8 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused) "use branch records for histogram filling", parse_branch_mode),OPT_STRING (0 ,"objdump" , &objdump_path,"path" ,"objdump binary to use for disassembly and annotations" ), +OPT_BOOLEAN (0 ,"demangle" , &symbol_conf.demangle, +"Disable symbol demangling" ), OPT_END() };
tools/perf/util/symbol-elf.c +6 -3
@@ -806,9 +806,12 @@ int dso__load_sym(struct dso *dso, struct map *map,* DWARF DW_compile_unit has this, but we don't always have access * to it... */ - demangled =bfd_demangle (NULL , elf_name,DMGL_PARAMS |DMGL_ANSI ); -if (demangled !=NULL ) - elf_name = demangled; +if (symbol_conf.demangle) { + demangled =bfd_demangle (NULL , elf_name, +DMGL_PARAMS |DMGL_ANSI ); +if (demangled !=NULL ) + elf_name = demangled; + } new_symbol: f =symbol__new (sym.st_value, sym.st_size,GELF_ST_BIND (sym.st_info), elf_name);
tools/perf/util/symbol.c +1 -0
@@ -36,6 +36,7 @@ struct symbol_conf symbol_conf = { .use_modules = true, .try_vmlinux_path = true, .annotate_src = true, + .demangle = true, .symfs = "", };
tools/perf/util/symbol.h +2 -1
@@ -97,7 +97,8 @@ struct symbol_conf { kptr_restrict, annotate_asm_raw, annotate_src, - event_group; + event_group, + demangle;const char *vmlinux_name, *kallsyms_name, *source_prefix,
Signature · 1 line
1.7.11.7
Namhyung Kim
maintainerPATCH v2 1/1 perf report: Add --no-demangle option
From: Namhyung Kim <[email protected]>
It's sometimes useful to see undemangled raw symbol name for example other tools using the perf output to do manipulation of binaries.
Suggested-by William Cohen <[email protected]>
Signed-off-by Namhyung Kim <[email protected]>
---
Forgot to update the doc. Resending..
tools/perf/Documentation/perf-report.txt | 4 ++++ tools/perf/builtin-report.c | 2 ++ tools/perf/util/symbol-elf.c | 9 ++++++--- tools/perf/util/symbol.c | 1 + tools/perf/util/symbol.h | 3 ++- 5 files changed, 15 insertions(+), 4 deletions(-)
tools/perf/Documentation/perf-report.txt +4 -0
@@ -206,6 +206,10 @@ OPTIONS --group:: Show event group information together. +--demangle:: + Demangle symbol names to human readable form. It's enabled by default, + disable with --no-demangle. + SEE ALSO -------- linkperf:perf-stat[1], linkperf:perf-annotate[1]
tools/perf/builtin-report.c +2 -0
@@ -692,6 +692,8 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused) "use branch records for histogram filling", parse_branch_mode),OPT_STRING (0 ,"objdump" , &objdump_path,"path" ,"objdump binary to use for disassembly and annotations" ), +OPT_BOOLEAN (0 ,"demangle" , &symbol_conf.demangle, +"Disable symbol demangling" ), OPT_END() };
tools/perf/util/symbol-elf.c +6 -3
@@ -806,9 +806,12 @@ int dso__load_sym(struct dso *dso, struct map *map,* DWARF DW_compile_unit has this, but we don't always have access * to it... */ - demangled =bfd_demangle (NULL , elf_name,DMGL_PARAMS |DMGL_ANSI ); -if (demangled !=NULL ) - elf_name = demangled; +if (symbol_conf.demangle) { + demangled =bfd_demangle (NULL , elf_name, +DMGL_PARAMS |DMGL_ANSI ); +if (demangled !=NULL ) + elf_name = demangled; + } new_symbol: f =symbol__new (sym.st_value, sym.st_size,GELF_ST_BIND (sym.st_info), elf_name);
tools/perf/util/symbol.c +1 -0
@@ -36,6 +36,7 @@ struct symbol_conf symbol_conf = { .use_modules = true, .try_vmlinux_path = true, .annotate_src = true, + .demangle = true, .symfs = "", };
tools/perf/util/symbol.h +2 -1
@@ -97,7 +97,8 @@ struct symbol_conf { kptr_restrict, annotate_asm_raw, annotate_src, - event_group; + event_group, + demangle;const char *vmlinux_name, *kallsyms_name, *source_prefix,
Signature · 1 line
1.7.11.7
tip-bot for Namhyung Kim
merge botperf report: Add --no-demangle option
Commit-ID: 328ccdace8855289ad114b70ee1464ba5e3f6436 Gitweb: http://git.kernel.org/tip/328ccdace8855289ad114b70ee1464ba5e3f6436 Author: Namhyung Kim <[email protected]> AuthorDate: Mon, 25 Mar 2013 18:18:18 +0900 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 26 Mar 2013 16:38:21 -0300
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 <[email protected]>
Suggested-by William Cohen <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc William Cohen <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/perf/Documentation/perf-report.txt | 4 ++++ tools/perf/builtin-report.c | 2 ++ tools/perf/util/symbol-elf.c | 9 ++++++--- tools/perf/util/symbol.c | 1 + tools/perf/util/symbol.h | 3 ++- 5 files changed, 15 insertions(+), 4 deletions(-)
tools/perf/Documentation/perf-report.txt +4 -0
@@ -206,6 +206,10 @@ OPTIONS --group:: Show event group information together. +--demangle:: + Demangle symbol names to human readable form. It's enabled by default, + disable with --no-demangle. + SEE ALSO -------- linkperf:perf-stat[1], linkperf:perf-annotate[1]
tools/perf/builtin-report.c +2 -0
@@ -692,6 +692,8 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused) "use branch records for histogram filling", parse_branch_mode),OPT_STRING (0 ,"objdump" , &objdump_path,"path" ,"objdump binary to use for disassembly and annotations" ), +OPT_BOOLEAN (0 ,"demangle" , &symbol_conf.demangle, +"Disable symbol demangling" ), OPT_END() };
tools/perf/util/symbol-elf.c +6 -3
@@ -806,9 +806,12 @@ int dso__load_sym(struct dso *dso, struct map *map,* DWARF DW_compile_unit has this, but we don't always have access * to it... */ - demangled =bfd_demangle (NULL , elf_name,DMGL_PARAMS |DMGL_ANSI ); -if (demangled !=NULL ) - elf_name = demangled; +if (symbol_conf.demangle) { + demangled =bfd_demangle (NULL , elf_name, +DMGL_PARAMS |DMGL_ANSI ); +if (demangled !=NULL ) + elf_name = demangled; + } new_symbol: f =symbol__new (sym.st_value, sym.st_size,GELF_ST_BIND (sym.st_info), elf_name);
tools/perf/util/symbol.c +1 -0
@@ -36,6 +36,7 @@ struct symbol_conf symbol_conf = { .use_modules = true, .try_vmlinux_path = true, .annotate_src = true, + .demangle = true, .symfs = "", };
tools/perf/util/symbol.h +2 -1
@@ -97,7 +97,8 @@ struct symbol_conf { kptr_restrict, annotate_asm_raw, annotate_src, - event_group; + event_group, + demangle;const char *vmlinux_name, *kallsyms_name, *source_prefix,