Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1500175
| From | Stephane Eranian <eranian@google.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 2/9] perf/jit: enable jitdump support without dwarf |
| Date | 2016-10-13 13:10 +0200 |
| Message-ID | <srM3E-2I3-51@gated-at.bofh.it> (permalink) |
| References | <srM3D-2I3-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Maciej Debski <maciejd@google.com>
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>
---
tools/perf/Makefile.config | 2 --
tools/perf/util/Build | 2 +-
tools/perf/util/genelf.c | 9 +++++++--
tools/perf/util/genelf.h | 2 ++
4 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 72edf83d76b7..8cfc310d4358 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -366,10 +366,8 @@ ifndef NO_SDT
endif
ifdef PERF_HAVE_JITDUMP
- ifndef NO_DWARF
$(call detected,CONFIG_JITDUMP)
CFLAGS += -DHAVE_JITDUMP
- endif
endif
ifeq ($(ARCH),powerpc)
diff --git a/tools/perf/util/Build b/tools/perf/util/Build
index eb60e613d795..1dc67efad634 100644
--- a/tools/perf/util/Build
+++ b/tools/perf/util/Build
@@ -120,7 +120,7 @@ libperf-y += demangle-rust.o
ifdef CONFIG_JITDUMP
libperf-$(CONFIG_LIBELF) += jitdump.o
libperf-$(CONFIG_LIBELF) += genelf.o
-libperf-$(CONFIG_LIBELF) += genelf_debug.o
+libperf-$(CONFIG_DWARF) += genelf_debug.o
endif
CFLAGS_config.o += -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
diff --git a/tools/perf/util/genelf.c b/tools/perf/util/genelf.c
index c1ef805c6a8f..14a73acc549c 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"
@@ -157,7 +159,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;
@@ -386,11 +388,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;
diff --git a/tools/perf/util/genelf.h b/tools/perf/util/genelf.h
index 2fbeb59c4bdd..5c933ac71451 100644
--- a/tools/perf/util/genelf.h
+++ b/tools/perf/util/genelf.h
@@ -4,8 +4,10 @@
/* genelf.c */
int jit_write_elf(int fd, uint64_t code_addr, const char *sym,
const void *code, int csize, void *debug, int nr_debug_entries);
+#ifdef HAVE_DWARF_SUPPORT
/* genelf_debug.c */
int jit_add_debug_info(Elf *e, uint64_t code_addr, void *debug, int nr_debug_entries);
+#endif
#if defined(__arm__)
#define GEN_ELF_ARCH EM_ARM
--
1.9.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/9] perf/jit: various improvements Stephane Eranian <eranian@google.com> - 2016-10-13 13:10 +0200
[PATCH 1/9] perf/jit: improve error messages from JVMTI Stephane Eranian <eranian@google.com> - 2016-10-13 13:10 +0200
Re: [PATCH 1/9] perf/jit: improve error messages from JVMTI Nilay Vaish <nilayvaish@gmail.com> - 2016-10-13 22:30 +0200
Re: [PATCH 1/9] perf/jit: improve error messages from JVMTI Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-14 13:20 +0200
Re: [PATCH 1/9] perf/jit: improve error messages from JVMTI Stephane Eranian <eranian@google.com> - 2016-10-14 15:30 +0200
Re: [PATCH 1/9] perf/jit: improve error messages from JVMTI Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-14 17:30 +0200
Re: [PATCH 1/9] perf/jit: improve error messages from JVMTI Stephane Eranian <eranian@google.com> - 2016-10-17 16:00 +0200
[tip:perf/core] perf jit: Improve error messages from JVMTI tip-bot for Stephane Eranian <tipbot@zytor.com> - 2016-10-24 21:10 +0200
[PATCH 5/9] perf/jit: do not assume pgoff is zero Stephane Eranian <eranian@google.com> - 2016-10-13 13:10 +0200
[tip:perf/core] perf jit: Do not assume pgoff is zero tip-bot for Stefano Sanfilippo <tipbot@zytor.com> - 2016-10-24 21:10 +0200
[PATCH 8/9] perf/jit: Check JITHEADER_VERSION Stephane Eranian <eranian@google.com> - 2016-10-13 13:10 +0200
[tip:perf/core] perf jit: Check JITHEADER_VERSION tip-bot for Stefano Sanfilippo <tipbot@zytor.com> - 2016-10-24 21:10 +0200
[PATCH 3/9] perf/jit: remove unecessary padding in jitdump file Stephane Eranian <eranian@google.com> - 2016-10-13 13:10 +0200
[tip:perf/core] perf jit: Remove unecessary padding in jitdump file tip-bot for Stephane Eranian <tipbot@zytor.com> - 2016-10-24 21:00 +0200
[PATCH 6/9] perf/jit: add unwinding support Stephane Eranian <eranian@google.com> - 2016-10-13 13:10 +0200
[tip:perf/core] perf jit: Add unwinding support tip-bot for Stefano Sanfilippo <tipbot@zytor.com> - 2016-10-24 21:10 +0200
[PATCH 2/9] perf/jit: enable jitdump support without dwarf Stephane Eranian <eranian@google.com> - 2016-10-13 13:10 +0200
Re: [PATCH 2/9] perf/jit: enable jitdump support without dwarf Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-13 20:20 +0200
Re: [PATCH 2/9] perf/jit: enable jitdump support without dwarf Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-13 21:00 +0200
Re: [PATCH 2/9] perf/jit: enable jitdump support without dwarf Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-13 21:20 +0200
Re: [PATCH 2/9] perf/jit: enable jitdump support without dwarf Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-13 21:50 +0200
Re: [PATCH 2/9] perf/jit: enable jitdump support without dwarf Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-13 21:40 +0200
[tip:perf/core] perf jit: Enable jitdump support without dwarf tip-bot for Maciej Debski <tipbot@zytor.com> - 2016-10-24 21:00 +0200
csiph-web