[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241017001354.56973-9-irogers@google.com>
Date: Wed, 16 Oct 2024 17:13:51 -0700
From: Ian Rogers <irogers@...gle.com>
To: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>, Namhyung Kim <namhyung@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>,
Ian Rogers <irogers@...gle.com>, Adrian Hunter <adrian.hunter@...el.com>,
Kan Liang <kan.liang@...ux.intel.com>, John Garry <john.g.garry@...cle.com>,
Will Deacon <will@...nel.org>, James Clark <james.clark@...aro.org>,
Mike Leach <mike.leach@...aro.org>, Leo Yan <leo.yan@...ux.dev>, Guo Ren <guoren@...nel.org>,
Paul Walmsley <paul.walmsley@...ive.com>, Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>, Nick Terrell <terrelln@...com>,
"Masami Hiramatsu (Google)" <mhiramat@...nel.org>, Changbin Du <changbin.du@...wei.com>,
Guilherme Amadio <amadio@...too.org>, Yang Jihong <yangjihong@...edance.com>,
Aditya Gupta <adityag@...ux.ibm.com>, Athira Rajeev <atrajeev@...ux.vnet.ibm.com>,
Masahiro Yamada <masahiroy@...nel.org>, Bibo Mao <maobibo@...ngson.cn>,
Huacai Chen <chenhuacai@...nel.org>, Kajol Jain <kjain@...ux.ibm.com>,
Atish Patra <atishp@...osinc.com>, Shenlin Liang <liangshenlin@...incomputing.com>,
Anup Patel <anup@...infault.org>, Oliver Upton <oliver.upton@...ux.dev>,
"Steinar H. Gunderson" <sesse@...gle.com>, "Dr. David Alan Gilbert" <linux@...blig.org>,
Chen Pei <cp0613@...ux.alibaba.com>, Dima Kogan <dima@...retsauce.net>,
Przemek Kitszel <przemyslaw.kitszel@...el.com>, "David S. Miller" <davem@...emloft.net>,
Alexander Lobakin <aleksander.lobakin@...el.com>, linux-kernel@...r.kernel.org,
linux-perf-users@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-csky@...r.kernel.org, linux-riscv@...ts.infradead.org
Subject: [PATCH v3 08/11] 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 <irogers@...gle.com>
---
tools/build/feature/test-libdw.c | 10 +++++++++-
tools/perf/util/probe-finder.c | 2 --
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 d6b902899940..b6775d3bdeac 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 */
--
2.47.0.105.g07ac214952-goog
Powered by blists - more mailing lists