[tip:perf/urgent] Revert "perf symbols: Demangle cloned functions "

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  14951f22f1cc8375ead345d2ca08455e91f2152b
Gitweb:     http://git.kernel.org/tip/14951f22f1cc8375ead345d2ca08455e91f2152b
Author:     Ingo Molnar <mingo@xxxxxxxxxx>
AuthorDate: Sun, 29 Sep 2013 16:12:54 +0200
Committer:  Ingo Molnar <mingo@xxxxxxxxxx>
CommitDate: Sun, 29 Sep 2013 16:12:54 +0200

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@xxxxxxxxxxxxxxx>
Cc: Andi Kleen <ak@xxxxxxxxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
---
 tools/perf/util/symbol-elf.c | 27 +--------------------------
 1 file changed, 1 insertion(+), 26 deletions(-)

diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index d2a888e..a9c829b 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,
 		 * to it...
 		 */
 		if (symbol_conf.demangle) {
-			/*
-			 * The demangler doesn't deal with cloned functions.
-			 * XXXX.clone.NUM or similar
-			 * Strip the dot part and readd it later.
-			 */
-			char *p = (char *)elf_name, *dot;
-			dot = strchr(elf_name, '.');
-			if (dot) {
-				p = strdup(elf_name);
-				if (!p)
-					goto new_symbol;
-				dot = strchr(p, '.');
-				*dot = 0;
-			}
-
-			demangled = bfd_demangle(NULL, p,
+			demangled = bfd_demangle(NULL, elf_name,
 						 DMGL_PARAMS | DMGL_ANSI);
-			if (dot)
-				*dot = '.';
-			if (demangled && dot) {
-				demangled = realloc(demangled, strlen(demangled) + strlen(dot) + 1);
-				if (!demangled)
-					goto new_symbol;
-				strcpy(demangled + (dot - p), dot);
-			}
-			if (p != elf_name)
-				free(p);
 			if (demangled != NULL)
 				elf_name = demangled;
 		}
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux