diff options
author | Anders Roxell <anders.roxell@linaro.org> | 2013-10-04 16:42:36 +0200 |
---|---|---|
committer | Linaro Code Review <review@review.linaro.org> | 2013-10-24 07:18:44 +0000 |
commit | 1ef4f1dd009d980736ae901e45ae03f860109236 (patch) | |
tree | d52c137099d0f86e2d37c15c82dae2cc5af50ad3 /common | |
parent | 2132db61391a194ce1ba68741b8db9a5365943c8 (diff) |
added lmbench and generalize hackbench_parse script2013.10
1. move hackbench_parse.py to common/scripts/min_max_avg_parsh.sh
and try to generalize it so lmbench can use it as well.
2. add new lmbench.yaml file to OE
Change-Id: I9ce50fb5830d2f1a6f45ca043f93da70f32041b1
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Diffstat (limited to 'common')
-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 |