[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <804ac0d6-22f7-40c3-9ff5-e5f9d863d37e@amd.com>
Date: Tue, 20 May 2025 16:31:29 +0530
From: Ravi Bangoria <ravi.bangoria@....com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Namhyung Kim <namhyung@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>, Ian Rogers <irogers@...gle.com>,
James Clark <james.clark@...aro.org>, Jiri Olsa <jolsa@...nel.org>,
Kan Liang <kan.liang@...ux.intel.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"linux-perf-users@...r.kernel.org" <linux-perf-users@...r.kernel.org>,
Ravi Bangoria <ravi.bangoria@....com>
Subject: Re: IBS perf test failures on 9950x3d
Hi Arnaldo,
> Telling that to the user and possibly skipping the test if viable using
> uname to get the version and if less than v6.15-rc1 print "Skip (needs
> v6.15-rc1 or newer)" may be an option.
>
> Then if the bug somehow reappears, people running 'perf test' will flag
> it.
Sure. Attaching a patch at the end.
> And I think having it in 'perf test' as well may make the feature to be
> tested more widely, both by those who run selftests as well as by people
> trying just 'perf test'.
Yeah, that was precisely the reason I did it in 'perf test'.
Thanks,
Ravi
---
>From fb8c9f77231a9361a5055c45e75aed3d2414f685 Mon Sep 17 00:00:00 2001
From: Ravi Bangoria <ravi.bangoria@....com>
Date: Tue, 20 May 2025 05:32:48 +0000
Subject: [PATCH] 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.
Link: https://lore.kernel.org/r/20250115054438.1021-1-ravi.bangoria@amd.com [1]
Reported-by: Arnaldo Carvalho de Melo <acme@...nel.org>
Closes: https://lore.kernel.org/r/aCfuGXUnNIbnYo_r@x1
Suggested-by: Arnaldo Carvalho de Melo <acme@...nel.org>
Signed-off-by: Ravi Bangoria <ravi.bangoria@....com>
---
tools/perf/arch/x86/tests/amd-ibs-period.c | 29 ++++++++++++++++++++++
1 file changed, 29 insertions(+)
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 @@ static unsigned int get_perf_event_max_sample_rate(void)
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))
--
2.43.0
Powered by blists - more mailing lists