Signed-off-by: Zhang Yale ylzhangah@qq.com --- tests/hackbench-git | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 tests/hackbench-git
diff --git a/tests/hackbench-git b/tests/hackbench-git new file mode 100755 index 00000000..bb66bd1d --- /dev/null +++ b/tests/hackbench-git @@ -0,0 +1,33 @@ +#!/bin/bash +# - runtime +# - nr_threads +# - mode +# - ipc +# - iterations +# - loops + +## Hackbench-git is an old version, It is both a benchmark and a stress test for the Linux kernel scheduler. +## It's main job is to create a specified number of pairs of schedulable entities +## (either threads or traditional processes) which communicate via either sockets or +## pipes and time how long it takes for each pair to send data back and forth. + +[ "$ipc" = 'pipe' ] && ipc_option='-pipe' + +[ -n "$runtime" ] || runtime=600 +[ -n "$iterations" ] || iterations=10 + + +run_hackbench() +{ + # args: groups number, mode [process/thread], times + local hackbench_path + [ -f /lkp/benchmarks/hackbench-git/hackbench/hackbench ] && hackbench_path=/lkp/benchmarks/hackbench-git/hackbench/hackbench + echo "--------$ipc $mode num=$nr_threads--------" + for i in $(seq 1 $iterations); do + log_cmd $hackbench_path $ipc_option $nr_threads $mode $loops + done +} + +run_hackbench + +