summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClark Williams <williams@redhat.com>2010-02-11 12:43:12 -0600
committerClark Williams <williams@redhat.com>2010-02-11 12:43:12 -0600
commitbf688dd2a74b5ca7cba2488c135c164f31f4f15b (patch)
tree3de0ef334aaa911ea30094dcdb94ebc86f46ee0c
parent6956c5757efdf434073428a5d9ff24ee7c55803c (diff)
downloadrteval-bf688dd2a74b5ca7cba2488c135c164f31f4f15b.tar.gz
rteval-bf688dd2a74b5ca7cba2488c135c164f31f4f15b.tar.xz
rteval-bf688dd2a74b5ca7cba2488c135c164f31f4f15b.zip
reworked NUMA logic and added time remaining output
Reworked the NUMA code by passing the nodes detected from rteval into cyclictest (removing globbing code from cyclictest). Also added a countdown report (configurable interval) that prints to standard output the time remaining for the test. Defaults to 10 minute interval. Signed-off-by: Clark Williams <williams@redhat.com>
-rw-r--r--rteval/cyclictest.py12
-rw-r--r--rteval/rteval.conf3
-rw-r--r--rteval/rteval.py31
3 files changed, 34 insertions, 12 deletions
diff --git a/rteval/cyclictest.py b/rteval/cyclictest.py
index 12ca4e8..5a3ffbf 100644
--- a/rteval/cyclictest.py
+++ b/rteval/cyclictest.py
@@ -158,7 +158,7 @@ class RunData(object):
class Cyclictest(Thread):
def __init__(self, duration=None, priority = 95,
outfile = None, threads = None, debugging=False,
- keepdata = False, params={}):
+ keepdata = False, params={}, numnodes=0):
Thread.__init__(self)
self.duration = duration
self.keepdata = keepdata
@@ -187,6 +187,7 @@ class Cyclictest(Thread):
self.dataitems = len(self.data.keys())
self.debug("system has %d cpu cores" % (self.dataitems - 1))
self.numcores = numcores
+ self.numnodes = numnodes
def __del__(self):
pass
@@ -195,10 +196,11 @@ class Cyclictest(Thread):
if self.debugging: print "cyclictest: %s" % str
def getmode(self):
- from glob import glob
- if len(glob('/sys/devices/system/node/node*')) > 1:
- return "--numa"
- return "--smp"
+ if self.numnodes > 1:
+ self.debug("running in NUMA mode (%d nodes)" % self.numnodes)
+ return '--numa'
+ self.debug("running in SMP mode")
+ return '--smp'
def run(self):
if self.params.has_key('buckets'):
diff --git a/rteval/rteval.conf b/rteval/rteval.conf
index 6a5ffae..e0e0201 100644
--- a/rteval/rteval.conf
+++ b/rteval/rteval.conf
@@ -1,10 +1,9 @@
[rteval]
-#workdir: .
-#srcdir: /usr/share/rteval-<version>/loadsource
verbose: False
keepdata: True
debugging: False
duration: 60.0
+report_interval: 600
[cyclictest]
buckets: 2000
diff --git a/rteval/rteval.py b/rteval/rteval.py
index 640b49c..5177307 100644
--- a/rteval/rteval.py
+++ b/rteval/rteval.py
@@ -78,7 +78,8 @@ class RtEval(object):
'installdir' : '/usr/share/rteval',
'srcdir' : '/usr/share/rteval/loadsource',
'xmlrpc' : None,
- 'xslt_report': '/usr/share/rteval/rteval_text.xsl'
+ 'xslt_report': '/usr/share/rteval/rteval_text.xsl',
+ 'report_interval': '600',
},
'loads' : {
'kcompile' : 'module',
@@ -466,12 +467,11 @@ class RtEval(object):
while not ready:
busy = 0
for l in self.loads:
- self.debug("checking load: %s" % l.name)
if not l.isAlive():
raise RuntimeError, "%s died" % l.name
if not l.isReady():
busy += 1
- self.debug("%s is busy" % l.name)
+ self.debug("waiting for %s" % l.name)
if busy:
time.sleep(1.0)
else:
@@ -508,6 +508,16 @@ class RtEval(object):
shutil.copyfile(dpath, os.path.join(self.reportdir, "dmesg"))
+ def show_remaining_time(self, t):
+ days = t / 86400
+ t -= days
+ hours = t / 3600
+ t -= hours
+ minutes = t / 60
+ t -= minutes
+ print "rteval time remaining: %d days, %d hours, %d minutes, %d seconds" % (
+ days, hours, minutes, t)
+
def measure(self):
# Collect misc system info
self.baseos = self.get_base_os()
@@ -543,7 +553,8 @@ class RtEval(object):
self.info("setting up cyclictest")
self.cyclictest = cyclictest.Cyclictest(duration=self.config.duration,
debugging=self.config.debugging,
- params=self.config.GetSection('cyclictest'))
+ params=self.config.GetSection('cyclictest'),
+ numnodes = self.numanodes)
nthreads = 0
try:
@@ -571,10 +582,14 @@ class RtEval(object):
accum = 0.0
samples = 0
+ report_interval = int(self.config.GetSection('rteval').report_interval)
+
# wait for time to expire or thread to die
self.info("waiting for duration (%f)" % self.config.duration)
stoptime = (time.time() + self.config.duration)
- while time.time() <= stoptime:
+ currtime = time.time()
+ rpttime = currtime + report_interval
+ while currtime <= stoptime:
time.sleep(1.0)
if not self.cyclictest.isAlive():
raise RuntimeError, "cyclictest thread died!"
@@ -583,6 +598,12 @@ class RtEval(object):
p.seek(0)
accum += float(p.readline().split()[0])
samples += 1
+ if currtime >= rpttime:
+ left = stoptime - currtime
+ self.show_remaining_time(left)
+ rpttime = currtime + report_interval
+ currtime = time.time()
+
finally:
# stop cyclictest