diff options
Diffstat (limited to 'run/litmus_util.py')
-rw-r--r-- | run/litmus_util.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/run/litmus_util.py b/run/litmus_util.py index ec1700e..8a7f87d 100644 --- a/run/litmus_util.py +++ b/run/litmus_util.py | |||
@@ -4,7 +4,6 @@ import subprocess | |||
4 | import os | 4 | import os |
5 | import stat | 5 | import stat |
6 | import config.config as conf | 6 | import config.config as conf |
7 | from common import get_config_option | ||
8 | 7 | ||
9 | def num_cpus(): | 8 | def num_cpus(): |
10 | '''Return the number of CPUs in the system.''' | 9 | '''Return the number of CPUs in the system.''' |
@@ -19,11 +18,12 @@ def num_cpus(): | |||
19 | return cpus | 18 | return cpus |
20 | 19 | ||
21 | def ft_freq(): | 20 | def ft_freq(): |
22 | '''The frequency (in MHz) of the clock used by feather trace.''' | 21 | umachine = subprocess.check_output(["uname", "-m"]) |
23 | if get_config_option('CPU_V7') == 'y': | 22 | |
23 | if re.match("armv7", umachine): | ||
24 | # Arm V7s use a millisecond timer | 24 | # Arm V7s use a millisecond timer |
25 | freq = 1000.0 | 25 | freq = 1000.0 |
26 | elif get_config_option('X86') == 'y': | 26 | elif re.match("x86", umachine): |
27 | # X86 timer is equal to processor clock | 27 | # X86 timer is equal to processor clock |
28 | reg = re.compile(r'^cpu MHz\s*:\s*(?P<FREQ>\d+)', re.M) | 28 | reg = re.compile(r'^cpu MHz\s*:\s*(?P<FREQ>\d+)', re.M) |
29 | with open('/proc/cpuinfo', 'r') as f: | 29 | with open('/proc/cpuinfo', 'r') as f: |
@@ -76,7 +76,7 @@ def is_device(dev): | |||
76 | return not (not mode & stat.S_IFCHR) | 76 | return not (not mode & stat.S_IFCHR) |
77 | 77 | ||
78 | def waiting_tasks(): | 78 | def waiting_tasks(): |
79 | reg = re.compile(r'^ready.*(?P<READY>\d+)$', re.M) | 79 | reg = re.compile(r'^ready.*?(?P<READY>\d+)$', re.M) |
80 | with open('/proc/litmus/stats', 'r') as f: | 80 | with open('/proc/litmus/stats', 'r') as f: |
81 | data = f.read() | 81 | data = f.read() |
82 | 82 | ||