aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2017-03-23 15:56:22 +0200
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2017-03-31 16:29:05 +0300
commit2dc00c76df28d9b223c7bf779ff0d472e18f8d0d (patch)
tree4856de6e9e00561ec9ea937b6c88149ccc62ba6c
parentc323306b65cee8e8b5989db0dc4a404f8d8ffcfa (diff)
downloadopenembedded-core-contrib-2dc00c76df28d9b223c7bf779ff0d472e18f8d0d.tar.gz
openembedded-core-contrib-2dc00c76df28d9b223c7bf779ff0d472e18f8d0d.tar.bz2
openembedded-core-contrib-2dc00c76df28d9b223c7bf779ff0d472e18f8d0d.zip
build-perf-git-import.py: optimize buildstats by summing rusage
Store sum of rusage and child_rusage instead of separate values. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rwxr-xr-xscripts/contrib/build-perf-git-import.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/scripts/contrib/build-perf-git-import.py b/scripts/contrib/build-perf-git-import.py
index e0a6c3f41dc..7f414af613e 100755
--- a/scripts/contrib/build-perf-git-import.py
+++ b/scripts/contrib/build-perf-git-import.py
@@ -311,17 +311,10 @@ def time_log_to_json(time_log):
def optimize_buildstat_task(task_data):
"""Optimize JSON formatted buildstat task data"""
- if 'iostat' in task_data:
- optimized = [task_data['iostat'][k] for k in BS_IOSTAT_FIELDS]
- task_data['iostat'] = optimized
-
- if 'rusage' in task_data:
- optimized = [task_data['rusage'][k] for k in BS_RUSAGE_FIELDS]
- task_data['rusage'] = optimized
-
if 'child_rusage' in task_data:
- optimized = [task_data['child_rusage'][k] for k in BS_RUSAGE_FIELDS]
- task_data['child_rusage'] = optimized
+ for key, val in task_data['child_rusage'].items():
+ task_data['rusage'][key] += val
+ del(task_data['child_rusage'])
def optimize_buildstats(buildstats):
"""Optimize buildstats data"""
@@ -357,7 +350,7 @@ def combine_buildstats_files(results_data, results_dir):
measurement['values']['buildstats_file'])
with open(buildstats_file) as fobj:
meas_bs = json.load(fobj, object_pairs_hook=OrderedDict)
- #optimize_buildstats(meas_bs)
+ optimize_buildstats(meas_bs)
bs_key = test['name'] + '.' + measurement['name']
buildstats[bs_key] = meas_bs