aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2013-09-29 10:12:54 -0400
committerIngo Molnar <mingo@kernel.org>2013-09-29 10:12:54 -0400
commit14951f22f1cc8375ead345d2ca08455e91f2152b (patch)
treed17141520f8e8a107355d24799ff79a4e1372277 /tools
parent9b565a8051b389e046209a5f68c93eade8de58bd (diff)
Revert "perf symbols: Demangle cloned functions"
This reverts commit de95ab53645a2f0015e0f68ee723f18dce2b8b51. Markus Trippelsdorf reported that this commit broke 'perf top': > I just see a gray screen with no text at all. Sometimes the > following error messages are printed: > > *** Error in `perf': invalid fastbin entry (free): 0x00000000029b18c0 > *** > *** Error in `perf': malloc(): memory corruption (fast): 0x0000000000ee0b10 *** While this code is fixable, the commit itself fails on several levels: - it should have been a separate helper function - why the heck does it do strchr() twice - it casts a const char * over into char * - sloppy style - it's not even a regression fix! So lets revert it and re-try the patch in v3.13. Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de> Cc: Andi Kleen <ak@linux.intel.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/symbol-elf.c27
1 files changed, 1 insertions, 26 deletions
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index d2a888e2e058..a9c829be5216 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -928,33 +928,8 @@ int dso__load_sym(struct dso *dso, struct map *map,
928 * to it... 928 * to it...
929 */ 929 */
930 if (symbol_conf.demangle) { 930 if (symbol_conf.demangle) {
931 /* 931 demangled = bfd_demangle(NULL, elf_name,
932 * The demangler doesn't deal with cloned functions.
933 * XXXX.clone.NUM or similar
934 * Strip the dot part and readd it later.
935 */
936 char *p = (char *)elf_name, *dot;
937 dot = strchr(elf_name, '.');
938 if (dot) {
939 p = strdup(elf_name);
940 if (!p)
941 goto new_symbol;
942 dot = strchr(p, '.');
943 *dot = 0;
944 }
945
946 demangled = bfd_demangle(NULL, p,
947 DMGL_PARAMS | DMGL_ANSI); 932 DMGL_PARAMS | DMGL_ANSI);
948 if (dot)
949 *dot = '.';
950 if (demangled && dot) {
951 demangled = realloc(demangled, strlen(demangled) + strlen(dot) + 1);
952 if (!demangled)
953 goto new_symbol;
954 strcpy(demangled + (dot - p), dot);
955 }
956 if (p != elf_name)
957 free(p);
958 if (demangled != NULL) 933 if (demangled != NULL)
959 elf_name = demangled; 934 elf_name = demangled;
960 } 935 }