diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-28 17:21:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-28 17:21:13 -0400 |
commit | 9b565a8051b389e046209a5f68c93eade8de58bd (patch) | |
tree | 421884209c61b00e08fe7d47c957dc210df9a2b5 /tools/perf/util/symbol-elf.c | |
parent | ddd23eb1829988cc1ebc58a2f622c56c508e219e (diff) | |
parent | 8a3da6c7d0031fcb6a0d17f9c7a68b0e01f52855 (diff) |
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Ingo Molnar:
"A couple of tooling fixlets and a PMU detection printout fix"
* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
perf/x86: Fix PMU detection printout when no PMU is detected
perf symbols: Demangle cloned functions
perf machine: Fix path unpopulated in machine__create_modules()
perf tools: Explicitly add libdl dependency
perf probe: Fix probing symbols with optimization suffix
perf trace: Add mmap2 handler
perf kmem: Make it work again on non NUMA machines
Diffstat (limited to 'tools/perf/util/symbol-elf.c')
-rw-r--r-- | tools/perf/util/symbol-elf.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index a9c829be5216..d2a888e2e058 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c | |||
@@ -928,8 +928,33 @@ 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 | demangled = bfd_demangle(NULL, elf_name, | 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, | ||
932 | DMGL_PARAMS | DMGL_ANSI); | 947 | 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); | ||
933 | if (demangled != NULL) | 958 | if (demangled != NULL) |
934 | elf_name = demangled; | 959 | elf_name = demangled; |
935 | } | 960 | } |