Commit e71e7945 authored by Namhyung Kim's avatar Namhyung Kim Committed by Arnaldo Carvalho de Melo

perf symbols: Don't demangle parameters and such by default

Some C++ symbols have very long name and they make column length longer.
Most of them are about parameters including templates and we can ignore
such info most of time IMHO.

This patch passes DMGL_NO_OPTS by default when calling bfd_demangle().
One can still see full symbols with -v/--verbose option.

before:
  JS_CallFunctionValue(JSContext*, JSObject*, JS::Value, unsigned int, JS::Value*, JS::Value*)

after:
  JS_CallFunctionValue
Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1406785662-5534-9-git-send-email-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 42337a22
...@@ -939,8 +939,11 @@ int dso__load_sym(struct dso *dso, struct map *map, ...@@ -939,8 +939,11 @@ int dso__load_sym(struct dso *dso, struct map *map,
* to it... * to it...
*/ */
if (symbol_conf.demangle) { if (symbol_conf.demangle) {
demangled = bfd_demangle(NULL, elf_name, int demangle_flags = DMGL_NO_OPTS;
DMGL_PARAMS | DMGL_ANSI); if (verbose)
demangle_flags = DMGL_PARAMS | DMGL_ANSI;
demangled = bfd_demangle(NULL, elf_name, demangle_flags);
if (demangled != NULL) if (demangled != NULL)
elf_name = demangled; elf_name = demangled;
} }
......
...@@ -60,6 +60,7 @@ extern Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep, ...@@ -60,6 +60,7 @@ extern Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep,
#endif #endif
#ifndef DMGL_PARAMS #ifndef DMGL_PARAMS
#define DMGL_NO_OPTS 0 /* For readability... */
#define DMGL_PARAMS (1 << 0) /* Include function args */ #define DMGL_PARAMS (1 << 0) /* Include function args */
#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */ #define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment