[gnome-continuous-yocto/gnomeostree-3.28-rocko: 5966/8267] scripts/buildstats-diff: support optimized rusage values
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 5966/8267] scripts/buildstats-diff: support optimized rusage values
- Date: Sun, 17 Dec 2017 04:10:51 +0000 (UTC)
commit 35c3e57686f6a29d9690c68dd43fc4d35dc1c43b
Author: Markus Lehtonen <markus lehtonen linux intel com>
Date: Mon May 15 14:18:45 2017 +0300
scripts/buildstats-diff: support optimized rusage values
Buildstats from oe-build-perf-test results have been optimized to not
have child rusage values at all. There, rusage is the sum of parent and
child rusage values. This patch makes buildstats-diff compatible with
this format.
[YOCTO #11355]
(From OE-Core rev: 496a9dc179fe9dc370c940f4a2f7bcab869a804f)
Signed-off-by: Markus Lehtonen <markus lehtonen linux intel com>
Signed-off-by: Ross Burton <ross burton intel com>
Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>
scripts/buildstats-diff | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/scripts/buildstats-diff b/scripts/buildstats-diff
index adeba44..4276464 100755
--- a/scripts/buildstats-diff
+++ b/scripts/buildstats-diff
@@ -52,8 +52,12 @@ class BSTask(dict):
@property
def cputime(self):
"""Sum of user and system time taken by the task"""
- return self['rusage']['ru_stime'] + self['rusage']['ru_utime'] + \
- self['child_rusage']['ru_stime'] + self['child_rusage']['ru_utime']
+ rusage = self['rusage']['ru_stime'] + self['rusage']['ru_utime']
+ if self['child_rusage']:
+ # Child rusage may have been optimized out
+ return rusage + self['child_rusage']['ru_stime'] + self['child_rusage']['ru_utime']
+ else:
+ return rusage
@property
def walltime(self):
@@ -73,12 +77,20 @@ class BSTask(dict):
@property
def read_ops(self):
"""Number of read operations on the block layer"""
- return self['rusage']['ru_inblock'] + self['child_rusage']['ru_inblock']
+ if self['child_rusage']:
+ # Child rusage may have been optimized out
+ return self['rusage']['ru_inblock'] + self['child_rusage']['ru_inblock']
+ else:
+ return self['rusage']['ru_inblock']
@property
def write_ops(self):
"""Number of write operations on the block layer"""
- return self['rusage']['ru_oublock'] + self['child_rusage']['ru_oublock']
+ if self['child_rusage']:
+ # Child rusage may have been optimized out
+ return self['rusage']['ru_oublock'] + self['child_rusage']['ru_oublock']
+ else:
+ return self['rusage']['ru_oublock']
def read_buildstats_file(buildstat_file):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]