]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf test: Fixes for check branch stack sampling
authorIan Rogers <irogers@google.com>
Thu, 9 Apr 2026 00:02:16 +0000 (17:02 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Tue, 14 Apr 2026 06:37:59 +0000 (23:37 -0700)
commit86d1095fdb7017a93e9d7be875775f7e5aa5c2f5
tree2df4a4bcbb5621ce4a4a77beace8480f8ed16e26
parentc7fe4e5665b7c31a24d362229182f6ee27e07233
perf test: Fixes for check branch stack sampling

When filtering branch stack samples on user events they sample in user
land but may have come from the kernel. Aarch64 avoids leaking the
kernel address for kaslr reasons but other platforms, for now,
don't. Be more permissive in allowing kernel addresses in the source
of user branch stacks.

When filtering branch stack samples on kernel events they sample in
kernel land but may have come from user land. Avoid the target being a
user address but allow the source to be in user land. Aarch64 may not
leak the user land addresses (making them 0) but other platforms
do. As the kernel address sampling implies privelege, just allow this.

Increase the duration of the system call sampling test to make the
likelihood of sampling a system call higher (increased from 1000 to
8000 loops - a number found through experimentation on an Intel
Tigerlake laptop), also make the period of the event a prime number.

Put unneeded perf record output into a temporary file so that the test
output isn't cluttered. More clearly state which test is running and
the pass, fail or skipped result of the test.

These changes make the test on an Intel tigerlake laptop reliably pass
rather than reliably fail.

Signed-off-by: Ian Rogers <irogers@google.com>
Reviewed-by: James Clark <james.clark@linaro.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/tests/shell/test_brstack.sh