From 73d398dd296609c3a370e38c81df1c1a67ed5053 Mon Sep 17 00:00:00 2001 From: Karol Latecki Date: Wed, 8 Jan 2020 13:40:48 +0100 Subject: [PATCH] test/nvme-perf: refactor preconditing step Move all related steps to common.sh/preconditioning() function so that everything is in one place. Change-Id: I253a185a5c16e9ba31c84aa945f6c3033f80d53f Signed-off-by: Karol Latecki Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/479815 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto Reviewed-by: Maciej Wawryk Reviewed-by: Tomasz Zawadzki --- test/nvme/perf/common.sh | 15 +++++++++------ test/nvme/perf/run_perf.sh | 3 --- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/test/nvme/perf/common.sh b/test/nvme/perf/common.sh index 0a8bdeece..dd1b3eda8 100755 --- a/test/nvme/perf/common.sh +++ b/test/nvme/perf/common.sh @@ -201,25 +201,28 @@ function create_fio_config(){ fi } -function preconditioning(){ +function preconditioning() { local dev_name="" local filename="" - local i - sed -i -e "\$a[preconditioning]" $BASE_DIR/config.fio + local nvme_list + + HUGEMEM=8192 $ROOT_DIR/scripts/setup.sh + cp $BASE_DIR/config.fio.tmp $BASE_DIR/config.fio + echo "[Preconditioning]" >> $BASE_DIR/config.fio # Generate filename argument for FIO. # We only want to target NVMes not bound to nvme driver. # If they're still bound to nvme that means they were skipped by # setup.sh on purpose. - local nvme_list nvme_list=$(get_disks nvme) for nvme in $nvme_list; do dev_name='trtype=PCIe traddr='${nvme//:/.}' ns=1' filename+=$(printf %s":" "$dev_name") done echo "** Preconditioning disks, this can take a while, depending on the size of disks." - run_spdk_nvme_fio "nvme" --filename="$filename" --size=100% --loops=2 --bs=1M\ - --rw=write --iodepth=32 + run_spdk_nvme_fio "nvme" --filename="$filename" --size=100% --loops=2 --bs=1M \ + --rw=write --iodepth=32 --output-format=normal + rm -f $BASE_DIR/config.fio } function get_results(){ diff --git a/test/nvme/perf/run_perf.sh b/test/nvme/perf/run_perf.sh index f70309c65..2ac411172 100755 --- a/test/nvme/perf/run_perf.sh +++ b/test/nvme/perf/run_perf.sh @@ -41,10 +41,7 @@ NO_CORES_ARRAY=($CORES) NO_CORES=${#NO_CORES_ARRAY[@]} if $PRECONDITIONING; then - HUGEMEM=8192 $ROOT_DIR/scripts/setup.sh - cp $BASE_DIR/config.fio.tmp $BASE_DIR/config.fio preconditioning - rm -f $BASE_DIR/config.fio fi #Kernel Classic Polling ioengine parameters