diff options
| author | Ian Rogers <[email protected]> | 2024-10-17 00:13:51 +0000 |
|---|---|---|
| committer | Namhyung Kim <[email protected]> | 2024-10-18 17:17:40 +0000 |
| commit | 91e81e988fc9c51f9f9f4cf6de74aa66a57b4361 (patch) | |
| tree | aacd8e9a9488a994394fd1ab4e431e0fee554233 | |
| parent | perf build: Combine test-dwarf-getcfi into test-libdw (diff) | |
| download | kernel-91e81e988fc9c51f9f9f4cf6de74aa66a57b4361.tar.gz kernel-91e81e988fc9c51f9f9f4cf6de74aa66a57b4361.zip | |
perf probe: Move elfutils support check to libdw check
The test _ELFUTILS_PREREQ(0, 142) is false for elfutils before
2009-06-13, but that is 15 years ago and very unlikely. Add a test to
test-libdw.c and assume the libdw version is at least 0.142 to
simplify the build logic.
Signed-off-by: Ian Rogers <[email protected]>
Acked-by: Namhyung Kim <[email protected]>
Cc: Anup Patel <[email protected]>
Cc: Yang Jihong <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Albert Ou <[email protected]>
Cc: Shenlin Liang <[email protected]>
Cc: Nick Terrell <[email protected]>
Cc: Guilherme Amadio <[email protected]>
Cc: Steinar H. Gunderson <[email protected]>
Cc: Changbin Du <[email protected]>
Cc: Alexander Lobakin <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: Guo Ren <[email protected]>
Cc: Masahiro Yamada <[email protected]>
Cc: Masami Hiramatsu (Google) <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: James Clark <[email protected]>
Cc: Mike Leach <[email protected]>
Cc: Chen Pei <[email protected]>
Cc: Leo Yan <[email protected]>
Cc: Oliver Upton <[email protected]>
Cc: Aditya Gupta <[email protected]>
Cc: Kajol Jain <[email protected]>
Cc: Athira Rajeev <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: Bibo Mao <[email protected]>
Cc: John Garry <[email protected]>
Cc: Atish Patra <[email protected]>
Cc: Dima Kogan <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Dr. David Alan Gilbert <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Namhyung Kim <[email protected]>
| -rw-r--r-- | tools/build/feature/test-libdw.c | 10 | ||||
| -rw-r--r-- | tools/perf/util/probe-finder.c | 2 | ||||
| -rw-r--r-- | tools/perf/util/probe-finder.h | 2 |
3 files changed, 9 insertions, 5 deletions
diff --git a/tools/build/feature/test-libdw.c b/tools/build/feature/test-libdw.c index 71c6f8e3b0ee..2fb59479ab77 100644 --- a/tools/build/feature/test-libdw.c +++ b/tools/build/feature/test-libdw.c @@ -41,8 +41,16 @@ int test_libdw_getcfi(void) return dwarf_getcfi(dwarf) == NULL; } +int test_elfutils(void) +{ + Dwarf_CFI *cfi = NULL; + + dwarf_cfi_end(cfi); + return 0; +} + int main(void) { return test_libdw() + test_libdw_unwind() + test_libdw_getlocations() + - test_libdw_getcfi(); + test_libdw_getcfi() + test_elfutils(); } diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index a30f88ed0300..bb27a406b7c6 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c @@ -1379,9 +1379,7 @@ int debuginfo__find_trace_events(struct debuginfo *dbg, if (ret >= 0 && tf.pf.skip_empty_arg) ret = fill_empty_trace_arg(pev, tf.tevs, tf.ntevs); -#if _ELFUTILS_PREREQ(0, 142) dwarf_cfi_end(tf.pf.cfi_eh); -#endif if (ret < 0 || tf.ntevs == 0) { for (i = 0; i < tf.ntevs; i++) diff --git a/tools/perf/util/probe-finder.h b/tools/perf/util/probe-finder.h index 724db829b49e..5ced3b058fd8 100644 --- a/tools/perf/util/probe-finder.h +++ b/tools/perf/util/probe-finder.h @@ -63,12 +63,10 @@ struct probe_finder { struct intlist *lcache; /* Line cache for lazy match */ /* For variable searching */ -#if _ELFUTILS_PREREQ(0, 142) /* Call Frame Information from .eh_frame. Owned by this struct. */ Dwarf_CFI *cfi_eh; /* Call Frame Information from .debug_frame. Not owned. */ Dwarf_CFI *cfi_dbg; -#endif Dwarf_Op *fb_ops; /* Frame base attribute */ unsigned int machine; /* Target machine arch */ struct perf_probe_arg *pvar; /* Current target variable */ |
