summaryrefslogtreecommitdiff
path: root/tools/perf/util/symbol-elf.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2013-09-20 04:47:39 (GMT)
committerIngo Molnar <mingo@kernel.org>2013-09-20 04:49:29 (GMT)
commit24e31f0bef40f6ed08073734d9250576a44a2db1 (patch)
treee87398352dfc9f96b9e5a509ed54d0d5739085bf /tools/perf/util/symbol-elf.c
parent186844b292140d1e33225ec95039b6adb03d3fec (diff)
parentce7eebe5c3deef8e19c177c24ee75843256e69ca (diff)
downloadlinux-fsl-qoriq-24e31f0bef40f6ed08073734d9250576a44a2db1.tar.xz
Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/urgent fixes from Arnaldo Carvalho de Melo: * Check for SIGINT in more loops, allowing tools such as 'perf report' to react faster to Ctrl+C, from Arnaldo Carvalho de Melo. * Fix objdump line parsing offset validation in the annotate code, from Adrian Hunter. * Fix buildid cache handling of kallsyms with kcore, from Adrian Hunter. * Fix compile with libelf without get_phdrnum, from Adrian Hunter. * Sharpen the libaudit dependencies test, refusing to build with older libraries that doesn't have all the functions used by 'perf trace", fix from Ingo Molnar. * Fill in new definitions for madvise()/mmap() flags to fix the build in older systems, from Ingo Molnar. * Fix old GCC build error in older systems in the kallsyms parsing code in trace-event-parse.c, from Ingo Molnar. * Ignore DWARF declaration tags, allowing, for instance, that the $ perf probe -L getname command succeeds in showing the source code for the 'getname' kernel function, telling in which lines probes can be inserted, fix from Masami Hiramatsu. * Fix linux/magic.h related build breakage in some systems, fix from Vinson Lee. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/symbol-elf.c')
-rw-r--r--tools/perf/util/symbol-elf.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index a7b9ab5..a9c829b 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -8,6 +8,22 @@
#include "symbol.h"
#include "debug.h"
+#ifndef HAVE_ELF_GETPHDRNUM
+static int elf_getphdrnum(Elf *elf, size_t *dst)
+{
+ GElf_Ehdr gehdr;
+ GElf_Ehdr *ehdr;
+
+ ehdr = gelf_getehdr(elf, &gehdr);
+ if (!ehdr)
+ return -1;
+
+ *dst = ehdr->e_phnum;
+
+ return 0;
+}
+#endif
+
#ifndef NT_GNU_BUILD_ID
#define NT_GNU_BUILD_ID 3
#endif