diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2016-08-29 22:48:27 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-03 09:58:30 +0100 |
commit | e69a46a77854fac1169a09e0c5b70fa4b972255a (patch) | |
tree | 4fc13f3c74ffa3c065f1afb2f8a7d47ce787f400 | |
parent | d5ad818dd501b18379aa3540bffa9b920d7c3bab (diff) | |
download | openembedded-core-e69a46a77854fac1169a09e0c5b70fa4b972255a.tar.gz openembedded-core-e69a46a77854fac1169a09e0c5b70fa4b972255a.tar.bz2 openembedded-core-e69a46a77854fac1169a09e0c5b70fa4b972255a.zip |
oeqa.buildperf: measure io stat
Add data from /proc/<pid>/io to system resource measurements.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/buildperf/base.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/meta/lib/oeqa/buildperf/base.py b/meta/lib/oeqa/buildperf/base.py index 5987bfbe4a..95a0abfa5d 100644 --- a/meta/lib/oeqa/buildperf/base.py +++ b/meta/lib/oeqa/buildperf/base.py @@ -340,6 +340,11 @@ class BuildPerfTestCase(unittest.TestCase): ret = runCmd2(cmd, **kwargs) etime = datetime.now() - start_time rusage_struct = resource.getrusage(resource.RUSAGE_CHILDREN) + iostat = {} + with open('/proc/{}/io'.format(os.getpid())) as fobj: + for line in fobj.readlines(): + key, val = line.split(':') + iostat[key] = int(val) rusage = {} # Skip unused fields, (i.e. 'ru_ixrss', 'ru_idrss', 'ru_isrss', # 'ru_nswap', 'ru_msgsnd', 'ru_msgrcv' and 'ru_nsignals') @@ -350,7 +355,8 @@ class BuildPerfTestCase(unittest.TestCase): data_q.put({'ret': ret, 'start_time': start_time, 'elapsed_time': etime, - 'rusage': rusage}) + 'rusage': rusage, + 'iostat': iostat}) except Exception as err: data_q.put(err) @@ -378,7 +384,8 @@ class BuildPerfTestCase(unittest.TestCase): 'legend': legend} measurement['values'] = {'start_time': data['start_time'], 'elapsed_time': etime, - 'rusage': data['rusage']} + 'rusage': data['rusage'], + 'iostat': data['iostat']} self.measurements.append(measurement) # Append to 'times' array for globalres log |