aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-11-04 05:54:15 -0500
committerIngo Molnar <mingo@elte.hu>2009-11-04 05:59:45 -0500
commita2e71271535fde493c32803b1f34789f97efcb5e (patch)
tree90d7139bea2f49e947f27af92614fa6eca50b64d /tools/perf
parent6d7aa9d721c8c640066142fd9534afcdf68d7f9d (diff)
parentb419148e567728f6af0c3b01965c1cc141e3e13a (diff)
Merge commit 'v2.6.32-rc6' into perf/core
Conflicts: tools/perf/Makefile Merge reason: Resolve the conflict, merge to upstream and merge in perf fixes so we can add a dependent patch. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/Makefile15
-rw-r--r--tools/perf/util/symbol.c6
-rw-r--r--tools/perf/util/symbol.h10
3 files changed, 20 insertions, 11 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 9f4488d6f8e6..542b29e2e382 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -177,8 +177,7 @@ endif
177# Include saner warnings here, which can catch bugs: 177# Include saner warnings here, which can catch bugs:
178# 178#
179 179
180EXTRA_WARNINGS := -Wcast-align 180EXTRA_WARNINGS := -Wformat
181EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat
182EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-security 181EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-security
183EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-y2k 182EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-y2k
184EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wshadow 183EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wshadow
@@ -456,12 +455,12 @@ ifeq ($(uname_S),Darwin)
456 PTHREAD_LIBS = 455 PTHREAD_LIBS =
457endif 456endif
458 457
459ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y) 458ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y)
460 msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]); 459 ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y)
461endif 460 BASIC_CFLAGS += -DLIBELF_NO_MMAP
462 461 endif
463ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y) 462else
464 msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel); 463 msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel and glibc-dev[el]);
465endif 464endif
466 465
467ifdef NO_DEMANGLE 466ifdef NO_DEMANGLE
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 93c49f4685ff..ac94d7b94f61 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -549,7 +549,7 @@ static int dso__synthesize_plt_symbols(struct dso *self)
549 if (fd < 0) 549 if (fd < 0)
550 goto out; 550 goto out;
551 551
552 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); 552 elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL);
553 if (elf == NULL) 553 if (elf == NULL)
554 goto out_close; 554 goto out_close;
555 555
@@ -673,7 +673,7 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name,
673 Elf *elf; 673 Elf *elf;
674 int nr = 0; 674 int nr = 0;
675 675
676 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); 676 elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL);
677 if (elf == NULL) { 677 if (elf == NULL) {
678 pr_err("%s: cannot read %s ELF file.\n", __func__, name); 678 pr_err("%s: cannot read %s ELF file.\n", __func__, name);
679 goto out_close; 679 goto out_close;
@@ -842,7 +842,7 @@ static char *dso__read_build_id(struct dso *self)
842 if (fd < 0) 842 if (fd < 0)
843 goto out; 843 goto out;
844 844
845 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); 845 elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL);
846 if (elf == NULL) { 846 if (elf == NULL) {
847 pr_err("%s: cannot read %s ELF file.\n", __func__, 847 pr_err("%s: cannot read %s ELF file.\n", __func__,
848 self->long_name); 848 self->long_name);
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index a471a3840736..088433062dd4 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -27,6 +27,16 @@ static inline char *bfd_demangle(void __used *v, const char __used *c,
27#endif 27#endif
28#endif 28#endif
29 29
30/*
31 * libelf 0.8.x and earlier do not support ELF_C_READ_MMAP;
32 * for newer versions we can use mmap to reduce memory usage:
33 */
34#ifdef LIBELF_NO_MMAP
35# define PERF_ELF_C_READ_MMAP ELF_C_READ
36#else
37# define PERF_ELF_C_READ_MMAP ELF_C_READ_MMAP
38#endif
39
30#ifndef DMGL_PARAMS 40#ifndef DMGL_PARAMS
31#define DMGL_PARAMS (1 << 0) /* Include function args */ 41#define DMGL_PARAMS (1 << 0) /* Include function args */
32#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */ 42#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */