History

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.

Ingo Molnar committed 13 years ago

Commit 14951f21 parent 9b565a81 file · +1 −26Browse files

Unified · Split

tools/perf/util/symbol-elf.c+1−26
@@ -928,33 +928,8 @@ int dso__load_sym(struct dso *dso, struct map *map, · 927 unmodified lines
928928 * to it...
929929 */
930930 if (symbol_conf.demangle) {
931− /*
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,
931+ demangled = bfd_demangle(NULL, elf_name,
947932 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);
958933 if (demangled != NULL)
959934 elf_name = demangled;
960935 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t