diff options
Diffstat (limited to 'common/scripts')
-rwxr-xr-x | common/scripts/lmbench.sh | 12 | ||||
-rwxr-xr-x | common/scripts/min_max_avg_parse.py | 33 | ||||
-rwxr-xr-x | common/scripts/parse_lmbench.sh | 15 |
3 files changed, 60 insertions, 0 deletions
diff --git a/common/scripts/lmbench.sh b/common/scripts/lmbench.sh new file mode 100755 index 0000000..e985f1d --- /dev/null +++ b/common/scripts/lmbench.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +echo "BEGIN LMBENCH" +for i in $(seq 1 1000) +do + echo "lat_ctx iteration number $i " + /usr/bin/lat_ctx -s 64 2 + /usr/bin/lat_ctx -s 64 8 + /usr/bin/lat_ctx -s 64 16 + /usr/bin/lat_ctx -s 64 20 +done +echo "END LMBENCH" diff --git a/common/scripts/min_max_avg_parse.py b/common/scripts/min_max_avg_parse.py new file mode 100755 index 0000000..7518049 --- /dev/null +++ b/common/scripts/min_max_avg_parse.py @@ -0,0 +1,33 @@ +#!/usr/bin/python + +import re +import sys +from numpy import * + +values = [] + +r = re.compile(sys.argv[2]+"\s+(?P<measurement>[0-9.])") +f = open(sys.argv[1], "r") +for line in f.readlines(): + search = r.search(line) + if search: + values.append(float(search.group('measurement'))) + +if "hackbench" in sys.argv[1]: + # Usually the first value is inexplicably high + values.pop(0) + +try: + sys.argv[4] +except IndexError: + cmd_options = "" +else: + cmd_options = sys.argv[4] + +np_array = array(values) + +format = "%-16s%-16s%-16s%-16s" +print format % (sys.argv[1].split('.', 1)[0]+cmd_options+"_min:", str(min(np_array)), sys.argv[3], "pass") +print format % (sys.argv[1].split('.', 1)[0]+cmd_options+"_max:", str(max(np_array)), sys.argv[3], "pass") +print format % (sys.argv[1].split('.', 1)[0]+cmd_options+"_avg:", str(mean(np_array)), sys.argv[3], "pass") +print format % (sys.argv[1].split('.', 1)[0]+cmd_options+"_mdn:", str(median(np_array)), sys.argv[3], "pass") diff --git a/common/scripts/parse_lmbench.sh b/common/scripts/parse_lmbench.sh new file mode 100755 index 0000000..1036b69 --- /dev/null +++ b/common/scripts/parse_lmbench.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +LOG_FILE=$1 +OUTPUT_FILE=$3 +TMP_FILE="$1.$$" +BEGIN=$(grep -n "^BEGIN LMBENCH" $LOG_FILE | awk -F ':' '{print $1}') +END=$(grep -n "^END LMBENCH" $LOG_FILE | awk -F ':' '{print $1}') +BEGINNING=$(expr $(expr $END - $BEGIN) + 1) +head -n $END $LOG_FILE | tail -n $BEGINNING >$TMP_FILE + +for i in 2 8 16 20 +do + ./common/scripts/min_max_avg_parse.py $TMP_FILE "^$i" $2 "64_$i" >>$OUTPUT_FILE +done +rm $TMP_FILE |