Commit 3f7f19cb authored by Jim Harris's avatar Jim Harris
Browse files

test/blobfs/run_tests: rework perf checks



Change NO_PERF to USE_PERF which defaults to 1.  This
will be overridden to 0 if set to 0 in the environment
or perf is not available on the system.

While here, disable perf in the automated test suite.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: Ia182f6a3068d0da631973d4010dce24bd0f98eb5
parent d827cfbd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ cp $rootdir/etc/spdk/rocksdb.conf.in $ROCKSDB_CONF
$rootdir/scripts/gen_nvme.sh >> $ROCKSDB_CONF

$rootdir/test/lib/blobfs/mkfs/mkfs $ROCKSDB_CONF Nvme0n1
DURATION=30 NUM_KEYS=50000000 ROCKSDB_CONF=$ROCKSDB_CONF CACHE_SIZE=1024 $testdir/run_tests.sh $DB_BENCH
USE_PERF=0 DURATION=30 NUM_KEYS=50000000 ROCKSDB_CONF=$ROCKSDB_CONF CACHE_SIZE=1024 $testdir/run_tests.sh $DB_BENCH
mkdir $output_dir/rocksdb
cp $testdir/results/last/* $output_dir/rocksdb

+4 −3
Original line number Diff line number Diff line
@@ -11,8 +11,9 @@ DB_BENCH=$(readlink -f $1)
[ -e $DB_BENCH ] || (echo "$DB_BENCH does not exist - needs to be built" && exit 1)

hash mkfs.xfs
: ${USE_PERF:=1}
if ! hash perf; then
	NO_PERF=1
	USE_PERF=0
fi
hash python
[ -e /usr/include/gflags/gflags.h ] || (echo "gflags not installed." && exit 1)
@@ -133,7 +134,7 @@ run_step() {
	fi

	echo -n Start $1 test phase...
	if [ "$NO_PERF" = "1" ]
	if [ "$USE_PERF" = "1" ]
	then
		sudo /usr/bin/time taskset 0xFFF perf record $DB_BENCH --flagfile="$1"_flags.txt &> "$1"_db_bench.txt
	else
@@ -146,7 +147,7 @@ run_step() {
	  cat /sys/block/nvme0n1/stat >> "$1"_blockdev_stats.txt
	fi

	if [ "$NO_PERF" = "1" ]
	if [ "$USE_PERF" = "1" ]
	then
		echo -n Generating perf report for $1 test phase...
		sudo perf report -f -n | sed '/#/d' | sed '/%/!d' | sort -r > $1.perf.txt