Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf build: Add feature check for dwarf_getcfi()

The dwarf_getcfi() is available on libdw 0.142+. Instead of just
checking the version number, it'd be nice to have a config item to check
the feature at build time.

Suggested-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: linux-toolchains@vger.kernel.org
Cc: linux-trace-devel@vger.kernel.org
Link: https://lore.kernel.org/r/20231110000012.3538610-9-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Namhyung Kim and committed by
Arnaldo Carvalho de Melo
f67f2fda 3f5928e4

+14
+1
tools/build/Makefile.feature
··· 32 32 backtrace \ 33 33 dwarf \ 34 34 dwarf_getlocations \ 35 + dwarf_getcfi \ 35 36 eventfd \ 36 37 fortify-source \ 37 38 get_current_dir_name \
+4
tools/build/feature/Makefile
··· 7 7 test-bionic.bin \ 8 8 test-dwarf.bin \ 9 9 test-dwarf_getlocations.bin \ 10 + test-dwarf_getcfi.bin \ 10 11 test-eventfd.bin \ 11 12 test-fortify-source.bin \ 12 13 test-get_current_dir_name.bin \ ··· 153 152 $(BUILD) $(DWARFLIBS) 154 153 155 154 $(OUTPUT)test-dwarf_getlocations.bin: 155 + $(BUILD) $(DWARFLIBS) 156 + 157 + $(OUTPUT)test-dwarf_getcfi.bin: 156 158 $(BUILD) $(DWARFLIBS) 157 159 158 160 $(OUTPUT)test-libelf-getphdrnum.bin:
+9
tools/build/feature/test-dwarf_getcfi.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + #include <stdio.h> 3 + #include <elfutils/libdw.h> 4 + 5 + int main(void) 6 + { 7 + Dwarf *dwarf = NULL; 8 + return dwarf_getcfi(dwarf) == NULL; 9 + }