Re: [PATCH v2 4/6] kunit: Allow function redirection outside of the KUnit thread

2024-08-27 Thread Lucas De Marchi
ions if one is still used by other thread. Signed-off-by: Michal Wajdeczko --- Cc: Rae Moar Cc: David Gow Cc: Daniel Latypov Cc: Lucas De Marchi --- v2: s/FIXED_STUB/GLOBAL_STUB (David, Lucas) make it little more thread safe (Rae, David) wait until stub call finishes before test end (

Re: [PATCH v2 5/6] kunit: Add example with alternate function redirection method

2024-08-27 Thread Lucas De Marchi
structures. Signed-off-by: Michal Wajdeczko Reviewed-by: Rae Moar #v1 Reviewed-by: David Gow #v1 --- Cc: Daniel Latypov Cc: Lucas De Marchi --- v2: add missing testcase description (Rae) and rebase --- lib/kunit/kunit-example-test.c | 67 ++ 1 file changed, 67

Re: [PATCH v2 2/6] kunit: Add macro to conditionally expose declarations to tests

2024-08-27 Thread Lucas De Marchi
Moar Reviewed-by: David Gow --- Cc: Lucas De Marchi up to kunit maintainers, but it doesn't seem the word "DECLARE" is entirely correct. What it's doing is expanding arg, and it doesn't matter if it's an expression, definition, declaration. Looking at patch 3, I

Re: [PATCH 3/4] kunit: Allow function redirection outside of the KUnit thread

2024-08-21 Thread Lucas De Marchi
if (kunit_is_running()) { \ + if (unlikely(replacement)) { \ probably better as `if (unlikely(kunit_is_running() && replacement))`? Because we are likely to use one specific replacement in just 1 or few tests from an entire

Re: [PATCH 1/4] kunit: Introduce kunit_is_running()

2024-08-21 Thread Lucas De Marchi
Wajdeczko Reviewed-by: Lucas De Marchi Lucas De Marchi --- Cc: Daniel Latypov Cc: David Gow Cc: Lucas De Marchi --- include/kunit/test-bug.h | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/kunit/test-bug.h b/include/kunit/test-bug.h index 47

Re: [PATCH 8/9] drm/xe/tests: Fix printf format specifiers in xe_migrate test

2024-02-21 Thread Lucas De Marchi
'%li', and for the case where we're printing an error pointer, just use '%pe', instead of extracting the error code manually with PTR_ERR(). (This also results in a nicer output when the error code is known.) Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver

Re: Re: Re: [PATCH v2] kunit: Mark filter* params as rw

2024-01-24 Thread Lucas De Marchi
On Wed, Jan 24, 2024 at 11:49:43AM +0800, David Gow wrote: On Wed, 24 Jan 2024 at 00:31, Lucas De Marchi wrote: On Tue, Jan 23, 2024 at 04:01:49PM +0800, David Gow wrote: >On Tue, 23 Jan 2024 at 01:14, Lucas De Marchi wrote: >> >> By allowing the filter_glob parameter to be w

Re: Re: [PATCH v2] kunit: Mark filter* params as rw

2024-01-23 Thread Lucas De Marchi
On Tue, Jan 23, 2024 at 04:01:49PM +0800, David Gow wrote: On Tue, 23 Jan 2024 at 01:14, Lucas De Marchi wrote: By allowing the filter_glob parameter to be written to, it's possible to tweak the testsuites that will be executed on new module loads. This makes it easier to run specific

[PATCH v2] kunit: Mark filter* params as rw

2024-01-22 Thread Lucas De Marchi
rg/intel-xe/dzacvbdditbneiu3e3fmstjmttcbne44yspumpkd6sjn56jqpk@vxu7sksbqrp6/ Reviewed-by: Rae Moar Signed-off-by: Lucas De Marchi --- Rae, I kept your r-b from v1 since the additions are just what we talked about. v2: also change filter_action and filter to rw, testing with the xe module to see if filter=

Re: Re: [PATCH] kunit: Mark filter_glob param as rw

2024-01-18 Thread Lucas De Marchi
On Thu, Jan 18, 2024 at 05:23:33PM -0500, Rae Moar wrote: On Thu, Jan 11, 2024 at 7:13 PM Lucas De Marchi wrote: By allowing the filter_glob parameter to be written to, it's possible to tweak the testsuites that will be executed on new module loads. This makes it easier to run specific

[PATCH] kunit: Mark filter_glob param as rw

2024-01-11 Thread Lucas De Marchi
filter_glob # modprobe -r xe_live_test # modprobe xe_live_test # ls /sys/kernel/debug/kunit/ xe_bo xe_dma_buf xe_migrate xe_mocs References: https://lore.kernel.org/intel-xe/dzacvbdditbneiu3e3fmstjmttcbne44yspumpkd6sjn56jqpk@vxu7sksbqrp6/ Signed-off-by: Lucas De March