dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5] drm/tests: Add back seed value information
@ 2022-10-28 22:17 Arthur Grillo
  2022-11-02 12:54 ` Maíra Canal
  0 siblings, 1 reply; 2+ messages in thread
From: Arthur Grillo @ 2022-10-28 22:17 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter, Javier Martinez Canillas,
	Maíra Canal, Toke Høiland-Jørgensen,
	Jason A. Donenfeld
  Cc: Michał Winiarski, Daniel Latypov, linux-kernel, dri-devel,
	melissa.srw, David Gow, andrealmeid, Arthur Grillo

As reported by Michał the drm_mm and drm_buddy unit tests lost the
printk with seed value after they were refactored into KUnit.

Add kunit_info with seed value information to assure reproducibility.

Reported-by: Michał Winiarski <michal.winiarski@intel.com>
Signed-off-by: Arthur Grillo <arthurgrillo@riseup.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

v2->v3: https://lore.kernel.org/all/20221027142903.200169-1-arthurgrillo@riseup.net/
- Change .init to .suite_init
- Correct some grammars nits

v3->v4: https://lore.kernel.org/all/20221028141246.280079-1-arthurgrillo@riseup.net/
- Correct compilation issues

v4->v5: https://lore.kernel.org/all/20221028141715.290903-1-arthurgrillo@riseup.net/
- Change functions names from init_suite to suite_init
---
 drivers/gpu/drm/tests/drm_buddy_test.c | 6 ++++--
 drivers/gpu/drm/tests/drm_mm_test.c    | 8 ++++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/tests/drm_buddy_test.c b/drivers/gpu/drm/tests/drm_buddy_test.c
index 62f69589a72d..f8ee714df396 100644
--- a/drivers/gpu/drm/tests/drm_buddy_test.c
+++ b/drivers/gpu/drm/tests/drm_buddy_test.c
@@ -726,11 +726,13 @@ static void drm_test_buddy_alloc_limit(struct kunit *test)
 	drm_buddy_fini(&mm);
 }
 
-static int drm_buddy_init_test(struct kunit *test)
+static int drm_buddy_suite_init(struct kunit_suite *suite)
 {
 	while (!random_seed)
 		random_seed = get_random_u32();
 
+	kunit_info(suite, "Testing DRM buddy manager, with random_seed=0x%x\n", random_seed);
+
 	return 0;
 }
 
@@ -746,7 +748,7 @@ static struct kunit_case drm_buddy_tests[] = {
 
 static struct kunit_suite drm_buddy_test_suite = {
 	.name = "drm_buddy",
-	.init = drm_buddy_init_test,
+	.suite_init = drm_buddy_suite_init,
 	.test_cases = drm_buddy_tests,
 };
 
diff --git a/drivers/gpu/drm/tests/drm_mm_test.c b/drivers/gpu/drm/tests/drm_mm_test.c
index c4b66eeae203..89f12d3b4a21 100644
--- a/drivers/gpu/drm/tests/drm_mm_test.c
+++ b/drivers/gpu/drm/tests/drm_mm_test.c
@@ -2209,11 +2209,15 @@ static void drm_test_mm_color_evict_range(struct kunit *test)
 	vfree(nodes);
 }
 
-static int drm_mm_init_test(struct kunit *test)
+static int drm_mm_suite_init(struct kunit_suite *suite)
 {
 	while (!random_seed)
 		random_seed = get_random_u32();
 
+	kunit_info(suite,
+		   "Testing DRM range manager, with random_seed=0x%x max_iterations=%u max_prime=%u\n",
+		   random_seed, max_iterations, max_prime);
+
 	return 0;
 }
 
@@ -2246,7 +2250,7 @@ static struct kunit_case drm_mm_tests[] = {
 
 static struct kunit_suite drm_mm_test_suite = {
 	.name = "drm_mm",
-	.init = drm_mm_init_test,
+	.suite_init = drm_mm_suite_init,
 	.test_cases = drm_mm_tests,
 };
 
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v5] drm/tests: Add back seed value information
  2022-10-28 22:17 [PATCH v5] drm/tests: Add back seed value information Arthur Grillo
@ 2022-11-02 12:54 ` Maíra Canal
  0 siblings, 0 replies; 2+ messages in thread
From: Maíra Canal @ 2022-11-02 12:54 UTC (permalink / raw)
  To: Arthur Grillo, David Airlie, Daniel Vetter,
	Javier Martinez Canillas, Toke Høiland-Jørgensen,
	Jason A. Donenfeld
  Cc: Michał Winiarski, Daniel Latypov, linux-kernel, dri-devel,
	melissa.srw, David Gow, andrealmeid

Hi Arthur,

Thanks for the patch! Pushed to drm-misc-next.

Best Regards,
- Maíra Canal

On 10/28/22 19:17, Arthur Grillo wrote:
> As reported by Michał the drm_mm and drm_buddy unit tests lost the
> printk with seed value after they were refactored into KUnit.
> 
> Add kunit_info with seed value information to assure reproducibility.
> 
> Reported-by: Michał Winiarski <michal.winiarski@intel.com>
> Signed-off-by: Arthur Grillo <arthurgrillo@riseup.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
> 
> v2->v3: https://lore.kernel.org/all/20221027142903.200169-1-arthurgrillo@riseup.net/
> - Change .init to .suite_init
> - Correct some grammars nits
> 
> v3->v4: https://lore.kernel.org/all/20221028141246.280079-1-arthurgrillo@riseup.net/
> - Correct compilation issues
> 
> v4->v5: https://lore.kernel.org/all/20221028141715.290903-1-arthurgrillo@riseup.net/
> - Change functions names from init_suite to suite_init
> ---
>  drivers/gpu/drm/tests/drm_buddy_test.c | 6 ++++--
>  drivers/gpu/drm/tests/drm_mm_test.c    | 8 ++++++--
>  2 files changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tests/drm_buddy_test.c b/drivers/gpu/drm/tests/drm_buddy_test.c
> index 62f69589a72d..f8ee714df396 100644
> --- a/drivers/gpu/drm/tests/drm_buddy_test.c
> +++ b/drivers/gpu/drm/tests/drm_buddy_test.c
> @@ -726,11 +726,13 @@ static void drm_test_buddy_alloc_limit(struct kunit *test)
>  	drm_buddy_fini(&mm);
>  }
>  
> -static int drm_buddy_init_test(struct kunit *test)
> +static int drm_buddy_suite_init(struct kunit_suite *suite)
>  {
>  	while (!random_seed)
>  		random_seed = get_random_u32();
>  
> +	kunit_info(suite, "Testing DRM buddy manager, with random_seed=0x%x\n", random_seed);
> +
>  	return 0;
>  }
>  
> @@ -746,7 +748,7 @@ static struct kunit_case drm_buddy_tests[] = {
>  
>  static struct kunit_suite drm_buddy_test_suite = {
>  	.name = "drm_buddy",
> -	.init = drm_buddy_init_test,
> +	.suite_init = drm_buddy_suite_init,
>  	.test_cases = drm_buddy_tests,
>  };
>  
> diff --git a/drivers/gpu/drm/tests/drm_mm_test.c b/drivers/gpu/drm/tests/drm_mm_test.c
> index c4b66eeae203..89f12d3b4a21 100644
> --- a/drivers/gpu/drm/tests/drm_mm_test.c
> +++ b/drivers/gpu/drm/tests/drm_mm_test.c
> @@ -2209,11 +2209,15 @@ static void drm_test_mm_color_evict_range(struct kunit *test)
>  	vfree(nodes);
>  }
>  
> -static int drm_mm_init_test(struct kunit *test)
> +static int drm_mm_suite_init(struct kunit_suite *suite)
>  {
>  	while (!random_seed)
>  		random_seed = get_random_u32();
>  
> +	kunit_info(suite,
> +		   "Testing DRM range manager, with random_seed=0x%x max_iterations=%u max_prime=%u\n",
> +		   random_seed, max_iterations, max_prime);
> +
>  	return 0;
>  }
>  
> @@ -2246,7 +2250,7 @@ static struct kunit_case drm_mm_tests[] = {
>  
>  static struct kunit_suite drm_mm_test_suite = {
>  	.name = "drm_mm",
> -	.init = drm_mm_init_test,
> +	.suite_init = drm_mm_suite_init,
>  	.test_cases = drm_mm_tests,
>  };
>  

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-02 12:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-28 22:17 [PATCH v5] drm/tests: Add back seed value information Arthur Grillo
2022-11-02 12:54 ` Maíra Canal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).