onst struct device_driver *driver = to_kunit_device(dev)->driver;
>
> kunit_release_action(test, device_unregister_wrapper, dev);
> - if (driver)
> + if (driver) {
> + const char *driver_name = driver->name;
Also a minor nit (and I haven't found anything in the kernel code style
regarding it), but probably the declaration should be moved into
beginning of the function (as it is done in the rest of the file)
Thanks!
--
Kind regards,
Ivan Orlov
ation showing userspace-driven ALSA timers API.
Also, the timer test includes a test case which tries to create a timer
with invalid resolution (=0), and NULL as a timer info structure.
Signed-off-by: Ivan Orlov
---
V1 -> V2:
- Return NULL in the pthreaded function (ticking_func)
- Process TIMER_
ticks available for the timer is 1 for the sake of
simplicity of the userspace API. 'start', 'stop', 'open' and 'close'
callbacks for the userspace-driven timers are empty since we don't
really do any hardware initialization here.
Suggested-by: Axel Holzing
the timers can be used as a timer sources for snd-aloop module
Suggested-by: Axel Holzinger
Signed-off-by: Ivan Orlov
---
V1 -> V2:
- No changes
V2 -> V3:
- No changes
V3 -> V4:
- Update the userspace-driver ALSA timer structure name and fields
in correspondence with the latest changes (r
Allow using global timers as a timer source when card id is equal to -1
in the timer_source parameter.
Signed-off-by: Ivan Orlov
---
V1 -> V2:
- No changes
V2 -> V3:
- No changes
V3 -> V4:
- No changes
V4 -> V5:
- No changes
sound/drivers/aloop.c | 2 ++
1 file changed, 2 inserti
an error code.
Please, find the patch-specific changelog in the following patches.
Ivan Orlov (4):
ALSA: aloop: Allow using global timers
Docs/sound: Add documentation for userspace-driven ALSA timers
ALSA: timer: Introduce virtual userspace-driven timers
selftests: ALSA: Cover userspace-driven
On 8/13/24 07:02, Takashi Iwai wrote:
On Sun, 11 Aug 2024 22:23:36 +0200,
Ivan Orlov wrote:
+static int snd_utimer_ioctl_create(struct file *file,
+ struct snd_timer_uinfo __user *_utimer_info)
+{
+ struct snd_utimer *utimer;
+ struct snd_timer_uinfo
ation showing userspace-driven ALSA timers API.
Also, the timer test includes a test case which tries to create a timer
with invalid resolution (=0), and NULL as a timer info structure.
Signed-off-by: Ivan Orlov
---
V1 -> V2:
- Return NULL in the pthreaded function (ticking_func)
- Process TIMER_
ke of
simplicity of the userspace API. 'start', 'stop', 'open' and 'close'
callbacks for the userspace-driven timers are empty since we don't
really do any hardware initialization here.
Suggested-by: Axel Holzinger
Signed-off-by: Ivan Orlov
---
V1
Allow using global timers as a timer source when card id is equal to -1
in the timer_source parameter.
Signed-off-by: Ivan Orlov
---
V1 -> V2:
- No changes
V2 -> V3:
- No changes
V3 -> V4:
- No changes
sound/drivers/aloop.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/soun
the timers can be used as a timer sources for snd-aloop module
Suggested-by: Axel Holzinger
Signed-off-by: Ivan Orlov
---
V1 -> V2:
- No changes
V2 -> V3:
- No changes
V3 -> V4:
- Update the userspace-driver ALSA timer structure name and fields
in correspondence with the latest changes (r
comments from Jaroslav Kysela and Mark Brown
Please, find the patch-specific changelog in the following patches.
Ivan Orlov (4):
ALSA: aloop: Allow using global timers
Docs/sound: Add documentation for userspace-driven ALSA timers
ALSA: timer: Introduce virtual userspace-driven timers
self
On 8/6/24 14:04, Mark Brown wrote:
On Tue, Aug 06, 2024 at 01:52:43PM +0100, Ivan Orlov wrote:
-TEST_GEN_PROGS := mixer-test pcm-test test-pcmtest-driver
+TEST_GEN_PROGS := mixer-test pcm-test utimer-test test-pcmtest-driver
global-timer
This is adding the timer timer tests as standard
On 8/6/24 14:11, Jaroslav Kysela wrote:
On 06. 08. 24 14:52, Ivan Orlov wrote:
Implement two ioctl calls in order to support virtual userspace-driven
ALSA timers.
...
Hi Jaroslav,
+struct snd_utimer_info {
+ /*
+ * To pretend being a normal timer, we need to know the frame
rate
ation showing userspace-driven ALSA timers API.
Signed-off-by: Ivan Orlov
---
V1 -> V2:
- Return NULL in the pthreaded function (ticking_func)
- Process TIMER_NO_EVENT enum in the timer app output processing loop
V2 -> V3:
- Add new test case to cover invalid period sizes and frame rates for
th
ke of
simplification of the userspace API. 'start', 'stop', 'open' and 'close'
callbacks for the userspace-driven timers are empty since we don't
really do any hardware initialization here.
Suggested-by: Axel Holzinger
Signed-off-by: Ivan Orlov
---
V1
the timers can be used as a timer sources for snd-aloop module
Suggested-by: Axel Holzinger
Signed-off-by: Ivan Orlov
---
V1 -> V2:
- No changes
V2 -> V3:
- No changes
Documentation/sound/index.rst | 1 +
Documentation/sound/utimers.rst | 120
2 files c
Allow using global timers as a timer source when card id is equal to -1
in the timer_source parameter.
Signed-off-by: Ivan Orlov
---
V1 -> V2:
- No changes
V2 -> V3:
- No changes
sound/drivers/aloop.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/drivers/aloop.c b/sound/d
patch-specific changelog in the following patches.
Ivan Orlov (4):
ALSA: aloop: Allow using global timers
Docs/sound: Add documentation for userspace-driven ALSA timers
ALSA: timer: Introduce virtual userspace-driven timers
selftests: ALSA: Cover userspace-driven timers with test
On 7/29/24 15:02, Takashi Iwai wrote:
On Mon, 29 Jul 2024 10:59:04 +0200,
Ivan Orlov wrote:
--- a/include/uapi/sound/asound.h
+++ b/include/uapi/sound/asound.h
(snip)
Hi Takashi,
Thank you so much for the review.
+/*
+ * This structure describes the userspace-driven timer. Such timers are
ation showing userspace-driven ALSA timers API.
Signed-off-by: Ivan Orlov
---
- Return NULL in the pthreaded function (ticking_func)
- Process TIMER_NO_EVENT enum in the timer app output processing loop
tools/testing/selftests/alsa/Makefile | 2 +-
tools/testing/selftests/alsa/global-timer.c
ke of
simplification of the userspace API. 'start', 'stop', 'open' and 'close'
callbacks for the userspace-driven timers are empty since we don't
really do any hardware initialization here.
Suggested-by: Axel Holzinger
Signed-off-by: Ivan Orlov
---
V1
the timers can be used as a timer sources for snd-aloop module
Suggested-by: Axel Holzinger
Signed-off-by: Ivan Orlov
---
V1 -> V2:
- No changes
Documentation/sound/index.rst | 1 +
Documentation/sound/utimers.rst | 120
2 files changed, 121 inserti
Allow using global timers as a timer source when card id is equal to -1
in the timer_source parameter.
Signed-off-by: Ivan Orlov
---
V1 -> V2:
- No changes
sound/drivers/aloop.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c
in
eries also updates the snd-aloop module so the global timers
can be used as a timer_source for it (it allows using userspace-driven
timers as timer source).
V2 of this patch series fixes some problems found by Christophe Jaillet
. Please, find the patch-specific
changelog in the following patches.
Iva
rnel has a generic ID
allocator and now I finally know it does :) ).
Thank you!
--
Kind regards,
Ivan Orlov
On 7/28/24 10:30, Christophe JAILLET wrote:
Le 28/07/2024 à 10:51, Ivan Orlov a écrit :
On 7/28/24 07:59, Christophe JAILLET wrote:
Le 26/07/2024 à 09:47, Ivan Orlov a écrit :
Implement two ioctl calls in order to support virtual userspace-driven
ALSA timers.
The first ioctl is
On 7/28/24 07:59, Christophe JAILLET wrote:
Le 26/07/2024 à 09:47, Ivan Orlov a écrit :
Implement two ioctl calls in order to support virtual userspace-driven
ALSA timers.
The first ioctl is SNDRV_TIMER_IOCTL_CREATE, which gets the
snd_utimer_info struct as a parameter and returns a file
mall, we could even save a few bytes of memory.
Wow, cool, I haven't heard of kasprintf but now I'll use it here in V2.
Thanks!
--
Kind regards,
Ivan Orlov
ation showing userspace-driven ALSA timers API.
Signed-off-by: Ivan Orlov
---
tools/testing/selftests/alsa/Makefile | 2 +-
tools/testing/selftests/alsa/global-timer.c | 87 +
tools/testing/selftests/alsa/utimer-test.c | 133
3 files changed, 221 insertions(
ke of
simplification of the userspace API. 'start', 'stop', 'open' and 'close'
callbacks for the userspace-driven timers are empty since we don't
really do any hardware initialization here.
Suggested-by: Axel Holzinger
Signed-off-by: Ivan Orlov
---
include
the timers can be used as a timer sources for snd-aloop module
Suggested-by: Axel Holzinger
Signed-off-by: Ivan Orlov
---
Documentation/sound/index.rst | 1 +
Documentation/sound/utimers.rst | 120
2 files changed, 121 insertions(+)
create mode 100644
Allow using global timers as a timer source when card id is equal to -1
in the timer_source parameter.
Signed-off-by: Ivan Orlov
---
sound/drivers/aloop.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c
index d6dd4b8c750a..a1e5e7fe9c72 100644
eries also updates the snd-aloop module so the global timers
can be used as a timer_source for it (it allows using userspace-driven
timers as timer source).
Ivan Orlov (4):
ALSA: aloop: Allow using global timers
Docs/sound: Add documentation for userspace-driven ALSA timers
ALSA: timer: Introduc
On 6/21/24 22:07, 'Rae Moar' via KUnit Development wrote:
On Tue, Jun 18, 2024 at 1:03 PM Ivan Orlov wrote:
Currently, the only way to build string-stream-test is by setting
CONFIG_KUNIT_TEST=y. However, CONFIG_KUNIT_TEST is a config option for
a different test (`kunit-test.c`).
I
On 6/19/24 19:09, Jeff Johnson wrote:
On 6/18/24 10:03, Ivan Orlov wrote:
Currently, the only way to build string-stream-test is by setting
CONFIG_KUNIT_TEST=y. However, CONFIG_KUNIT_TEST is a config option for
a different test (`kunit-test.c`).
Introduce a new Kconfig entry in order to be
On 6/21/24 22:38, Rae Moar wrote:
On Tue, Jun 18, 2024 at 1:03 PM Ivan Orlov wrote:
Since assert_test covers the part of the KUnit core (the assertion
formatting functions), I believe it would be better to have it merged
into kunit-test (as it is done for other tests for the KUnit core
Since assert_test covers the part of the KUnit core (the assertion
formatting functions), I believe it would be better to have it merged
into kunit-test (as it is done for other tests for the KUnit core).
Signed-off-by: Ivan Orlov
---
V1 -> V2:
- Update considering the changes in the previ
n the tests (and cover them as well).
Signed-off-by: Ivan Orlov
---
V1 -> V2:
- Besides exporting the non-static functions from assert.c into the
KUnit namespace, rename some of them as well (add kunit_assert_ prefix
to make their names less ambiguous).
include/kunit/assert.h | 4 +
namespace
in the test so we could have string-stream functions accessible.
Reviewed-by: David Gow
Signed-off-by: Ivan Orlov
---
V1 -> V2:
- No changes
lib/kunit/Kconfig | 8
lib/kunit/Makefile | 2 +-
lib/kunit/string-stream-test.c | 2 ++
3 files changed,
-by: Ivan Orlov
---
V1 -> V2:
- No changes
lib/kunit/kunit-test.c | 18 +-
1 file changed, 1 insertion(+), 17 deletions(-)
diff --git a/lib/kunit/kunit-test.c b/lib/kunit/kunit-test.c
index 37e02be1e710..d86f7cb3b3e4 100644
--- a/lib/kunit/kunit-test.c
+++ b/lib/kunit/kunit-tes
Export non-static functions from the string-stream.c file into the KUnit
namespace in order to be able to access them from the KUnit core tests
(when they are loaded as modules).
Reviewed-by: David Gow
Signed-off-by: Ivan Orlov
---
V1 -> V2:
- No changes
lib/kunit/string-stream.c |
ged into kunit-test.c
- Also, David Gow suggested merging 4th and 5th
patches together, but since now the 4th patch does more than it used to
do, I send it separately
Ivan Orlov (5):
kunit: string-stream: export non-static functions
kunit: kunit-test: Remove stub for log tests
kunit: str
On 6/8/24 10:20, David Gow wrote:
On Tue, 4 Jun 2024 at 20:32, Ivan Orlov wrote:
Since assert_test covers the part of the KUnit core (the assertion
formatting functions), I believe it would be better to have it merged
into kunit-test (as it is done for other tests for the KUnit core).
Signed
uf1[i]);
}
}
+EXPORT_SYMBOL_IF_KUNIT(kunit_assert_hexdump);
void kunit_mem_assert_format(const struct kunit_assert *assert,
const struct va_format *message,
--
2.34.1
--
Kind regards,
Ivan Orlov
On 6/8/24 10:20, David Gow wrote:
On Tue, 4 Jun 2024 at 20:32, Ivan Orlov wrote:
Export non-static functions from the string-stream.c file into the KUnit
namespace in order to be able to access them from the KUnit core tests
(when they are loaded as modules).
Signed-off-by: Ivan Orlov
Since assert_test covers the part of the KUnit core (the assertion
formatting functions), I believe it would be better to have it merged
into kunit-test (as it is done for other tests for the KUnit core).
Signed-off-by: Ivan Orlov
---
lib/kunit/Makefile | 5 -
lib/kunit/assert_test.c
Export non-static functions from the assert.c file into the KUnit
namespace in order to be able to access them from the tests if
they are compiled as modules.
Signed-off-by: Ivan Orlov
---
lib/kunit/assert.c | 4
1 file changed, 4 insertions(+)
diff --git a/lib/kunit/assert.c b/lib/kunit
namespace
in the test so we could have string-stream functions accessible.
Signed-off-by: Ivan Orlov
---
lib/kunit/Kconfig | 8
lib/kunit/Makefile | 2 +-
lib/kunit/string-stream-test.c | 2 ++
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/lib
Since now we are exporting string-stream functions into the KUnit
namespace, we can safely use them in kunit-test when it is compiled as
a module as well. So, remove the stubs used when kunit-test is compiled
as a module. Import the KUnit namespace in the test.
Signed-off-by: Ivan Orlov
---
lib
Export non-static functions from the string-stream.c file into the KUnit
namespace in order to be able to access them from the KUnit core tests
(when they are loaded as modules).
Signed-off-by: Ivan Orlov
---
lib/kunit/string-stream.c | 12 +++-
1 file changed, 11 insertions(+), 1
patch series merges the assertion test suite into the
kunit-test, since assert.c (and all of the assertion formatting
functions in it) is a part of the KUnit core.
Ivan Orlov (5):
kunit: string-stream: export non-static functions
kunit: kunit-test: Remove stub for log tests
kunit: string
On 5/20/24 22:12, Rae Moar wrote:
On Thu, May 16, 2024 at 11:17 PM Ivan Orlov wrote:
There are multiple assertion formatting functions in the `assert.c`
file, which are not covered with tests yet. Implement the KUnit test
for these functions.
The test consists of 11 test cases for the
MAP_ANONYMOUS | MAP_PRIVATE, 0);
+ KUNIT_ASSERT_LT_MSG(test, user_addr, (unsigned long)TASK_SIZE,
+ "Failed to allocate user memory");
+ priv->umem = (char __user *)user_addr;
-static void __exit test_user_copy_exit(void)
-{
- pr_info("unloaded.\n");
+ return 0;
}
-module_exit(test_user_copy_exit);
-
+static struct kunit_case usercopy_test_cases[] = {
+ KUNIT_CASE(usercopy_test_valid),
+ KUNIT_CASE(usercopy_test_invalid),
+ KUNIT_CASE(usercopy_test_check_nonzero_user),
+ KUNIT_CASE(usercopy_test_copy_struct_from_user),
+ {}
+};
+
+static struct kunit_suite usercopy_test_suite = {
+ .name = "usercopy",
+ .init = usercopy_test_init,
+ .test_cases = usercopy_test_cases,
+};
+
+kunit_test_suites(&usercopy_test_suite);
MODULE_AUTHOR("Kees Cook ");
MODULE_LICENSE("GPL");
Other than that,
Tested-by: Ivan Orlov
--
Kind regards,
Ivan Orlov
sert.c` as 'VISIBLE_IF_KUNIT'
and conditionally export them with EXPORT_SYMBOL_IF_KUNIT. Add the
corresponding definitions to `assert.h`.
Build the assert test when CONFIG_KUNIT_TEST is enabled, similar to
how it is done for the string stream test.
Signed-off-by: Ivan Orlov
---
V1 -> V2:
-
On 5/16/24 19:57, Rae Moar wrote:
On Wed, May 15, 2024 at 10:20 AM Ivan Orlov wrote:
There are multiple assertion formatting functions in the `assert.c`
file, which are not covered with tests yet. Implement the KUnit test
for these functions.
The test consists of 11 test cases for the
sert.c` as 'VISIBLE_IF_KUNIT'
and conditionally export them with EXPORT_SYMBOL_IF_KUNIT. Add the
corresponding definitions to `assert.h`.
Build the assert test when CONFIG_KUNIT_TEST is enabled, similar to
how it is done for the string stream test.
Signed-off-by: Ivan Orlov
---
V1 -> V2:
-
On 5/14/24 20:55, 'Rae Moar' via KUnit Development wrote:
Thank you once again,
--
Kind regards,
Ivan Orlov
Hello!
This sounds like a great approach! Happy to review the new patch
series when it comes in.
Thanks,
Rae
Awesome, thank you!
--
Kind regards,
Ivan Orlov
On 5/14/24 01:17, Rae Moar wrote:
On Thu, May 9, 2024 at 5:05 AM Ivan Orlov wrote:
There are multiple assertion formatting functions in the `assert.c`
file, which are not covered with tests yet. Implement the KUnit test
for these functions.
The test consists of 11 test cases for the
version of the KVM API before creating a VM.
Signed-off-by: Ivan Orlov
---
.../testing/selftests/kvm/include/kvm_util_base.h | 2 ++
tools/testing/selftests/kvm/lib/kvm_util.c | 14 ++
2 files changed, 16 insertions(+)
diff --git a/tools/testing/selftests/kvm/include
sert.c` as 'VISIBLE_IF_KUNIT'
and conditionally export them with EXPORT_SYMBOL_IF_KUNIT. Add the
corresponding definitions to `assert.h`.
Build the assert test when CONFIG_KUNIT_TEST is enabled, similar to
how it is done for the string stream test.
Signed-off-by: Ivan Orlov
---
V1 -> V2:
-
sert.c` as 'VISIBLE_IF_KUNIT'
and conditionally export them with EXPORT_SYMBOL_IF_KUNIT. Add the
corresponding definitions to `assert.h`.
Build the assert test when CONFIG_KUNIT_TEST is enabled, similar to
how it is done for the string stream test.
Signed-off-by: Ivan Orlov
---
V1 -> V2:
-
On 5/3/24 12:10, Ivan Orlov wrote:
On 5/2/24 00:20, Rae Moar wrote:
On Sat, Apr 27, 2024 at 6:04 PM Ivan Orlov
wrote:
There are multiple assertion formatting functions in the `assert.c`
file, which are not covered with tests yet. Implement the KUnit test
for these functions.
The test
On 5/3/24 12:10, Ivan Orlov wrote:
On 5/2/24 00:20, Rae Moar wrote:
On Sat, Apr 27, 2024 at 6:04 PM Ivan Orlov
wrote:
There are multiple assertion formatting functions in the `assert.c`
file, which are not covered with tests yet. Implement the KUnit test
for these functions.
The test
On 5/2/24 00:20, Rae Moar wrote:
On Sat, Apr 27, 2024 at 6:04 PM Ivan Orlov wrote:
There are multiple assertion formatting functions in the `assert.c`
file, which are not covered with tests yet. Implement the KUnit test
for these functions.
The test consists of 11 test cases for the
On 4/29/24 22:26, Rae Moar wrote:
On Sat, Apr 27, 2024 at 6:04 PM Ivan Orlov wrote:
There are multiple assertion formatting functions in the `assert.c`
file, which are not covered with tests yet. Implement the KUnit test
for these functions.
The test consists of 11 test cases for the
rt_format'
10) 'kunit_assert_hexdump'
11) 'kunit_mem_assert_format'
The test aims at maximizing the branch coverage for the assertion
formatting functions. As you can see, it covers some of the static
helper functions as well, so we have to import the test source in
Use KUNIT_DEFINE_ACTION_WRAPPER macro to define the 'kfree' and
'string_stream_destroy' wrappers for kunit_add_action.
Signed-off-by: Ivan Orlov
---
lib/kunit/string-stream-test.c | 12 ++--
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/lib/kunit/st
On 9/16/23 22:25, Javier Carrasco wrote:
Removing an unused variable is actually removing a blank line from a
logical point of view. Is an extra patch not overkill considering that
it cannot affect the code behavior?
Well, no, it is not, as the line is not blank (nothing except removing a
blan
is test could be enhanced in lots of
ways, so I look forward to seeing new patches related to it from you :)
--
Kind regards,
Ivan Orlov
70 matches
Mail list logo