10 Commits

Author SHA1 Message Date
Ammar Faizi ae94cd3bee test/probe: Use io_uring_free_probe() instead of free()
`io_uring_free_probe()` should really be used to free the return value
of `io_uring_get_probe_ring()`. As we may not always allocate it with
`malloc()`. For example, to support no libc build [1].

Link: https://github.com/axboe/liburing/issues/443 [1]
Signed-off-by: Ammar Faizi <ammar.faizi@students.amikom.ac.id>
Link: https://lore.kernel.org/r/20211003010608.58380-1-ammar.faizi@students.amikom.ac.id
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-10-03 07:05:37 -06:00
godzie44 d97f7644b3 test/probe.c: fix typo in assert output
Signed-off-by: Derevtsov Konstantin <godzie@yandex.ru>
2021-09-23 13:33:49 +03:00
Jens Axboe d7463a4746 helpers: prefix any helper with t_ instead of io_uring_
As brought up in an issue, this makes it confusing as to what could
potentially be liburing functions. Make it clear that these are test
helpers, hence use the t_ prefix for them.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-24 07:12:47 -07:00
Zhiqiang Liu 107b62048e helpers: add io_uring_calloc helper
add io_uring_calloc() helper, and replace
all calloc() with io_uring_calloc() in all tests.

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
2021-02-23 14:43:57 +08:00
Jens Axboe 6c32e92bb0 test: add potential argument, ignore if unused
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-05-19 17:36:19 -06:00
Jens Axboe e502435779 Add SPDX license identifiers
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-02-11 20:34:12 -07:00
Glauber Costa 85679339e3 add another helper for probing existing opcodes
There are situations where one does not have a ring initialized yet, and
yet they may want to know which opcodes are supported before doing so.

We have recently introduced io_uring_get_probe(io_uring*) to do a
similar task when the ring already exists. Because this was committed
recently and this hasn't seen a release, I thought I would just go ahead
and change that to io_uring_get_probe_ring(io_uring*), because I suck at
finding another meaningful name for this case (io_uring_get_probe_noring
sounded way too ugly to me)

A minimal ring is initialized and torn down inside the function.

Signed-off-by: Glauber Costa <glauber@scylladb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-01-31 08:40:13 -07:00
Jens Axboe 1d69a67896 test/probe: add test csae for io_uring_get_probe()
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-01-30 09:19:51 -07:00
Jens Axboe 28a8aeeb2a test/probe: split verification into helper
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-01-30 09:19:30 -07:00
Jens Axboe ca8bd2877a Add probe test case
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-01-23 20:16:02 -07:00