[PATCH i-g-t] tests/intel/xe_pmu: Skip tests involving engine activity on vm
Riana Tauro
riana.tauro at intel.com
Tue Jul 15 10:44:07 UTC 2025
Hi Soham
On 7/15/2025 12:30 PM, Soham Purkait wrote:
> Skip the tests and subtests involving the engine activity on vm
> as engine activity events are not present on vm.
>
> Signed-off-by: Soham Purkait <soham.purkait at intel.com>
> ---
> tests/intel/xe_pmu.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/tests/intel/xe_pmu.c b/tests/intel/xe_pmu.c
> index 0e5a7360f..9ac9d38cf 100644
> --- a/tests/intel/xe_pmu.c
> +++ b/tests/intel/xe_pmu.c
> @@ -113,6 +113,17 @@ static int total_exec_quantum;
> igt_dynamic_f("engine-%s%d", xe_engine_class_string(hwe->engine_class), \
> hwe->engine_instance)
>
> +static bool igt_is_running_on_vm(const char *device)
No the absence of the file is not the indication that it is running
on vm. This can be caused if guc version is lesser or any other reason.
Function needs to be renamed
> +{
> + 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 +202,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(igt_is_running_on_vm(xe_device));
> +
> ret = perf_event_config(xe_device, event, &pmu_config);
> igt_assert(ret >= 0);
Is it not possible to modify existing igt_assert to igt_require?
If not, create a variable has_engine_active_ticks and check for
existence of file and check for each test. But i think we should be able
to use existing code to skip.
Thanks
Riana
> pmu_config |= add_format_config("gt", gt);
More information about the igt-dev
mailing list