OLD | NEW |
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 Loading... |
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]) |
OLD | NEW |