[PATCH 3/6] perf test attr: Fix record dwarf sample_type expectation

From: Arnaldo Carvalho de Melo

Date: Tue Oct 06 2026 - 12:14:08 EST


From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>

Since bdd051e249141c79 ("perf record: Split --data-mmap option"),
record_opts__parse_callchain() sets record_data_mmap instead of
record->sample_address for the DWARF unwind mode, so -d/--data and its
implied PERF_SAMPLE_DATA_SRC are not enabled implicitly anymore.

As a result, --call-graph dwarf no longer sets PERF_SAMPLE_ADDR and
PERF_SAMPLE_DATA_SRC, making the test fail:

expected sample_type=45359, got 12583

where 45359 (0xb12f) is:

IP|TID|TIME|ADDR|CALLCHAIN|PERIOD|REGS_USER|STACK_USER|DATA_SRC

and 12583 (0x3127) is:

IP|TID|TIME|CALLCHAIN|PERIOD|REGS_USER|STACK_USER

i.e. the values differ exactly by PERF_SAMPLE_ADDR (0x8) and
PERF_SAMPLE_DATA_SRC (0x8000). The mmap_data=1 expectation is still
correct as DWARF now enables record_data_mmap.

This went unnoticed because tests/attr.sh ignored attr.py's return
value until 04a0a19ede01e771 ("perf test attr: Propagate the return
value from the test to the wrapper").

Fixes: bdd051e249141c79 ("perf record: Split --data-mmap option")
Assisted-by: LLM
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/tests/shell/attr/test-record-graph-dwarf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/shell/attr/test-record-graph-dwarf b/tools/perf/tests/shell/attr/test-record-graph-dwarf
index ae92061d611ded68..fbe0faa8cdb6a8f4 100644
--- a/tools/perf/tests/shell/attr/test-record-graph-dwarf
+++ b/tools/perf/tests/shell/attr/test-record-graph-dwarf
@@ -4,7 +4,7 @@ args = --no-bpf-event --call-graph dwarf -- kill >/dev/null 2>&1
ret = 1

[event:base-record]
-sample_type=45359
+sample_type=12583
exclude_callchain_user=1
sample_stack_user=8192
# TODO different for each arch, no support for that now
--
2.55.0