[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2692de92-90e4-4a17-6609-da1bdfa5c850@riseup.net>
Date: Thu, 27 Oct 2022 13:34:04 -0300
From: Maíra Canal <mairacanal@...eup.net>
To: Arthur Grillo <arthurgrillo@...eup.net>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
Javier Martinez Canillas <javierm@...hat.com>,
Toke Høiland-Jørgensen <toke@...e.dk>,
"Jason A. Donenfeld" <Jason@...c4.com>
Cc: dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
David Gow <davidgow@...gle.com>,
Daniel Latypov <dlatypov@...gle.com>, andrealmeid@...eup.net,
melissa.srw@...il.com,
Michał Winiarski <michal.winiarski@...el.com>
Subject: Re: [PATCH v2] drm/tests: Add back seed value information
Hi Arthur,
On 10/27/22 11:29, Arthur Grillo wrote:
> As reported by Michał the drm_mm and drm_buddy unit tests lost the
> printk with seed value after they where refactored into KUnit. This
> patch add back this important information to assure reproducibility and
> convert them to the KUnit API.
Some grammar nits:
- s/where/were
- s/add/adds
Moreover, you could write the commit message as André indicated, that
is: in imperative form.
>
> Reported-by: Michał Winiarski <michal.winiarski@...el.com>
> Signed-off-by: Arthur Grillo <arthurgrillo@...eup.net>
> ---
> v1->v2: https://lore.kernel.org/all/20221026211458.68432-1-arthurgrillo@riseup.net/
> - Correct compilation issues
> - Change tags order
> - Remove useless line change
> - Write commit message in imperative form
> - Remove redundant message part
> - Correct some grammars nits
> - Correct checkpatch issues
>
> ---
> drivers/gpu/drm/tests/drm_buddy_test.c | 4 ++++
> drivers/gpu/drm/tests/drm_mm_test.c | 4 ++++
> 2 files changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/tests/drm_buddy_test.c b/drivers/gpu/drm/tests/drm_buddy_test.c
> index 62f69589a72d..258137e9c047 100644
> --- a/drivers/gpu/drm/tests/drm_buddy_test.c
> +++ b/drivers/gpu/drm/tests/drm_buddy_test.c
> @@ -731,6 +731,10 @@ static int drm_buddy_init_test(struct kunit *test)
> while (!random_seed)
> random_seed = get_random_u32();
>
> + kunit_info(test,
> + "Testing DRM buddy manager, with random_seed=0x%x\n",
> + random_seed);
> +
> return 0;
> }
>
As I was checking the log, I realized that the random_seed only needs to
be generated by the start of the test suite, so this drm_buddy_init_test
could be a suite_init function, instead of an init function. This way
the random_seed will be generated by the start of the suite and the log
will be printed just once.
> diff --git a/drivers/gpu/drm/tests/drm_mm_test.c b/drivers/gpu/drm/tests/drm_mm_test.c
> index c4b66eeae203..bec006e044a4 100644
> --- a/drivers/gpu/drm/tests/drm_mm_test.c
> +++ b/drivers/gpu/drm/tests/drm_mm_test.c
> @@ -2214,6 +2214,10 @@ static int drm_mm_init_test(struct kunit *test)
> while (!random_seed)
> random_seed = get_random_u32();
>
> + kunit_info(test,
> + "Testing DRM range manager, with random_seed=0x%x max_iterations=%u max_prime=%u\n",
> + random_seed, max_iterations, max_prime);
> +
Same here.
Best Regards,
- Maíra Canal
> return 0;
> }
>
Powered by blists - more mailing lists