a framework for performance testing on io_uring.
cmake -S . -B cmake-build-debug/
make -C cmake-build-debug/ all
bash ./test.sh
this command builds and runs all perf units with configs in test.sh
compile outputs are several elf file, name in the following rule:
example: round_sqpoll-read
means this perf unit is loaded by
round
loader, and test unit issqpoll-read
loader determines how test runs, and test unit determines which functionality to perf.
round
loader runs test for fixed rounds, and count time used.
sqpoll-read
test unit tests theread
functionality insqpoll
mode.there are kinds of loaders and test units, and it is easy to add more depends as wish.
run the elf file, and refer to detailed help via argument -?
:
example: round_writev
$./round_write -?
Usage: round_write [OPTION...]
Test Arguments
-d io_depth set io_depth
-f file_name set file path for test
-i io_size set io_size
-s file_size set test file size
Loader Arguments
-r round_count set round count
-w warm_up set warm up round
-?, --help Give this help list
--usage Give a short usage message
and config the runnning via arguments:
$./round_write -r 2 -w 1 -d 16 -f "/home/qiyilang.wqyl/nvme/test_file" -i 4K -s 500M
as mentioned in ep. usage
, a perf unit is assembled from two part, loader and test.
loader determines how test runs, and test unit determines which functionality to perf.
loader contains 3 functions named in loader_*()
, and main()
use loader functions in such way:
int main(){
loader_init();
loader_run_test();
loader_cleanup();
}
and there are 3 function in each test unit, which can be used in loader_*()
:
void test_init(int argc, char **argv);
void test_loop_body(int argc, char **argv);
void test_cleanup(int argc, char **argv);
literally, the test_init()
and test_cleanup()
should be executed once, while put test_loop_body()
in a loop
thus, the key to implement a perf unit is to add a test unit or a loader or both.
there are 3 functions, 1 char[]
for description and 1 argp
for argument handling to be implemented.
- add a
.cpp
file in/src/test/
, filename corresponds to the test - implement components:
- functions to be implemented:
void test_init(int argc, char **argv);
: run once, beforetest_loop_body
,void test_loop_body(int argc, char **argv);
: run repeatedly, the main part of testvoid test_cleanup(int argc, char **argv);
: run once, aftertest_loop_body
char[]
test description:char test_name[]
, usually usechar test_name[] = __FILE__;
argp
arg handlerargp ap_test
, filling the fields depends on the args the test unit needed.
- functions to be implemented:
there are 3 functions and 1 argp
for argument handling to be implemented in loader.
- add a
.cpp
file in/src/loader
- implement components:
- functions to be implemented:
void loader_init(int argc, char **argv);
void loader_run_test(int argc, char **argv);
void loader_clean_up(int argc, char **argv);
argp
arg handlerargp ap_loader
, filling the fields depends on the args the loader needed.
- functions to be implemented: