aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/probe-file.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2016-07-12 11:19:09 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-07-12 14:20:41 -0400
commit1c1a3a4729aae712c55e001e151ef008d030d4a7 (patch)
tree62fd90d09b08cf1a48eaa85ea8a21d7b2cc55b5d /tools/perf/util/probe-file.c
parentc8a3f7de76717a994c208e137156c077b1e93092 (diff)
perf tools: Add feature detection for gelf_getnote()
That is not present on some libelf implementations, such as the one used in Alpine Linux: libelf-0.8.13. This ends up disabling the SDT code, that relies on this function. One alternative would be to provide an weak fallback implementation or the open coded variant used by the buildid sysfs notes reading code. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com> Cc: Brendan Gregg <brendan.d.gregg@gmail.com> Cc: David Ahern <dsahern@gmail.com> Cc: Hemant Kumar <hemant@linux.vnet.ibm.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-82lh22ybedy9b9lych8xj12g@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/probe-file.c')
-rw-r--r--tools/perf/util/probe-file.c2
1 files changed, 2 insertions, 0 deletions
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:
624 return ret; 624 return ret;
625} 625}
626 626
627#ifdef HAVE_GELF_GETNOTE_SUPPORT
627static unsigned long long sdt_note__get_addr(struct sdt_note *note) 628static unsigned long long sdt_note__get_addr(struct sdt_note *note)
628{ 629{
629 return note->bit32 ? (unsigned long long)note->addr.a32[0] 630 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)
682 cleanup_sdt_note_list(&sdtlist); 683 cleanup_sdt_note_list(&sdtlist);
683 return ret; 684 return ret;
684} 685}
686#endif
685 687
686static int probe_cache_entry__write(struct probe_cache_entry *entry, int fd) 688static int probe_cache_entry__write(struct probe_cache_entry *entry, int fd)
687{ 689{