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:42 +0100 |
commit | f1fb013d48602805e9b28a3a00c2e05fcf07612f (patch) | |
tree | a94e736417d78266caa5d38d64013226f622bed6 /meta/lib/oeqa/buildperf/base.py | |
parent | 0b332039ea445ff03b172bc19c38457b7535df0e (diff) | |
download | poky-f1fb013d48602805e9b28a3a00c2e05fcf07612f.tar.gz |
oeqa.buildperf: measure io stat
Add data from /proc/<pid>/io to system resource measurements.
(From OE-Core rev: e69a46a77854fac1169a09e0c5b70fa4b972255a)
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/buildperf/base.py')
-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): | |||
340 | ret = runCmd2(cmd, **kwargs) | 340 | ret = runCmd2(cmd, **kwargs) |
341 | etime = datetime.now() - start_time | 341 | etime = datetime.now() - start_time |
342 | rusage_struct = resource.getrusage(resource.RUSAGE_CHILDREN) | 342 | rusage_struct = resource.getrusage(resource.RUSAGE_CHILDREN) |
343 | iostat = {} | ||
344 | with open('/proc/{}/io'.format(os.getpid())) as fobj: | ||
345 | for line in fobj.readlines(): | ||
346 | key, val = line.split(':') | ||
347 | iostat[key] = int(val) | ||
343 | rusage = {} | 348 | rusage = {} |
344 | # Skip unused fields, (i.e. 'ru_ixrss', 'ru_idrss', 'ru_isrss', | 349 | # Skip unused fields, (i.e. 'ru_ixrss', 'ru_idrss', 'ru_isrss', |
345 | # 'ru_nswap', 'ru_msgsnd', 'ru_msgrcv' and 'ru_nsignals') | 350 | # 'ru_nswap', 'ru_msgsnd', 'ru_msgrcv' and 'ru_nsignals') |
@@ -350,7 +355,8 @@ class BuildPerfTestCase(unittest.TestCase): | |||
350 | data_q.put({'ret': ret, | 355 | data_q.put({'ret': ret, |
351 | 'start_time': start_time, | 356 | 'start_time': start_time, |
352 | 'elapsed_time': etime, | 357 | 'elapsed_time': etime, |
353 | 'rusage': rusage}) | 358 | 'rusage': rusage, |
359 | 'iostat': iostat}) | ||
354 | except Exception as err: | 360 | except Exception as err: |
355 | data_q.put(err) | 361 | data_q.put(err) |
356 | 362 | ||
@@ -378,7 +384,8 @@ class BuildPerfTestCase(unittest.TestCase): | |||
378 | 'legend': legend} | 384 | 'legend': legend} |
379 | measurement['values'] = {'start_time': data['start_time'], | 385 | measurement['values'] = {'start_time': data['start_time'], |
380 | 'elapsed_time': etime, | 386 | 'elapsed_time': etime, |
381 | 'rusage': data['rusage']} | 387 | 'rusage': data['rusage'], |
388 | 'iostat': data['iostat']} | ||
382 | self.measurements.append(measurement) | 389 | self.measurements.append(measurement) |
383 | 390 | ||
384 | # Append to 'times' array for globalres log | 391 | # Append to 'times' array for globalres log |