test/nvme_perf: allow CPU list from file

Read CPU list to use in test directly from option
value of from a file if it's an existing path.
This will make running tests in CI a bit easier.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I174a38ab615c2f2cd2c3b4a95e0ebf886c478a51
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3333
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Karol Latecki 2020-07-14 11:43:07 +02:00 committed by Tomasz Zawadzki
parent ae4c75b20d
commit 30491c4675

View File

@ -527,7 +527,8 @@ function usage() {
echo " --bdev-io-pool-size Set IO pool size for for SPDK bdev subsystem."
echo " --max-disk=INT,ALL Number of disks to test on, this will run multiple workloads with increasing number of disk each run."
echo " If =ALL then test on all found disk. [default=$DISKNO]"
echo " --cpu-allowed=INT Comma-separated list of CPU cores used to run the workload. [default=$CPUS_ALLOWED]"
echo " --cpu-allowed=INT/PATH Comma-separated list of CPU cores used to run the workload. Ranges allowed."
echo " Can also point to a file containing list of CPUs. [default=$CPUS_ALLOWED]"
echo " --no-preconditioning Skip preconditioning"
echo " --no-io-scaling Do not scale iodepth for each device in SPDK fio plugin. [default=$NOIOSCALING]"
set -x
@ -561,7 +562,12 @@ while getopts 'h-:' optchar; do
bdev-io-cache-size=*) BDEV_CACHE="${OPTARG#*=}" ;;
bdev-io-pool-size=*) BDEV_POOL="${OPTARG#*=}" ;;
max-disk=*) DISKNO="${OPTARG#*=}" ;;
cpu-allowed=*) CPUS_ALLOWED="${OPTARG#*=}" ;;
cpu-allowed=*)
CPUS_ALLOWED="${OPTARG#*=}"
if [[ -f "$CPUS_ALLOWED" ]]; then
CPUS_ALLOWED=$(cat "$CPUS_ALLOWED")
fi
;;
no-preconditioning) PRECONDITIONING=false ;;
no-io-scaling) NOIOSCALING=true ;;
*)