10 Star 0 Fork 1

anolis / perf-test-for-io_uring

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

perf-test-for-io_uring

a framework for performance testing on io_uring.

compile

dependencies

  1. liburing
  2. CMake
  3. pthread

build

cmake -S . -B cmake-build-debug/
make -C cmake-build-debug/ all

usage

quick launch

bash ./test.sh

this command builds and runs all perf units with configs in test.sh

detailed

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 is sqpoll-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 the read functionality in sqpoll 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

how test runs

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.

how to add test unit

there are 3 functions, 1 char[] for description and 1 argp for argument handling to be implemented.

  1. add a .cpp file in /src/test/, filename corresponds to the test
  2. implement components:
    • functions to be implemented:
      1. void test_init(int argc, char **argv);: run once, before test_loop_body,
      2. void test_loop_body(int argc, char **argv);: run repeatedly, the main part of test
      3. void test_cleanup(int argc, char **argv);: run once, after test_loop_body
    • char[] test description:
      1. char test_name[], usually use char test_name[] = __FILE__;
    • argp arg handler
      1. argp ap_test, filling the fields depends on the args the test unit needed.

how to add loader

there are 3 functions and 1 argp for argument handling to be implemented in loader.

  1. add a .cpp file in /src/loader
  2. implement components:
    • functions to be implemented:
      1. void loader_init(int argc, char **argv);
      2. void loader_run_test(int argc, char **argv);
      3. void loader_clean_up(int argc, char **argv);
    • argp arg handler
      1. argp ap_loader, filling the fields depends on the args the loader needed.
Copyright (c) 2020 Qiyilang Wang Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

io_uring 性能测试框架,用于 io_uring 迭代开发期的性能回归。 展开 收起
C++ 等 4 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/anolis/perf-test-for-io_uring.git
git@gitee.com:anolis/perf-test-for-io_uring.git
anolis
perf-test-for-io_uring
perf-test-for-io_uring
master

搜索帮助