[Why] hackbench-git is an old version required by the customer. The hackbench-git usage: hackbench [-pipe] <num groups> [process|thread] [loops] So need to add new test script for hackbench-git.
Signed-off-by: Zhang Yale ylzhangah@qq.com --- tests/hackbench-git | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 tests/hackbench-git
diff --git a/tests/hackbench-git b/tests/hackbench-git new file mode 100755 index 00000000..cd133d9e --- /dev/null +++ b/tests/hackbench-git @@ -0,0 +1,37 @@ +#!/bin/sh +# - 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 schedulable entities pairs. +## (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 +[ -n "$loops" ] || loops=100 +[ -n "$nr_threads" ] || nr_threads=1 + +run_hackbench() +{ + # args: groups number, mode [process/thread], times + local hackbench_path + if [ -x /lkp/benchmarks/hackbench-git/hackbench/hackbench ]; then + hackbench_path=/lkp/benchmarks/hackbench-git/hackbench/hackbench + else + echo "The hackbench executable file cannot be found." && exit 1 + fi + + 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
+run_hackbench() +{
- # args: groups number, mode [process/thread], times
- local hackbench_path
- if [ -x /lkp/benchmarks/hackbench-git/hackbench/hackbench ]; then
hackbench_path=/lkp/benchmarks/hackbench-git/hackbench/hackbench
- else
echo "The hackbench executable file cannot be found." && exit 1
- fi
hackbench_path=/lkp/benchmarks/hackbench-git/hackbench/hackbench if ! [[ -x "$hackbench_path" ]]; then echo "The hackbench executable file cannot be found." && exit 1 fi
Thanks, Jiaxin
On Thu, Nov 05, 2020 at 05:11:57PM +0800, Lin Jiaxin wrote:
+run_hackbench() +{
- # args: groups number, mode [process/thread], times
- local hackbench_path
- if [ -x /lkp/benchmarks/hackbench-git/hackbench/hackbench ]; then
hackbench_path=/lkp/benchmarks/hackbench-git/hackbench/hackbench
- else
echo "The hackbench executable file cannot be found." && exit 1
- fi
hackbench_path=/lkp/benchmarks/hackbench-git/hackbench/hackbench if ! [[ -x "$hackbench_path" ]]; then echo "The hackbench executable file cannot be found." && exit 1 fi
Thanks, Jiaxin
Good! But 'bin/sh' cannot use '[[ ]]', the way I use can also.
Thanks, Yale
On Thu, Nov 05, 2020 at 05:28:43PM +0800, Zhang Yale wrote:
On Thu, Nov 05, 2020 at 05:11:57PM +0800, Lin Jiaxin wrote:
+run_hackbench() +{
- # args: groups number, mode [process/thread], times
- local hackbench_path
- if [ -x /lkp/benchmarks/hackbench-git/hackbench/hackbench ]; then
hackbench_path=/lkp/benchmarks/hackbench-git/hackbench/hackbench
- else
echo "The hackbench executable file cannot be found." && exit 1
- fi
hackbench_path=/lkp/benchmarks/hackbench-git/hackbench/hackbench if ! [[ -x "$hackbench_path" ]]; then echo "The hackbench executable file cannot be found." && exit 1 fi
Thanks, Jiaxin
Good! But 'bin/sh' cannot use '[[ ]]', the way I use can also.
Thanks, Yale
sh should be if [ ! -x "$hackbench_path" ] you can try it
Thanks, Jiaxin
On Fri, Nov 06, 2020 at 09:44:07AM +0800, Lin Jiaxin wrote:
On Thu, Nov 05, 2020 at 05:28:43PM +0800, Zhang Yale wrote:
On Thu, Nov 05, 2020 at 05:11:57PM +0800, Lin Jiaxin wrote:
+run_hackbench() +{
- # args: groups number, mode [process/thread], times
- local hackbench_path
- if [ -x /lkp/benchmarks/hackbench-git/hackbench/hackbench ]; then
hackbench_path=/lkp/benchmarks/hackbench-git/hackbench/hackbench
- else
echo "The hackbench executable file cannot be found." && exit 1
- fi
hackbench_path=/lkp/benchmarks/hackbench-git/hackbench/hackbench if ! [[ -x "$hackbench_path" ]]; then echo "The hackbench executable file cannot be found." && exit 1 fi
Thanks, Jiaxin
Good! But 'bin/sh' cannot use '[[ ]]', the way I use can also.
Thanks, Yale
sh should be if [ ! -x "$hackbench_path" ] you can try it
Thanks, Jiaxin
Good!
Thanks, Yale