mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 12:59:02 +02:00
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>
This commit is contained in:
parent
d6c437ff6c
commit
35c3e57686
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue
Block a user