[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231110192630.fd212e5f98049f1cf9cea72f@kernel.org>
Date: Fri, 10 Nov 2023 19:26:30 +0900
From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Jiri Olsa <jolsa@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Ingo Molnar <mingo@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
linux-perf-users@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
Stephane Eranian <eranian@...gle.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
Andi Kleen <ak@...ux.intel.com>,
linux-trace-devel@...r.kernel.org, linux-toolchains@...r.kernel.org
Subject: Re: [PATCH 08/52] perf build: Add feature check for dwarf_getcfi()
On Thu, 9 Nov 2023 15:59:27 -0800
Namhyung Kim <namhyung@...nel.org> wrote:
> 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.
Looks good to me.
Acked-by: Masami Hiramatsu (Google) <mhiramat@...nel.org>
Thanks!
>
> Suggested-by: Masami Hiramatsu (Google) <mhiramat@...nel.org>
> Signed-off-by: Namhyung Kim <namhyung@...nel.org>
> ---
> tools/build/Makefile.feature | 1 +
> tools/build/feature/Makefile | 4 ++++
> tools/build/feature/test-dwarf_getcfi.c | 9 +++++++++
> 3 files changed, 14 insertions(+)
> create mode 100644 tools/build/feature/test-dwarf_getcfi.c
>
> diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
> index 934e2777a2db..64df118376df 100644
> --- a/tools/build/Makefile.feature
> +++ b/tools/build/Makefile.feature
> @@ -32,6 +32,7 @@ FEATURE_TESTS_BASIC := \
> backtrace \
> dwarf \
> dwarf_getlocations \
> + dwarf_getcfi \
> eventfd \
> fortify-source \
> get_current_dir_name \
> diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
> index dad79ede4e0a..37722e509eb9 100644
> --- a/tools/build/feature/Makefile
> +++ b/tools/build/feature/Makefile
> @@ -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 @@ endif
> $(OUTPUT)test-dwarf_getlocations.bin:
> $(BUILD) $(DWARFLIBS)
>
> +$(OUTPUT)test-dwarf_getcfi.bin:
> + $(BUILD) $(DWARFLIBS)
> +
> $(OUTPUT)test-libelf-getphdrnum.bin:
> $(BUILD) -lelf
>
> diff --git a/tools/build/feature/test-dwarf_getcfi.c b/tools/build/feature/test-dwarf_getcfi.c
> new file mode 100644
> index 000000000000..50e7d7cb7bdf
> --- /dev/null
> +++ b/tools/build/feature/test-dwarf_getcfi.c
> @@ -0,0 +1,9 @@
> +// SPDX-License-Identifier: GPL-2.0
> +#include <stdio.h>
> +#include <elfutils/libdw.h>
> +
> +int main(void)
> +{
> + Dwarf *dwarf = NULL;
> + return dwarf_getcfi(dwarf) == NULL;
> +}
> --
> 2.42.0.869.gea05f2083d-goog
>
>
--
Masami Hiramatsu (Google) <mhiramat@...nel.org>
Powered by blists - more mailing lists