aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorRavi Bangoria <ravi.bangoria@amd.com>2025-05-20 05:32:48 +0000
committerArnaldo Carvalho de Melo <acme@redhat.com>2025-05-21 15:07:13 -0300
commit21fb366b2f45761125230e89a73c0fe29d55d9cf (patch)
treed388ce1319c49d11139e1eb22470ea891786a32c /tools/perf
parentperf thread: Ensure comm_lock held for comm_list (diff)
downloadlinux-rng-21fb366b2f45761125230e89a73c0fe29d55d9cf.tar.xz
linux-rng-21fb366b2f45761125230e89a73c0fe29d55d9cf.zip
perf test amd: Skip amd-ibs-period test on kernel < v6.15
Bunch of IBS kernel fixes went in v6.15-rc1 [1]. The amd-ibs-period test will fail without those kernel patches. Skip the test on system running kernel older than v6.15 to distinguish genuine new failures vs known failure due to old kernel. Since all the related IBS fixes went in -rc1 itself, the ">= 6.15" check will work for any custom compiled v6.15-* kernel as well. Reported-by: Arnaldo Carvalho de Melo <acme@kernel.org> Suggested-by: Arnaldo Carvalho de Melo <acme@kernel.org> Signed-off-by: Ravi Bangoria <ravi.bangoria@amd.com> Closes: https://lore.kernel.org/r/aCfuGXUnNIbnYo_r@x1 Link: https://lore.kernel.org/r/20250115054438.1021-1-ravi.bangoria@amd.com [1] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/arch/x86/tests/amd-ibs-period.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/perf/arch/x86/tests/amd-ibs-period.c b/tools/perf/arch/x86/tests/amd-ibs-period.c
index 7c77d86f369d..223e059e04de 100644
--- a/tools/perf/arch/x86/tests/amd-ibs-period.c
+++ b/tools/perf/arch/x86/tests/amd-ibs-period.c
@@ -3,6 +3,7 @@
#include <sys/syscall.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
+#include <sys/utsname.h>
#include <string.h>
#include "arch-tests.h"
@@ -912,6 +913,29 @@ out:
return max_sample_rate;
}
+/*
+ * Bunch of IBS sample period fixes that this test exercise went in v6.15.
+ * Skip the test on older kernels to distinguish between test failure due
+ * to a new bug vs known failure due to older kernel.
+ */
+static bool kernel_v6_15_or_newer(void)
+{
+ struct utsname utsname;
+ char *endptr = NULL;
+ long major, minor;
+
+ if (uname(&utsname) < 0) {
+ pr_debug("uname() failed. [%m]");
+ return false;
+ }
+
+ major = strtol(utsname.release, &endptr, 10);
+ endptr++;
+ minor = strtol(endptr, NULL, 10);
+
+ return major >= 6 && minor >= 15;
+}
+
int test__amd_ibs_period(struct test_suite *test __maybe_unused,
int subtest __maybe_unused)
{
@@ -931,6 +955,11 @@ int test__amd_ibs_period(struct test_suite *test __maybe_unused,
if (!x86__is_amd_cpu() || !fetch_pmu || !op_pmu)
return TEST_SKIP;
+ if (!kernel_v6_15_or_newer()) {
+ pr_debug("Need v6.15 or newer kernel. Skipping.\n");
+ return TEST_SKIP;
+ }
+
perf_exe(perf, sizeof(perf));
if (sched_affine(0))