diff options
author | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2014-03-20 19:00:39 +0000 |
---|---|---|
committer | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2014-03-20 19:00:39 +0000 |
commit | 6782cc58652bab51ad7a8c9ed7d5c92c37385f79 (patch) | |
tree | b72c9f7f305211bcbf52761260c7d8d933c50b31 | |
parent | ccd19321c1a9f6a51d4c756a42d07dfced3cb740 (diff) |
added postprocessing task on the host
-rwxr-xr-x | postprocessing.py | 50 | ||||
-rwxr-xr-x | run-workload.sh | 1 |
2 files changed, 50 insertions, 1 deletions
diff --git a/postprocessing.py b/postprocessing.py new file mode 100755 index 0000000..d82e2bf --- /dev/null +++ b/postprocessing.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python +import sqlite3 +from numpy import array, mean +from optparse import OptionParser + +SQLITE_DB_GLOBAL_PATH = "/root/db_results/" + +modes_prepares_statement = "select distinct(id) from workload_specs;" +metric_prepared_statement = """SELECT label as workload, metric, value, units, wsr.spec_id +FROM metrics AS m INNER JOIN ( +SELECT ws.OID as spec_oid, ws.id as spec_id, uuid, label +FROM workload_specs AS ws INNER JOIN runs AS r ON ws.run_oid = r.OID +) AS wsr ON wsr.spec_oid = m.spec_oid +WHERE metric = ? AND spec_id = ?;""" + +metrics_common = ['execution_time', 'arm,vexpress-energy A7 Jcore', 'arm,vexpress-energy A15 Jcore'] +metrics_bbench = ['Performance'] + +if __name__ == '__main__': + + usage = "usage: %prog [OPTIONS]" + parser = OptionParser(usage=usage) + parser.add_option("-n", "--job-name", dest="job_name", + help="Job name to be used as db name in agenda file") + (options, args) = parser.parse_args() + + if not options.job_name: + parser.error("Job name missing") + + conn = sqlite3.connect(SQLITE_DB_GLOBAL_PATH + options.job_name + ".db") + modes_cursor = conn.cursor() + for mode_row in modes_cursor.execute(modes_prepares_statement): + if 'bbench' in mode_row[0]: + metrics_common = metrics_common + metrics_bbench + for metric in metrics_common: + params = (metric, mode_row[0]) + metric_values = [] + metric_cursor = conn.cursor() + units = "" + for metric_row in metric_cursor.execute(metric_prepared_statement, params): + metric_values.append(float(metric_row[2])) + units = metric_row[3] + print "%s_%s Measurement:%s Units:%s Result:pass" % ( + mode_row[0], + metric.replace(" ", "_").replace(",", "_"), + mean(array(metric_values)), + units) + metric_cursor.close() + modes_cursor.close() + conn.close() diff --git a/run-workload.sh b/run-workload.sh index 079696d..75a930a 100755 --- a/run-workload.sh +++ b/run-workload.sh @@ -16,7 +16,6 @@ echo -e "CPU status" echo -e "**********************\n" IPADDR=`cat IPADDR` adb -s $IPADDR:5555 shell "cat /proc/cpuinfo" -adb -s $IPADDR:5555 shell "ls /sys/devices/system/cpu/" echo -n "online: " adb -s $IPADDR:5555 shell "cat /sys/devices/system/cpu/online" echo -n "offline: " |