Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(452)

Side by Side Diff: client/tests/tracing_microbenchmark/tracers.py

Issue 6246035: Merge remote branch 'cros/upstream' into master (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: patch Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 import os 1 import os
2 from autotest_lib.client.bin import utils 2 from autotest_lib.client.bin import utils
3 3
4 import base_tracer 4 import base_tracer
5 try: 5 try:
6 from site_tracers import * 6 from site_tracers import *
7 except ImportError: 7 except ImportError:
8 pass 8 pass
9 9
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 per_cpu = os.path.join(self.tracing_dir, 'per_cpu') 49 per_cpu = os.path.join(self.tracing_dir, 'per_cpu')
50 for cpu in os.listdir(per_cpu): 50 for cpu in os.listdir(per_cpu):
51 cpu_stats = os.path.join(per_cpu, cpu, 'stats') 51 cpu_stats = os.path.join(per_cpu, cpu, 'stats')
52 for line in utils.read_file(cpu_stats).splitlines(): 52 for line in utils.read_file(cpu_stats).splitlines():
53 key, val = line.split(': ') 53 key, val = line.split(': ')
54 key = key.replace(' ', '_') 54 key = key.replace(' ', '_')
55 val = int(val) 55 val = int(val)
56 cpu_key = '%s_%s' % (cpu, key) 56 cpu_key = '%s_%s' % (cpu, key)
57 total_key = 'total_' + key 57 total_key = 'total_' + key
58 results[cpu_key] = val 58 results[cpu_key] = val
59 results[total_key] = (results.get(total_key, 0) + 59 results[total_key] = (results.get(total_key, 0) +
60 results[cpu_key]) 60 results[cpu_key])
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698