aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests/python_utils
diff options
context:
space:
mode:
authorGravatar Matt Kwong <mattkwong@google.com>2017-05-11 10:29:49 -0700
committerGravatar Matt Kwong <mattkwong@google.com>2017-05-11 10:29:49 -0700
commitd1f40bd3b3ed51e720149d2e27347d60cb76335f (patch)
treeed0107795dfb08c1b31b32807ea279d8db799c3e /tools/run_tests/python_utils
parente2a56e95e2858de2422e09633dbbf7aaabbd0abc (diff)
Make --measure_cpu_costs flag Mac-friendly
Diffstat (limited to 'tools/run_tests/python_utils')
-rwxr-xr-xtools/run_tests/python_utils/jobset.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/run_tests/python_utils/jobset.py b/tools/run_tests/python_utils/jobset.py
index 4e97128d46..c1b1c88f55 100755
--- a/tools/run_tests/python_utils/jobset.py
+++ b/tools/run_tests/python_utils/jobset.py
@@ -255,7 +255,7 @@ class Job(object):
self._start = time.time()
cmdline = self._spec.cmdline
if measure_cpu_costs:
- cmdline = ['time', '--portability'] + cmdline
+ cmdline = ['time', '-p'] + cmdline
try_start = lambda: subprocess.Popen(args=cmdline,
stderr=subprocess.STDOUT,
stdout=self._tempfile,
@@ -307,7 +307,7 @@ class Job(object):
self._state = _SUCCESS
measurement = ''
if measure_cpu_costs:
- m = re.search(r'real ([0-9.]+)\nuser ([0-9.]+)\nsys ([0-9.]+)', stdout())
+ m = re.search(r'real\s+([0-9.]+)\nuser\s+([0-9.]+)\nsys\s+([0-9.]+)', stdout())
real = float(m.group(1))
user = float(m.group(2))
sys = float(m.group(3))