aboutsummaryrefslogtreecommitdiff
path: root/tools/perf
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/config/Makefile6
-rw-r--r--tools/perf/util/build-id.c2
-rw-r--r--tools/perf/util/probe-file.c2
-rw-r--r--tools/perf/util/symbol-elf.c2
4 files changed, 11 insertions, 1 deletions
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 97d47140a637..5ac428060779 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -309,6 +309,12 @@ ifndef NO_LIBELF
CFLAGS += -DHAVE_ELF_GETPHDRNUM_SUPPORT
endif
+ ifeq ($(feature-libelf-gelf_getnote), 1)
+ CFLAGS += -DHAVE_GELF_GETNOTE_SUPPORT
+ else
+ msg := $(warning gelf_getnote() not found on libelf, SDT support disabled);
+ endif
+
ifeq ($(feature-libelf-getshdrstrndx), 1)
CFLAGS += -DHAVE_ELF_GETSHDRSTRNDX_SUPPORT
endif
diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
index e1a16408da9c..1e504e40dac8 100644
--- a/tools/perf/util/build-id.c
+++ b/tools/perf/util/build-id.c
@@ -533,7 +533,7 @@ int build_id_cache__list_build_ids(const char *pathname,
return ret;
}
-#ifdef HAVE_LIBELF_SUPPORT
+#if defined(HAVE_LIBELF_SUPPORT) && defined(HAVE_GELF_GETNOTE_SUPPORT)
static int build_id_cache__add_sdt_cache(const char *sbuild_id,
const char *realname)
{
diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c
index 98398b55a03f..e705a742ee1e 100644
--- a/tools/perf/util/probe-file.c
+++ b/tools/perf/util/probe-file.c
@@ -624,6 +624,7 @@ out_err:
return ret;
}
+#ifdef HAVE_GELF_GETNOTE_SUPPORT
static unsigned long long sdt_note__get_addr(struct sdt_note *note)
{
return note->bit32 ? (unsigned long long)note->addr.a32[0]
@@ -682,6 +683,7 @@ int probe_cache__scan_sdt(struct probe_cache *pcache, const char *pathname)
cleanup_sdt_note_list(&sdtlist);
return ret;
}
+#endif
static int probe_cache_entry__write(struct probe_cache_entry *entry, int fd)
{
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 79a6a190f41d..cebf98ec27bc 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -1790,6 +1790,7 @@ void kcore_extract__delete(struct kcore_extract *kce)
unlink(kce->extract_filename);
}
+#ifdef HAVE_GELF_GETNOTE_SUPPORT
/**
* populate_sdt_note : Parse raw data and identify SDT note
* @elf: elf of the opened file
@@ -2041,6 +2042,7 @@ int sdt_notes__get_count(struct list_head *start)
count++;
return count;
}
+#endif
void symbol__elf_init(void)
{