aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilosz Wasilewski <milosz.wasilewski@linaro.org>2015-08-19 13:02:08 +0100
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2015-08-19 13:02:08 +0100
commit41441ed02a3a7fbeb54419c168fc855d5dcb8c66 (patch)
treef4cdfb66501a461435b8845f8f26989b162e9917
parentd7ce7bb52311c9242345d2b5fc16baa8b670ccb4 (diff)
Postprocessing: fixed passing parameters from JSON to YAML2015.08
Change-Id: I9a477131ca597f58d689045051d0dfcb7ec09ca7 Signed-off-by: Milosz Wasilewski <milosz.wasilewski@linaro.org>
-rwxr-xr-xpostprocessing.py24
-rw-r--r--wa2host_postprocessing.yaml2
2 files changed, 17 insertions, 9 deletions
diff --git a/postprocessing.py b/postprocessing.py
index 487353e..1f208c6 100755
--- a/postprocessing.py
+++ b/postprocessing.py
@@ -98,8 +98,14 @@ if __name__ == '__main__':
if not options.job_name:
parser.error("Job name missing")
+ print "job name: %s" % options.job_name
+ print "consolidation label list: %s" % options.consolidation_label_list
+ print "energy label list: %s" % options.energy_label_list
+ print "consolidation workload: %s" % options.consolidation_workload
+ print "reference mode: %s" % options.reference_mode
+ print "path: %s" % options.global_data_path
+
ref_mode = "%%%s%%" % options.reference_mode
- print ref_mode
consolidation_label_list = options.consolidation_label_list.split(";")
energy_label_list = options.energy_label_list.split(";")
@@ -141,11 +147,13 @@ if __name__ == '__main__':
energy_dict[row['spec_id']] = {ENERGY: row['mean_value']}
if options.reference_mode in row['spec_id']:
ref_energy = row['mean_value']
- for row in energy_cursor.execute(energy_prepared_statement % ('?'), ("execution_time",)):
- energy_dict[row['spec_id']].update({TIME: row['mean_value']})
- if options.reference_mode in row['spec_id']:
- ref_time = row['mean_value']
+ if energy_dict:
+ for row in energy_cursor.execute(energy_prepared_statement % ('?'), ("execution_time",)):
+ energy_dict[row['spec_id']].update({TIME: row['mean_value']})
+ if options.reference_mode in row['spec_id']:
+ ref_time = row['mean_value']
energy_cursor.close()
- ref_power = float(ref_energy)/float(ref_time)
- for key, value in energy_dict.iteritems():
- print "Relative_power_%s Measurement:%s Units:%% Result:pass" % (key, 100*((value[ENERGY]/value[TIME])/ref_power))
+ if ref_energy and ref_time:
+ ref_power = float(ref_energy)/float(ref_time)
+ for key, value in energy_dict.iteritems():
+ print "Relative_power_%s Measurement:%s Units:%% Result:pass" % (key, 100*((value[ENERGY]/value[TIME])/ref_power))
diff --git a/wa2host_postprocessing.yaml b/wa2host_postprocessing.yaml
index 0326808..bd82afa 100644
--- a/wa2host_postprocessing.yaml
+++ b/wa2host_postprocessing.yaml
@@ -27,7 +27,7 @@ params:
run:
steps:
- lava-test-run-attach $DB_PATH$JOB_NAME.db
- - ./postprocessing.py --job-name $JOB_NAME --consolidation-label-list $CONSOLIDATION_LABELS --energy-label-list $ENERGY_LABELS --workload $CONSOLIDATION_WORKLOAD --mode $REFERENCE_MODE --path $DB_PATH
+ - ./postprocessing.py --job-name "$JOB_NAME" --consolidation-label-list "$CONSOLIDATION_LABELS" --energy-label-list "$ENERGY_LABELS" --workload "$CONSOLIDATION_WORKLOAD" --mode "$REFERENCE_MODE" --path "$DB_PATH"
- "if [ $DELETE_DB != 'false' ]; then rm $DB_PATH$JOB_NAME.db; fi"
parse: