diff options
author | Maciej Debski <maciejd@google.com> | 2016-10-13 12:59:36 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-10-24 16:07:37 +0200 |
commit | 621cb4e7837e39d25a5af5a785ad282cdd2b4ce8 (patch) | |
tree | c98e452cb4aa99d4debe6a25ea135ecec406d9bc /tools/perf/util/genelf.c | |
parent | perf jit: Improve error messages from JVMTI (diff) | |
download | linux-621cb4e7837e39d25a5af5a785ad282cdd2b4ce8.tar.xz linux-621cb4e7837e39d25a5af5a785ad282cdd2b4ce8.zip |
perf jit: Enable jitdump support without dwarf
This patch modifies the build dependencies on the jitdump support in
perf. As it stands jitdump was wrongfully made dependent 100% on using
DWARF. However, the dwarf dependency, only exist if generating the
source line table in genelf_debug.c. The rest of the support does not
need DWARF.
This patch removes the dependency on DWARF for the entire jitdump
support. It keeps it only for the genelf_debug.c support.
Signed-off-by: Maciej Debski <maciejd@google.com>
Reviewed-by: Stephane Eranian <eranian@google.com>
Cc: Anton Blanchard <anton@ozlabs.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1476356383-30100-3-git-send-email-eranian@google.com
Fixes: e12b202f8fb9 ("perf jitdump: Build only on supported archs")
[ Make it build only if NO_LIBELF isn't defined, as jitdump.o will only be built in that case ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/genelf.c')
-rw-r--r-- | tools/perf/util/genelf.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/perf/util/genelf.c b/tools/perf/util/genelf.c index 8a2995ea426f..30dece345b9f 100644 --- a/tools/perf/util/genelf.c +++ b/tools/perf/util/genelf.c @@ -19,7 +19,9 @@ #include <limits.h> #include <fcntl.h> #include <err.h> +#ifdef HAVE_DWARF_SUPPORT #include <dwarf.h> +#endif #include "perf.h" #include "genelf.h" @@ -161,7 +163,7 @@ gen_build_id(struct buildid_note *note, unsigned long load_addr, const void *cod int jit_write_elf(int fd, uint64_t load_addr, const char *sym, const void *code, int csize, - void *debug, int nr_debug_entries) + void *debug __maybe_unused, int nr_debug_entries __maybe_unused) { Elf *e; Elf_Data *d; @@ -390,11 +392,14 @@ jit_write_elf(int fd, uint64_t load_addr, const char *sym, shdr->sh_size = sizeof(bnote); shdr->sh_entsize = 0; +#ifdef HAVE_DWARF_SUPPORT if (debug && nr_debug_entries) { retval = jit_add_debug_info(e, load_addr, debug, nr_debug_entries); if (retval) goto error; - } else { + } else +#endif + { if (elf_update(e, ELF_C_WRITE) < 0) { warnx("elf_update 4 failed"); goto error; |