aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-kernel/cryptodev/sdk_patches/0060-more-precision-in-running-mpstat.patch
blob: ae749bdca733a99818487168221209386ae27d4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
From 26291db7df602d3d3d5601817229822b13904fe9 Mon Sep 17 00:00:00 2001
From: Cristian Stoica <cristian.stoica@nxp.com>
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 <cristian.stoica@nxp.com>
---
 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