aboutsummaryrefslogtreecommitdiffstats
path: root/common.py
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-02-17 15:02:15 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-02-17 15:02:15 -0500
commit649b64013619f67160fd289b208189b88e6196fa (patch)
tree4198c160a8ff83f0976e8e125c0d796db19985fb /common.py
parentea121dd26076998ffdc89792f62da5d585a1f35c (diff)
Save feather-trace timer frequency, not CPU frequency, with each experiment.
Diffstat (limited to 'common.py')
-rw-r--r--common.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/common.py b/common.py
index ad3c418..6d1db97 100644
--- a/common.py
+++ b/common.py
@@ -33,12 +33,14 @@ def get_executable(prog, hint, optional=False):
33def get_config_option(option): 33def get_config_option(option):
34 '''Search for @option in installed kernel config (if present). 34 '''Search for @option in installed kernel config (if present).
35 Raise an IOError if the kernel config isn't found in /boot/.''' 35 Raise an IOError if the kernel config isn't found in /boot/.'''
36 uname = subprocess.check_output(["uname", "-r"])[-1] 36 uname = subprocess.check_output(["uname", "-r"]).strip()
37 fname = "/boot/config-%s" % uname 37 fname = "/boot/config-%s" % uname
38 38
39 if os.path.exists(fname): 39 if os.path.exists(fname):
40 config_regex = "^CONFIG_{}=(?P<val>.*)$".format(option) 40 config_regex = "^CONFIG_{}=(?P<val>.*)$".format(option)
41 match = re.search(config_regex, open(fname, 'r').read()) 41 with open(fname, 'r') as f:
42 data = f.read()
43 match = re.search(config_regex, data, re.M)
42 if not match: 44 if not match:
43 return None 45 return None
44 else: 46 else: