From cb8db5d30ee769304c2c2b00f2a7d9bcb3c4098f Mon Sep 17 00:00:00 2001 From: Jonathan Herman Date: Mon, 26 Nov 2012 16:02:48 -0500 Subject: Removed 2-step parse for scheduling statistics. --- experiment/litmus_util.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'experiment/litmus_util.py') diff --git a/experiment/litmus_util.py b/experiment/litmus_util.py index 42d3e5f..fb2b341 100644 --- a/experiment/litmus_util.py +++ b/experiment/litmus_util.py @@ -6,7 +6,7 @@ import stat import config.config as conf def num_cpus(): - """Return the number of CPUs in the system.""" + '''Return the number of CPUs in the system.''' lnx_re = re.compile(r'^(processor|online)') cpus = 0 @@ -18,9 +18,9 @@ def num_cpus(): return cpus def cpu_freq(): - """ + ''' The frequency (in MHz) of the CPU. - """ + ''' reg = re.compile(r'^cpu MHz\s*:\s*(\d+)', re.M) with open('/proc/cpuinfo', 'r') as f: data = f.read() @@ -31,12 +31,12 @@ def cpu_freq(): return int(match.group(1)) def switch_scheduler(switch_to_in): - """Switch the scheduler to whatever is passed in. + '''Switch the scheduler to whatever is passed in. This methods sleeps for two seconds to give Linux the chance to execute schedule switching code. Raises an exception if the switch does not work. - """ + ''' switch_to = str(switch_to_in).strip() @@ -57,7 +57,7 @@ def uname_matches(reg): return bool( re.match(reg, data) ) def is_executable(fname): - """Return whether the file passed in is executable""" + '''Return whether the file passed in is executable''' mode = os.stat(fname)[stat.ST_MODE] return mode & stat.S_IXUSR and mode & stat.S_IRUSR -- cgit v1.2.2