]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests/bpf: skip test_perf_branches_hw() on unsupported platforms
authorMatt Bobrowski <mattbobrowski@google.com>
Thu, 20 Nov 2025 14:20:59 +0000 (14:20 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:09:32 +0000 (13:09 +0100)
commit1d2e267f4331b7d8b9ad410934fbc0e55f0d4517
tree355d3b36b1f2fc9f747464e57088c14125dc835e
parent90bb940f1c2f8d7401af3152015fd5b5c365bd67
selftests/bpf: skip test_perf_branches_hw() on unsupported platforms

[ Upstream commit 27746aaf1b20172f0859546c4a3e82eca459f680 ]

Gracefully skip the test_perf_branches_hw subtest on platforms that
do not support LBR or require specialized perf event attributes
to enable branch sampling.

For example, AMD's Milan (Zen 3) supports BRS rather than traditional
LBR. This requires specific configurations (attr.type = PERF_TYPE_RAW,
attr.config = RETIRED_TAKEN_BRANCH_INSTRUCTIONS) that differ from the
generic setup used within this test. Notably, it also probably doesn't
hold much value to special case perf event configurations for selected
micro architectures.

Fixes: 67306f84ca78c ("selftests/bpf: Add bpf_read_branch_records() selftest")
Signed-off-by: Matt Bobrowski <mattbobrowski@google.com>
Acked-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20251120142059.2836181-1-mattbobrowski@google.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/bpf/prog_tests/perf_branches.c