From 26291db7df602d3d3d5601817229822b13904fe9 Mon Sep 17 00:00:00 2001 From: Cristian Stoica Date: Wed, 26 Oct 2016 09:48:44 +0300 Subject: [PATCH 060/104] more precision in running mpstat Start mpstat one second later than the tests so we don't measure transient issues. Likewise, stop mpstat just before the tests terminate so we don't record incorrect CPU idle. Signed-off-by: Cristian Stoica --- tests/async_speed_multi.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/async_speed_multi.sh b/tests/async_speed_multi.sh index a28f72d..5268c86 100755 --- a/tests/async_speed_multi.sh +++ b/tests/async_speed_multi.sh @@ -22,7 +22,6 @@ NUM_CORES=`nproc` OUT_BASENAME="async_speed" S_TIME_FORMAT=ISO -MPSTAT="mpstat" MPSTAT_OUT="mpstat_out" function usage @@ -47,7 +46,6 @@ function get_cpu_idle { header_line=`grep %idle ${MPSTAT_OUT} | head -n 1 | sed 's/\s\+/ /g'` idle_column=`echo $header_line | wc -w` - average_idle=`grep Average ${MPSTAT_OUT} | sed 's/\s\+/ /g' | cut -d' ' -f ${idle_column} | tail -n 1` echo $average_idle @@ -63,7 +61,7 @@ function run_parallel echo "Running $mvalue threads in parallel:" echo " $CMD" - $MPSTAT 1 $(($tvalue-1)) &> $MPSTAT_OUT & + (sleep 1; mpstat 1 $(($tvalue-2))) &> $MPSTAT_OUT & MPSTAT_PID=$! PIDS="" @@ -126,6 +124,8 @@ function main [ -z "$mvalue" ] && mvalue=`nproc` # thread count defaults to nproc [ -z "$nvalue" ] && nvalue=256 # 256 bytes default buffer size + [ "$tvalue" -lt 5 ] && tvalue=5 + case "$alg_name" in "null" |\ "aes-128-cbc" |\ -- 2.10.2