* [PATCH 0/4] perf tools: LLVM dwarf and flaky test fixes
@ 2026-11-05 15:49 James Clark
2026-11-05 15:49 ` [PATCH 1/4] perf libdw: Find the CU by iterating all CUs when aranges are missing James Clark
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: James Clark @ 2026-11-05 15:49 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Ian Rogers, Adrian Hunter, Jakub Brnak, Leo Yan
Cc: Arnaldo Carvalho de Melo, linux-perf-users, linux-kernel, James Clark
Running the tests on an LLVM build results in some dwarf issues that
need fixing. And there is an easy fix for some flakiness caused when
tests are run in parallel.
Assisted by Claude Opus 5.5
Signed-off-by: James Clark <james.clark@linaro.org>
---
James Clark (4):
perf libdw: Find the CU by iterating all CUs when aranges are missing
perf dwarf-aux: Support DW_OP_addrx locations for global variables
perf test probe_vfs_getname: Fix missing debuginfo detection
perf test: Don't starve per-process tests with system-wide events
tools/perf/tests/shell/lib/probe_vfs_getname.sh | 3 +-
tools/perf/tests/shell/record.sh | 6 +--
tools/perf/tests/shell/record_lbr.sh | 2 +-
tools/perf/tests/shell/record_sideband.sh | 4 +-
tools/perf/util/annotate-data.c | 27 +---------
tools/perf/util/dwarf-aux.c | 70 ++++++++++++++++++++++---
tools/perf/util/dwarf-aux.h | 3 ++
tools/perf/util/libdw.c | 19 +++----
8 files changed, 86 insertions(+), 48 deletions(-)
---
base-commit: 29fd95dbd25cda35ac1e38d096a85809e952274b
change-id: 20261104-james-perf-test-fixes-f72265531d1a
Best regards,
--
James Clark <james.clark@linaro.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/4] perf libdw: Find the CU by iterating all CUs when aranges are missing
2026-11-05 15:49 [PATCH 0/4] perf tools: LLVM dwarf and flaky test fixes James Clark
@ 2026-11-05 15:49 ` James Clark
2026-11-05 15:49 ` [PATCH 2/4] perf dwarf-aux: Support DW_OP_addrx locations for global variables James Clark
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: James Clark @ 2026-11-05 15:49 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Ian Rogers, Adrian Hunter, Jakub Brnak, Leo Yan
Cc: Arnaldo Carvalho de Melo, linux-perf-users, linux-kernel, James Clark
libdw__addr2line() finds the CU with dwfl_module_getsrc() and
dwfl_module_addrdie(), which use dwarf_getaranges(). In elfutils 0.190
this only reads .debug_aranges, which can be partial. For example, when
Perf is built with LLVM=1, clang doesn't emit .debug_aranges by default
so the lookup then fails and no source lines are found for most of the
Perf binary.
This used to be hidden by falling back to the next addr2line style, but
now missing information stops the fallback since commit (62d7cdc8d587
"perf libdw: Optimize fallback logic for missing DWARF").
find_cu_die() in annotate-data.c already handles partial aranges by
iterating all CUs in .debug_info and checking them with dwarf_haspc().
Move it to dwarf-aux.c, then look up the line in that CU with
dwarf_getsrc_die() and use the same CU for unwinding inlines. While
moving it, don't treat a dwarf_haspc() error as a match.
This fixes the "test addr2line inline unwinding" test when Perf is built
with LLVM:
$ perf test -vvv "test addr2line inline unwinding"
...
Inline unwinding fp verification test [Failed missing inlined functions]
...
Inline unwinding dwarf verification test [Failed missing inlined functions]
...
Inline unwinding lbr verification test [Failed missing inlined functions]
---- end(-1) ----
79: test addr2line inline unwinding : FAILED!
Fixes: 88c51002d06f ("perf addr2line: Add a libdw implementation")
Signed-off-by: James Clark <james.clark@linaro.org>
---
tools/perf/util/annotate-data.c | 27 +--------------------------
tools/perf/util/dwarf-aux.c | 37 +++++++++++++++++++++++++++++++++++++
tools/perf/util/dwarf-aux.h | 3 +++
tools/perf/util/libdw.c | 19 ++++++++++---------
4 files changed, 51 insertions(+), 35 deletions(-)
diff --git a/tools/perf/util/annotate-data.c b/tools/perf/util/annotate-data.c
index 25e3169ea8ad..8092ef9d2045 100644
--- a/tools/perf/util/annotate-data.c
+++ b/tools/perf/util/annotate-data.c
@@ -523,31 +523,6 @@ static struct annotated_data_type *dso__findnew_data_type(struct dso *dso,
return result;
}
-static bool find_cu_die(struct debuginfo *di, u64 pc, Dwarf_Die *cu_die)
-{
- Dwarf_Off off, next_off;
- size_t header_size;
-
- if (dwarf_addrdie(di->dbg, pc, cu_die) != NULL)
- return cu_die;
-
- /*
- * There are some kernels don't have full aranges and contain only a few
- * aranges entries. Fallback to iterate all CU entries in .debug_info
- * in case it's missing.
- */
- off = 0;
- while (dwarf_nextcu(di->dbg, off, &next_off, &header_size,
- NULL, NULL, NULL) == 0) {
- if (dwarf_offdie(di->dbg, off + header_size, cu_die) &&
- dwarf_haspc(cu_die, pc))
- return true;
-
- off = next_off;
- }
- return false;
-}
-
enum type_match_result {
PERF_TMR_UNKNOWN = 0,
PERF_TMR_OK,
@@ -1827,7 +1802,7 @@ static int find_data_type_die(struct data_loc_info *dloc, Dwarf_Die *type_die)
pc = map__rip_2objdump(dloc->ms->map, dloc->ip);
/* Get a compile_unit for this address */
- if (!find_cu_die(dloc->di, pc, &cu_die)) {
+ if (!cu_find_by_addr(dloc->di->dbg, pc, &cu_die)) {
pr_debug_dtp("cannot find CU for address %"PRIx64"\n", pc);
ann_data_stat.no_cuinfo++;
return -1;
diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c
index 54f8b5ec74a2..742fccba5376 100644
--- a/tools/perf/util/dwarf-aux.c
+++ b/tools/perf/util/dwarf-aux.c
@@ -106,6 +106,43 @@ static Dwarf_Line *cu_getsrc_die(Dwarf_Die *cu_die, Dwarf_Addr addr)
return line;
}
+/**
+ * cu_find_by_addr - Find the CU DIE that contains an address
+ * @dbg: a Dwarf handle
+ * @addr: An address
+ * @cu_die: a buffer to store the found CU DIE
+ *
+ * Find the CU DIE whose ranges contain @addr. dwarf_addrdie() uses
+ * dwarf_getaranges() which didn't work until elfutils 0.191. Release notes:
+ *
+ * * NEWS *
+ * libdw: dwarf_addrdie now supports binaries lacking a .debug_aranges
+ * section.
+ *
+ * Clang doesn't emit them by default, so fall back to iterating all CUs in
+ * case it's missing.
+ *
+ * Return @cu_die if found, otherwise NULL.
+ */
+Dwarf_Die *cu_find_by_addr(Dwarf *dbg, Dwarf_Addr addr, Dwarf_Die *cu_die)
+{
+ Dwarf_Off off = 0, next_off;
+ size_t header_size;
+
+ if (dwarf_addrdie(dbg, addr, cu_die) && dwarf_haspc(cu_die, addr) == 1)
+ return cu_die;
+
+ while (dwarf_nextcu(dbg, off, &next_off, &header_size,
+ NULL, NULL, NULL) == 0) {
+ if (dwarf_offdie(dbg, off + header_size, cu_die) &&
+ dwarf_haspc(cu_die, addr) == 1)
+ return cu_die;
+
+ off = next_off;
+ }
+ return NULL;
+}
+
/**
* cu_find_lineinfo - Get a line number and file name for given address
* @cu_die: a CU DIE
diff --git a/tools/perf/util/dwarf-aux.h b/tools/perf/util/dwarf-aux.h
index 6f9145510adc..cc3fd61374c4 100644
--- a/tools/perf/util/dwarf-aux.h
+++ b/tools/perf/util/dwarf-aux.h
@@ -23,6 +23,9 @@ const char *cu_find_realpath(Dwarf_Die *cu_die, const char *fname);
/* Get DW_AT_comp_dir (should be NULL with older gcc) */
const char *cu_get_comp_dir(Dwarf_Die *cu_die);
+/* Find the CU DIE that contains the given address */
+Dwarf_Die *cu_find_by_addr(Dwarf *dbg, Dwarf_Addr addr, Dwarf_Die *cu_die);
+
/* Get a line number and file name for given address */
int cu_find_lineinfo(Dwarf_Die *cudie, Dwarf_Addr addr,
const char **fname, int *lineno);
diff --git a/tools/perf/util/libdw.c b/tools/perf/util/libdw.c
index e660623338d5..90767361f485 100644
--- a/tools/perf/util/libdw.c
+++ b/tools/perf/util/libdw.c
@@ -170,7 +170,9 @@ int libdw__addr2line(u64 addr, char **file, unsigned int *line_nr,
{
Dwfl *dwfl;
Dwfl_Module *mod;
- Dwfl_Line *dwline;
+ Dwarf_Line *dwline;
+ Dwarf_Die cu_mem, *cudie;
+ Dwarf *dw;
Dwarf_Addr bias;
const char *src;
int lineno = 0;
@@ -197,7 +199,8 @@ int libdw__addr2line(u64 addr, char **file, unsigned int *line_nr,
* between the regular ELF addr2line addresses and those to use with
* libdw.
*/
- if (!dwfl_module_getdwarf(mod, &bias)) {
+ dw = dwfl_module_getdwarf(mod, &bias);
+ if (!dw) {
/*
* Free the Dwfl session so the mmap'd ELF binary is unmapped
* immediately, and mark the DSO as lacking srcline/DWARF info
@@ -211,7 +214,8 @@ int libdw__addr2line(u64 addr, char **file, unsigned int *line_nr,
}
/* Find source line information for the address. */
- dwline = dwfl_module_getsrc(mod, addr + bias);
+ cudie = cu_find_by_addr(dw, addr, &cu_mem);
+ dwline = cudie ? dwarf_getsrc_die(cudie, addr) : NULL;
if (!dwline) {
/* conclusively missing information -> abort fallbacks */
ret = 0;
@@ -219,8 +223,8 @@ int libdw__addr2line(u64 addr, char **file, unsigned int *line_nr,
}
/* Get line information. */
- src = dwfl_lineinfo(dwline, /*addr=*/NULL, &lineno, /*col=*/NULL, /*mtime=*/NULL,
- /*length=*/NULL);
+ src = dwarf_linesrc(dwline, /*mtime=*/NULL, /*length=*/NULL);
+ dwarf_lineno(dwline, &lineno);
if (file)
*file = src ? strdup(src) : NULL;
@@ -229,8 +233,6 @@ int libdw__addr2line(u64 addr, char **file, unsigned int *line_nr,
/* Optionally unwind inline function call chain. */
if (unwind_inlines && node) {
- Dwarf_Addr unused_bias;
- Dwarf_Die *cudie = dwfl_module_addrdie(mod, addr + bias, &unused_bias);
struct libdw_a2l_cb_args args = {
.dso = dso,
.sym = sym,
@@ -248,8 +250,7 @@ int libdw__addr2line(u64 addr, char **file, unsigned int *line_nr,
}
/* Walk from the parent down to the leaf. */
- if (cudie)
- cu_walk_functions_at(cudie, addr, libdw_a2l_cb, &args);
+ cu_walk_functions_at(cudie, addr, libdw_a2l_cb, &args);
if (!args.leaf_srcline_used)
free(args.leaf_srcline);
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/4] perf dwarf-aux: Support DW_OP_addrx locations for global variables
2026-11-05 15:49 [PATCH 0/4] perf tools: LLVM dwarf and flaky test fixes James Clark
2026-11-05 15:49 ` [PATCH 1/4] perf libdw: Find the CU by iterating all CUs when aranges are missing James Clark
@ 2026-11-05 15:49 ` James Clark
2026-11-05 15:49 ` [PATCH 3/4] perf test probe_vfs_getname: Fix missing debuginfo detection James Clark
2026-11-05 15:49 ` [PATCH 4/4] perf test: Don't starve per-process tests with system-wide events James Clark
3 siblings, 0 replies; 5+ messages in thread
From: James Clark @ 2026-11-05 15:49 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Ian Rogers, Adrian Hunter, Jakub Brnak, Leo Yan
Cc: Arnaldo Carvalho de Melo, linux-perf-users, linux-kernel, James Clark
die_find_variable_by_addr() and die_collect_global_vars() only accept
global variables with a DW_OP_addr location. DWARF 5 producers like
clang use DW_OP_addrx instead, which is an index into .debug_addr, so
global variables are never found when Perf is built with LLVM=1.
Add a helper that also resolves DW_OP_addrx and DW_OP_GNU_addr_index
through dwarf_getlocation_attr() and dwarf_formaddr(), and use it in
both places. This fixes the "perf data type profiling tests" test:
$ perf test -vvv "perf data type profiling tests"
...
Basic C perf annotate test
Basic annotate [Failed: missing target data type]
...
Pipe C perf annotate test
Pipe annotate [Failed: missing target data type]
...
Basic FS perf annotate test
Basic annotate [Failed: missing target data type]
...
Pipe FS perf annotate test
Pipe annotate [Failed: missing target data type]
---- end(-1) ----
88: perf data type profiling tests : FAILED!
Fixes: d60469d7c0e5 ("perf dwarf-aux: Add die_find_variable_by_addr()")
Signed-off-by: James Clark <james.clark@linaro.org>
---
tools/perf/util/dwarf-aux.c | 33 +++++++++++++++++++++++++++------
1 file changed, 27 insertions(+), 6 deletions(-)
diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c
index 742fccba5376..2f0c4b229659 100644
--- a/tools/perf/util/dwarf-aux.c
+++ b/tools/perf/util/dwarf-aux.c
@@ -1658,6 +1658,27 @@ Dwarf_Die *die_find_variable_by_reg(Dwarf_Die *sc_die, Dwarf_Addr pc, int reg,
return result;
}
+/*
+ * Get the absolute address of a location op. DWARF 5 producers like clang use
+ * DW_OP_addrx, which is an index into .debug_addr, instead of DW_OP_addr.
+ */
+static bool die_get_op_addr(Dwarf_Attribute *attr, Dwarf_Op *op, Dwarf_Addr *addr)
+{
+ Dwarf_Attribute addr_attr;
+
+ switch (op->atom) {
+ case DW_OP_addr:
+ *addr = op->number;
+ return true;
+ case DW_OP_addrx:
+ case DW_OP_GNU_addr_index:
+ return dwarf_getlocation_attr(attr, op, &addr_attr) == 0 &&
+ dwarf_formaddr(&addr_attr, addr) == 0;
+ default:
+ return false;
+ }
+}
+
/* Only checks direct child DIEs in the given scope */
static int __die_find_var_addr_cb(Dwarf_Die *die_mem, void *arg)
{
@@ -1665,7 +1686,7 @@ static int __die_find_var_addr_cb(Dwarf_Die *die_mem, void *arg)
int tag = dwarf_tag(die_mem);
ptrdiff_t off = 0;
Dwarf_Attribute attr;
- Dwarf_Addr base, start, end;
+ Dwarf_Addr base, start, end, addr;
Dwarf_Op *ops;
size_t nops;
@@ -1676,11 +1697,11 @@ static int __die_find_var_addr_cb(Dwarf_Die *die_mem, void *arg)
return DIE_FIND_CB_SIBLING;
while ((off = dwarf_getlocations(&attr, off, &base, &start, &end, &ops, &nops)) > 0) {
- if (ops->atom != DW_OP_addr)
+ if (!die_get_op_addr(&attr, ops, &addr))
continue;
if (check_allowed_ops(ops, nops) &&
- match_var_offset(die_mem, data, data->addr, ops->number,
+ match_var_offset(die_mem, data, data->addr, addr,
/*is_pointer=*/false))
return DIE_FIND_CB_END;
}
@@ -1806,7 +1827,7 @@ static int __die_collect_global_vars_cb(Dwarf_Die *die_mem, void *arg)
Dwarf_Die type_die;
int tag = dwarf_tag(die_mem);
Dwarf_Attribute attr;
- Dwarf_Addr base, start, end;
+ Dwarf_Addr base, start, end, addr;
Dwarf_Op *ops;
size_t nops;
struct die_var_type *vt;
@@ -1821,7 +1842,7 @@ static int __die_collect_global_vars_cb(Dwarf_Die *die_mem, void *arg)
if (dwarf_getlocations(&attr, 0, &base, &start, &end, &ops, &nops) <= 0)
return DIE_FIND_CB_SIBLING;
- if (ops->atom != DW_OP_addr)
+ if (!die_get_op_addr(&attr, ops, &addr))
return DIE_FIND_CB_SIBLING;
if (!check_allowed_ops(ops, nops))
@@ -1837,7 +1858,7 @@ static int __die_collect_global_vars_cb(Dwarf_Die *die_mem, void *arg)
vt->die_off = dwarf_dieoffset(&type_die);
vt->die_tag = dwarf_tag(&type_die);
vt->from_alt = !die_same_file(die_mem, &type_die);
- vt->addr = ops->number;
+ vt->addr = addr;
vt->end = 0;
vt->has_range = false;
vt->reg = -1;
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 3/4] perf test probe_vfs_getname: Fix missing debuginfo detection
2026-11-05 15:49 [PATCH 0/4] perf tools: LLVM dwarf and flaky test fixes James Clark
2026-11-05 15:49 ` [PATCH 1/4] perf libdw: Find the CU by iterating all CUs when aranges are missing James Clark
2026-11-05 15:49 ` [PATCH 2/4] perf dwarf-aux: Support DW_OP_addrx locations for global variables James Clark
@ 2026-11-05 15:49 ` James Clark
2026-11-05 15:49 ` [PATCH 4/4] perf test: Don't starve per-process tests with system-wide events James Clark
3 siblings, 0 replies; 5+ messages in thread
From: James Clark @ 2026-11-05 15:49 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Ian Rogers, Adrian Hunter, Jakub Brnak, Leo Yan
Cc: Arnaldo Carvalho de Melo, linux-perf-users, linux-kernel, James Clark
skip_if_no_debuginfo() looks for the errors that 'perf probe' prints when
there is no debuginfo in the output of add_probe_vfs_getname(). But since
commit 92b664dcefab ("perf test probe_vfs_getname: Skip if no suitable
line detected"), add_probe_vfs_getname() returns early without adding a
probe if 'perf probe -L' doesn't find the line, which is also what
happens when there is no debuginfo. The error from 'perf probe -L' is
discarded, so the debuginfo errors are never found.
This causes the debuginfo dependent subtests of the
"perftool-testsuite_probe" test to fail instead of being skipped on
kernels without debuginfo, because test_adding_kernel.sh calls
skip_if_no_debuginfo() unconditionally. The other users only call it
when add_probe_vfs_getname() returns 1, so they aren't affected.
Fix it by doing a dry run of a probe that needs debuginfo instead. This
works without libdw too, where 'perf probe -L' isn't available, and also
avoids adding a real probe just to check for debuginfo. This fixes the
"perftool-testsuite_probe" test:
$ sudo perf test -vvv "perftool-testsuite_probe"
...
-- [ FAIL ] -- perf_probe :: test_adding_kernel :: listing added probe :: perf probe -l (output regexp parsing)
...
-- [ FAIL ] -- perf_probe :: test_adding_kernel :: wildcard adding support (command exitcode + output regexp parsing)
...
-- [ FAIL ] -- perf_probe :: test_adding_kernel :: non-existing variable (output regexp parsing)
...
## [ FAIL ] ## perf_probe :: test_adding_kernel SUMMARY :: 3 failures found
...
189: perftool-testsuite_probe : FAILED!
Fixes: 92b664dcefab ("perf test probe_vfs_getname: Skip if no suitable line detected")
Signed-off-by: James Clark <james.clark@linaro.org>
---
tools/perf/tests/shell/lib/probe_vfs_getname.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/perf/tests/shell/lib/probe_vfs_getname.sh b/tools/perf/tests/shell/lib/probe_vfs_getname.sh
index 57a59ae7d4ae..1c3af5771bcf 100644
--- a/tools/perf/tests/shell/lib/probe_vfs_getname.sh
+++ b/tools/perf/tests/shell/lib/probe_vfs_getname.sh
@@ -64,7 +64,8 @@ add_probe_vfs_getname() {
}
skip_if_no_debuginfo() {
- add_probe_vfs_getname -v 2>&1 | grep -E -q "^(Failed to find the path for the kernel|Debuginfo-analysis is not supported)|(file has no debug information)" && return 2
+ # Dry run a probe that needs debuginfo.
+ perf probe -n -v 'getname_flags $params' 2>&1 | grep -E -q "^(Failed to find the path for the kernel|Debuginfo-analysis is not supported)|(file has no debug information)" && return 2
return 1
}
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 4/4] perf test: Don't starve per-process tests with system-wide events
2026-11-05 15:49 [PATCH 0/4] perf tools: LLVM dwarf and flaky test fixes James Clark
` (2 preceding siblings ...)
2026-11-05 15:49 ` [PATCH 3/4] perf test probe_vfs_getname: Fix missing debuginfo detection James Clark
@ 2026-11-05 15:49 ` James Clark
3 siblings, 0 replies; 5+ messages in thread
From: James Clark @ 2026-11-05 15:49 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Ian Rogers, Adrian Hunter, Jakub Brnak, Leo Yan
Cc: Arnaldo Carvalho de Melo, linux-perf-users, linux-kernel, James Clark
Some tests intermittently fail when run in parallel, for example "Check
branch stack sampling" fails with no branches recorded at all.
The default event is cycles:P which there may only be 1 or 2 HW counters
for on Intel because it's precise. System wide or per-core precise
events hog the HW counter leaving other per-process tests with no
samples. Rather than make all the tests that use default record commands
run serially, just make the system wide ones use a non-precise event.
They don't need precise sampling anyway, so use plain cycles which can
go on any counter. The per-process tests can be left alone as their
events/processes never run concurrently on any one core.
The LBR filter is another resource shared by all events on a CPU, and
the system-wide LBR test uses different filters to the per-process
branch stack test, so mark the LBR test as exclusive.
This fixes the "Check branch stack sampling" test and other flakes when
a system-wide record from another test runs at the same time, for
example:
$ sudo perf record -a -o /dev/null -- sleep 30 &
$ sudo perf test -vvv "Check branch stack sampling"
...
Testing user branch stack sampling
ERROR: Branches missing ^brstack_bench\+[^ ]*/brstack_foo\+[^ ]*/IND_CALL/.*$
...
Testing user branch stack sampling [Failed]
...
Testing branch stack filtering permutation (call,CALL|SYSCALL)
Testing branch stack filtering [Failed empty script output]
...
---- end(-1) ----
138: Check branch stack sampling : FAILED!
Signed-off-by: James Clark <james.clark@linaro.org>
---
tools/perf/tests/shell/record.sh | 6 +++---
tools/perf/tests/shell/record_lbr.sh | 2 +-
tools/perf/tests/shell/record_sideband.sh | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/perf/tests/shell/record.sh b/tools/perf/tests/shell/record.sh
index 01dc3e22fa73..5292eff78a70 100755
--- a/tools/perf/tests/shell/record.sh
+++ b/tools/perf/tests/shell/record.sh
@@ -388,7 +388,7 @@ test_system_wide() {
echo "Basic --system-wide mode test"
local ret=0
perf_record_with_retry "${perfdata}" "check_system_wide" "perf test -w thloop" \
- -aB --synth=no || ret=$?
+ -aB --synth=no -e cycles || ret=$?
if [ $ret -eq 2 ]; then
echo "System-wide record [Skipped not supported]"
return
@@ -471,7 +471,7 @@ test_cgroup() {
echo "Cgroup sampling test"
local ret=0
perf_record_with_retry "${perfdata}" "check_cgroup" "perf test -w thloop" \
- -aB --synth=cgroup --all-cgroups || ret=$?
+ -aB --synth=cgroup --all-cgroups -e cycles || ret=$?
if [ $ret -eq 2 ]; then
echo "Cgroup sampling [Skipped not supported]"
return
@@ -491,7 +491,7 @@ test_uid() {
echo "Uid sampling test"
local ret=0
perf_record_with_retry "${perfdata}" "check_uid" "perf test -w thloop" \
- -aB --synth=no --uid "$(id -u)" || ret=$?
+ -aB --synth=no --uid "$(id -u)" -e cycles || ret=$?
if [ $ret -eq 2 ]; then
local logfile="${PERF_RECORD_LOGS[${#PERF_RECORD_LOGS[@]}-1]}"
if grep -q -E "libbpf.*EPERM|Access to performance monitoring" "$logfile" || \
diff --git a/tools/perf/tests/shell/record_lbr.sh b/tools/perf/tests/shell/record_lbr.sh
index 8d51afeb437b..6b6af59db871 100755
--- a/tools/perf/tests/shell/record_lbr.sh
+++ b/tools/perf/tests/shell/record_lbr.sh
@@ -1,6 +1,6 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
-# perf record LBR tests
+# perf record LBR tests (exclusive)
set -e
diff --git a/tools/perf/tests/shell/record_sideband.sh b/tools/perf/tests/shell/record_sideband.sh
index 2182551873be..31ec2f5cde69 100755
--- a/tools/perf/tests/shell/record_sideband.sh
+++ b/tools/perf/tests/shell/record_sideband.sh
@@ -22,7 +22,7 @@ trap trap_cleanup EXIT TERM INT
can_cpu_wide()
{
- if ! perf record -o ${perfdata} -BN --no-bpf-event -C $1 true > /dev/null 2>&1
+ if ! perf record -o ${perfdata} -BN --no-bpf-event -e cycles -C $1 true > /dev/null 2>&1
then
echo "record sideband test [Skipped cannot record cpu$1]"
err=2
@@ -39,7 +39,7 @@ test_system_wide_tracking()
can_cpu_wide 1 || return 0
# Record on CPU 0 a task running on CPU 1
- perf record -BN --no-bpf-event -o ${perfdata} -C 0 -- taskset --cpu-list 1 true
+ perf record -BN --no-bpf-event -e cycles -o ${perfdata} -C 0 -- taskset --cpu-list 1 true
# Should get MMAP events from CPU 1
mmap_cnt=`perf script -i ${perfdata} --show-mmap-events -C 1 2>/dev/null | grep MMAP | wc -l`
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-11-05 15:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-05 15:49 [PATCH 0/4] perf tools: LLVM dwarf and flaky test fixes James Clark
2026-11-05 15:49 ` [PATCH 1/4] perf libdw: Find the CU by iterating all CUs when aranges are missing James Clark
2026-11-05 15:49 ` [PATCH 2/4] perf dwarf-aux: Support DW_OP_addrx locations for global variables James Clark
2026-11-05 15:49 ` [PATCH 3/4] perf test probe_vfs_getname: Fix missing debuginfo detection James Clark
2026-11-05 15:49 ` [PATCH 4/4] perf test: Don't starve per-process tests with system-wide events James Clark
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®