The CoreSight callchain test traces both userspace and kernel execution and checks the callchain across a syscall.
Add --kcore to perf record to save the running kernel image alongside the trace data so perf script can use it to decode the kernel trace. If kcore is not available, the test will be skipped.
Add a Fixes tag so the change can be backported to stable kernels and improve the test reliability.
Fixes: ca0e19074bd6 ("perf test: Add Arm CoreSight callchain test") Reviewed-by: James Clark james.clark@linaro.org Signed-off-by: Leo Yan leo.yan@arm.com --- Changes in v2: - Add check /proc/kcore and skip test if absent.
Signed-off-by: Leo Yan leo.yan@arm.com --- tools/perf/tests/shell/coresight/callchain.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/perf/tests/shell/coresight/callchain.sh b/tools/perf/tests/shell/coresight/callchain.sh index 13cca7dc11184002e3ddc058c0d0ffa1c458c483..43ad90bc30345efdd40ba4649ceeb435a1781a4b 100755 --- a/tools/perf/tests/shell/coresight/callchain.sh +++ b/tools/perf/tests/shell/coresight/callchain.sh @@ -30,6 +30,11 @@ skip_if_system_is_not_ready() return 2 }
+ [ -e /proc/kcore ] || { + echo "[Skip] /proc/kcore is not available" >&2 + return 2 + } + return 0 }
@@ -43,7 +48,7 @@ record_trace()
mkfifo "$cf" "$af"
- perf record -o "$data" -e cs_etm// --per-thread -D -1 --control fifo:"$cf","$af" -- \ + perf record --kcore -o "$data" -e cs_etm// --per-thread -D -1 --control fifo:"$cf","$af" -- \ perf test --record-ctl fifo:"$cf","$af" -w callchain >/dev/null 2>&1 &&
# It is safe to use 'i3i' with a three-instruction interval, since the
--- base-commit: 0ae6fc78c5ce0dfd18d8712a50f0fd4602eff103 change-id: 20260928-perf_cs_etm_callchain_test_add_kcore-f96e891f91c5
Best regards,