Commit f67f2fda authored by Namhyung Kim's avatar Namhyung Kim Committed by Arnaldo Carvalho de Melo
Browse files

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: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
Acked-by: default avatarMasami 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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 3f5928e4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ FEATURE_TESTS_BASIC := \
        backtrace                       \
        dwarf                           \
        dwarf_getlocations              \
        dwarf_getcfi                    \
        eventfd                         \
        fortify-source                  \
        get_current_dir_name            \
+4 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ FILES= \
         test-bionic.bin                        \
         test-dwarf.bin                         \
         test-dwarf_getlocations.bin            \
         test-dwarf_getcfi.bin                  \
         test-eventfd.bin                       \
         test-fortify-source.bin                \
         test-get_current_dir_name.bin          \
@@ -154,6 +155,9 @@ $(OUTPUT)test-dwarf.bin:
$(OUTPUT)test-dwarf_getlocations.bin:
	$(BUILD) $(DWARFLIBS)

$(OUTPUT)test-dwarf_getcfi.bin:
	$(BUILD) $(DWARFLIBS)

$(OUTPUT)test-libelf-getphdrnum.bin:
	$(BUILD) -lelf

+9 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <elfutils/libdw.h>

int main(void)
{
	Dwarf *dwarf = NULL;
	return dwarf_getcfi(dwarf) == NULL;
}