Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Bernatowicz, Marcin" <marcin.bernatowicz@linux.intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: igt-dev@lists.freedesktop.org,
	Jakub Kolakowski <jakub1.kolakowski@intel.com>,
	Lukasz Laguna <lukasz.laguna@intel.com>,
	Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Subject: Re: [PATCH i-g-t 1/2] tests/intel/xe_drm_fdinfo: Group utilization tests and skip when no utilization data
Date: Thu, 6 Mar 2025 10:19:37 +0100	[thread overview]
Message-ID: <f78e21cc-d1f4-4974-92b8-b3d497a5c50f@linux.intel.com> (raw)
In-Reply-To: <ip3lgnjby4aeplweqxvtcjubj27hktvzciqvvu5r7u7vkzqs4n@y7uomewtoetr>



On 3/5/2025 6:08 PM, Lucas De Marchi wrote:
> On Tue, Mar 04, 2025 at 07:56:39PM +0100, Marcin Bernatowicz wrote:
>> Wrap all utilization-related subtests in an igt_subtest_group and add
>> a fixture that ensures utilization data is available before running
>> them.
>>
>> Link: https://lore.kernel.org/r/20250205191644.2550879-1- 
>> marcin.bernatowicz@linux.intel.com
>>
>> Signed-off-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
>> Cc: Jakub Kolakowski <jakub1.kolakowski@intel.com>
>> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
>> Cc: Lukasz Laguna <lukasz.laguna@intel.com>
>> Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
>> ---
>> tests/intel/xe_drm_fdinfo.c | 122 ++++++++++++++++++++----------------
>> 1 file changed, 67 insertions(+), 55 deletions(-)
>>
>> diff --git a/tests/intel/xe_drm_fdinfo.c b/tests/intel/xe_drm_fdinfo.c
>> index 7330b4330..d18fe10d8 100644
>> --- a/tests/intel/xe_drm_fdinfo.c
>> +++ b/tests/intel/xe_drm_fdinfo.c
>> @@ -735,10 +735,6 @@ igt_main
>>     igt_subtest("basic-mem")
>>         basic_memory(xe);
>>
>> -    igt_describe("Check if basic fdinfo content is present for engine 
>> utilization");
>> -    igt_subtest("basic-utilization")
>> -        basic_engine_utilization(xe);
>> -
>>     igt_describe("Create and compare total and resident memory 
>> consumption by client");
>>     igt_subtest("mem-total-resident")
>>         mem_total_resident(xe);
>> @@ -751,57 +747,73 @@ igt_main
>>     igt_subtest("mem-active")
>>         mem_active(xe, xe_engine(xe, 0));
>>
>> -    igt_subtest("utilization-single-idle")
>> -        xe_for_each_engine(xe, hwe)
>> -            utilization_single(xe, hwe, 0);
>> -
>> -    igt_subtest("utilization-single-full-load")
>> -        xe_for_each_engine(xe, hwe)
>> -            utilization_single(xe, hwe, TEST_BUSY | TEST_TRAILING_IDLE);
>> -
>> -    igt_subtest("utilization-single-full-load-isolation")
>> -        xe_for_each_engine(xe, hwe)
>> -            utilization_single(xe, hwe, TEST_BUSY | 
>> TEST_TRAILING_IDLE | TEST_ISOLATION);
>> -
>> -    igt_subtest("utilization-single-full-load-destroy-queue")
>> -        xe_for_each_engine(xe, hwe)
>> -            utilization_single_destroy_queue(xe, hwe);
>> -
>> -    igt_subtest("utilization-others-idle")
>> -        xe_for_each_engine(xe, hwe)
>> -            utilization_others_idle(xe, hwe);
>> -
>> -    igt_subtest("utilization-others-full-load")
>> -        xe_for_each_engine(xe, hwe)
>> -            utilization_others_full_load(xe, hwe);
>> -
>> -    igt_subtest("utilization-all-full-load")
>> -        utilization_all_full_load(xe);
>> -
>> -
>> -    for (const struct section *s = sections; s->name; s++) {
>> -        igt_subtest_f("%s-utilization-single-idle", s->name)
>> -            xe_for_each_gt(xe, gt)
>> -                xe_for_each_engine_class(class)
>> -                    utilization_multi(xe, gt, class, s->flags);
>> -
>> -        igt_subtest_f("%s-utilization-single-full-load", s->name)
>> -            xe_for_each_gt(xe, gt)
>> -                xe_for_each_engine_class(class)
>> -                    utilization_multi(xe, gt, class,
>> -                              s->flags |
>> -                              TEST_BUSY |
>> -                              TEST_TRAILING_IDLE);
>> -
>> -        igt_subtest_f("%s-utilization-single-full-load-isolation",
>> -                  s->name)
>> -            xe_for_each_gt(xe, gt)
>> -                xe_for_each_engine_class(class)
>> -                    utilization_multi(xe, gt, class,
>> -                              s->flags |
>> -                              TEST_BUSY |
>> -                              TEST_TRAILING_IDLE |
>> -                              TEST_ISOLATION);
>> +    igt_subtest_group {
>> +        igt_fixture {
>> +            struct drm_client_fdinfo info = { };
>> +
>> +            igt_require(igt_parse_drm_fdinfo(xe, &info, engine_map,
>> +                             ARRAY_SIZE(engine_map),
>> +                             NULL, 0));
>> +            igt_require(info.num_engines);
> 
> humn... is this fixture exectuded in addition to the outer fixture
> for each each subtest? Otherwise it won't have the fd open and thus no
> client.

Yes, it is executed in addition to the outer fixture (but if the outer 
fixture fails, this one should not run), so xe is already opened. This 
fixture applies at the group scope - if it fails or is skipped, all 
tests in the group will also fail or be skipped.

However, as Kamil pointed out, fixtures are executed even if no test 
from the group is selected for execution. This means that if we run 
igt@xe_drm_fdinfo@basic-mem (which is outside this group), the fixture 
from the utilization group still runs, potentially logging an unmet 
requirement.

IIUC, the only solution is to move the checks inside the subtests.

> 
> Lucas De Marchi


  reply	other threads:[~2025-03-06  9:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-04 18:56 [PATCH i-g-t 0/2] tests/xe_drm_fdinfo: Check prerequisites for utilization tests Marcin Bernatowicz
2025-03-04 18:56 ` [PATCH i-g-t 1/2] tests/intel/xe_drm_fdinfo: Group utilization tests and skip when no utilization data Marcin Bernatowicz
2025-03-05 12:15   ` Kamil Konieczny
2025-03-05 16:31     ` Bernatowicz, Marcin
2025-03-06 10:56       ` Kamil Konieczny
2025-03-05 17:08   ` Lucas De Marchi
2025-03-06  9:19     ` Bernatowicz, Marcin [this message]
2025-03-13  4:19       ` Lucas De Marchi
2025-03-13 11:37         ` Zbigniew Kempczyński
2025-03-04 18:56 ` [PATCH i-g-t 2/2] tests/intel/xe_drm_fdinfo: Fail basic_engine_utilization if " Marcin Bernatowicz
2025-03-05  8:05 ` ✓ Xe.CI.BAT: success for tests/xe_drm_fdinfo: Check prerequisites for utilization tests (rev2) Patchwork
2025-03-05  8:35 ` ✓ i915.CI.BAT: " Patchwork
2025-03-05  9:02 ` ✗ Xe.CI.Full: failure " Patchwork
2025-03-05 12:34 ` ✗ i915.CI.Full: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f78e21cc-d1f4-4974-92b8-b3d497a5c50f@linux.intel.com \
    --to=marcin.bernatowicz@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jakub1.kolakowski@intel.com \
    --cc=lucas.demarchi@intel.com \
    --cc=lukasz.laguna@intel.com \
    --cc=umesh.nerlige.ramappa@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox