[PATCH i-g-t v1] tests/intel/xe_pmu: Skip tests involving engine activity on vm
Kolakowski, Jakub1
jakub1.kolakowski at intel.com
Wed Jul 30 14:41:08 UTC 2025
Hi Soham,
I see that change is generic and does not just work on VM but in all cases where feature isn't supported. I think commit title should not mention VM, it could be e.g. " tests/intel/xe_pmu: Skip test if engine activity feature not present" or something along those lines.
Jakub
-----Original Message-----
From: igt-dev <igt-dev-bounces at lists.freedesktop.org> On Behalf Of Soham Purkait
Sent: Tuesday, July 29, 2025 12:14 PM
To: igt-dev at lists.freedesktop.org; Tauro, Riana <riana.tauro at intel.com>
Cc: Gupta, Anshuman <anshuman.gupta at intel.com>; De Marchi, Lucas <lucas.demarchi at intel.com>; Purkait, Soham <soham.purkait at intel.com>
Subject: [PATCH i-g-t v1] tests/intel/xe_pmu: Skip tests involving engine activity on vm
Skip the tests and subtests involving the engine activity if the engine-active-ticks event is not present for the respective device.
v1:
- Add a variable has_engine_active_ticks to check for the
existence of engine-active-ticks event. (Riana)
Signed-off-by: Soham Purkait <soham.purkait at intel.com>
---
tests/intel/xe_pmu.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/tests/intel/xe_pmu.c b/tests/intel/xe_pmu.c index 0e5a7360f..b0bd235e6 100644
--- a/tests/intel/xe_pmu.c
+++ b/tests/intel/xe_pmu.c
@@ -106,6 +106,7 @@ const double tolerance = 0.1; static char xe_device[NAME_MAX]; static bool autoprobe; static int total_exec_quantum;
+static bool has_engine_active_ticks;
#define test_each_engine(test, fd, hwe) \
igt_subtest_with_dynamic(test) \
@@ -113,6 +114,17 @@ static int total_exec_quantum;
igt_dynamic_f("engine-%s%d", xe_engine_class_string(hwe->engine_class), \
hwe->engine_instance)
+static bool _has_engine_active_ticks(const char *device) {
+ char buf[512];
+
+ snprintf(buf, sizeof(buf),
+ "/sys/bus/event_source/devices/%s/events/%s",
+ device,
+ "engine-active-ticks");
+ return (!!access(buf, F_OK));
+}
+
static int open_pmu(int xe, uint64_t config) {
int fd;
@@ -191,6 +203,8 @@ static uint64_t get_event_config(unsigned int gt, struct drm_xe_engine_class_ins
uint64_t pmu_config = 0;
int ret;
+ igt_skip_on(has_engine_active_ticks);
+
ret = perf_event_config(xe_device, event, &pmu_config);
igt_assert(ret >= 0);
pmu_config |= add_format_config("gt", gt); @@ -907,6 +921,7 @@ igt_main
fd = drm_open_driver(DRIVER_XE);
xe_perf_device(fd, xe_device, sizeof(xe_device));
num_engines = xe_number_engines(fd);
+ has_engine_active_ticks = _has_engine_active_ticks(xe_device);
}
igt_describe("Validate PMU gt-c6 residency counters when idle");
--
2.34.1
More information about the igt-dev
mailing list