Bug 55571

Summary: Have a --no-demangle option for "perf report"
Product: Tracing/Profiling Reporter: William Cohen (wcohen)
Component: Perf toolAssignee: Namhyung Kim (namhyung)
Status: ASSIGNED ---    
Severity: enhancement CC: acme
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:

Description William Cohen 2013-03-21 19:34:00 UTC
There are cases when one would want to know the actual function name in the binary rather the the demangled human readable name, for example other tools using the perf output to do manipulation of binaries. Having a means of turning off the demangling in perf report would useful.
Comment 1 Arnaldo Carvalho de Melo 2013-03-25 20:47:24 UTC
I merged Namhyung --no-demangle patch, but I think it would be great to be able to switch this on the fly, i.e. to assign a hotkey to toggle symbol_conf.demangle

For that we would have to save both the mangled and demangled symbol name on 'struct symbol', having a bool symbol->demangled that if true means that symbol->name + symbol->namelen + 1 had the demangled symbol name and symbol->name had the mangled name, symbol__name(symbol) would check symbol_conf->demangle, etc.
Comment 2 William Cohen 2013-03-25 22:08:45 UTC
For the purposes that I have, Namhyung's patch works well.  However, I can see where it would be nice to toggle between the mangled/demangled as the developer is referring to both things in binaries and source code.
Comment 3 Namhyung Kim 2013-03-26 00:16:42 UTC
I'm not sure it'd ok to have both symbol names always.  In most cases user might want demangled names only, and if so it's just wasting the memory.