Spdk/test/bdev/bdevperf/common.sh
Krzysztof Karas 29784f35cd bdevperf: promote bdevperf from test to example application
bdevperf application is utilized in multiple test scenarios
and most prominently in SPDK performance reports.
Similar to perf and fio_plugins, it is used to measure performance.
It is intended to represent the expected behavior of users
application that use SPDK bdev layer.

Applications under --enable-tests are intended for specific test
scenarios and user interaction is usually via a test scripts.
Meanwhile --enable-examples are used more broadly to teach and
show usage of SPDK libraries.

As an added benefit with this patch, its possible to compile
bdevperf without need to satisfy additional requirements to
compile all the test applications.

Change-Id: I9aaec1f9d729a1cdee89b5fdc365d61c19b03f82
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14558
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2022-11-16 09:52:41 +00:00

34 lines
583 B
Bash

bdevperf=$rootdir/build/examples/bdevperf
function create_job() {
local job_section=$1
local rw=$2
local filename=$3
if [[ $job_section == "global" ]]; then
cat <<- EOF >> "$testdir"/test.conf
[global]
filename=${filename}
EOF
fi
job="[${job_section}]"
echo $global
cat <<- EOF >> "$testdir"/test.conf
${job}
filename=${filename}
bs=1024
rwmixread=70
rw=${rw}
iodepth=256
cpumask=0xff
EOF
}
function get_num_jobs() {
echo "$1" | grep -oE "Using job config with [0-9]+ jobs" | grep -oE "[0-9]+"
}
function cleanup() {
rm -f $testdir/test.conf
}