summaryrefslogtreecommitdiffstats
path: root/rteval
diff options
context:
space:
mode:
authorClark Williams <williams@redhat.com>2011-09-14 09:02:24 -0500
committerClark Williams <williams@redhat.com>2011-09-14 09:02:24 -0500
commit57b37f4ff023043fa40ac3db5e42d246917dc1b8 (patch)
treeea3f70478ff8f561098c4eae03ed9adf4c99b665 /rteval
parent555eed11ee25f9ccc801eca94dff33963a275e2a (diff)
downloadrteval-57b37f4ff023043fa40ac3db5e42d246917dc1b8.tar.gz
rteval-57b37f4ff023043fa40ac3db5e42d246917dc1b8.tar.xz
rteval-57b37f4ff023043fa40ac3db5e42d246917dc1b8.zip
changed default built target, refactored a bit in kcompile.py
Modified kernel build commands to use 'mrproper' as setup target and changed build command to just use default (rather than specifying the bzImage and modules targets). Added some debug prints. Signed-off-by: Clark Williams <williams@redhat.com>
Diffstat (limited to 'rteval')
-rw-r--r--rteval/kcompile.py31
1 files changed, 18 insertions, 13 deletions
diff --git a/rteval/kcompile.py b/rteval/kcompile.py
index 89705c5..e4c9034 100644
--- a/rteval/kcompile.py
+++ b/rteval/kcompile.py
@@ -90,7 +90,7 @@ class Kcompile(load.Load):
err = self.open_logfile("kcompile-build.stderr")
# clean up from potential previous run
try:
- ret = subprocess.call(["make", "-C", self.mydir, "distclean", "allmodconfig"],
+ ret = subprocess.call(["make", "-C", self.mydir, "mrproper", "allmodconfig"],
stdin=null, stdout=out, stderr=err)
if ret:
raise RuntimeError, "kcompile setup failed: %d" % ret
@@ -103,13 +103,7 @@ class Kcompile(load.Load):
os.close(out)
os.close(err)
- def runload(self):
- null = os.open("/dev/null", os.O_RDWR)
- if self.logging:
- out = self.open_logfile("kcompile.stdout")
- err = self.open_logfile("kcompile.stderr")
- else:
- out = err = null
+ def calc_numjobs(self):
mult = int(self.params.setdefault('jobspercore', 1))
mem = self.memsize[0]
if self.memsize[1] == 'KB':
@@ -124,21 +118,32 @@ class Kcompile(load.Load):
else:
self.debug("low memory system (%f GB/core)! Dropping jobs to one per core\n" % ratio)
njobs = self.num_cpus
+ return njobs
+
+ def runload(self):
+ null = os.open("/dev/null", os.O_RDWR)
+ if self.logging:
+ out = self.open_logfile("kcompile.stdout")
+ err = self.open_logfile("kcompile.stderr")
+ else:
+ out = err = null
+
+ njobs = self.calc_numjobs()
self.debug("starting loop (jobs: %d)" % njobs)
self.args = ["make", "-C", self.mydir,
- "-j%d" % njobs,
- "clean", "bzImage", "modules"]
+ "-j%d" % njobs ]
p = subprocess.Popen(self.args,
stdin=null,stdout=out,stderr=err)
while not self.stopevent.isSet():
time.sleep(1.0)
if p.poll() != None:
- p.wait()
- self.debug("restarting compile job")
+ r = p.wait()
+ self.debug("restarting compile job (exit status: %s)" % r)
p = subprocess.Popen(self.args,
stdin=null,stdout=out,stderr=err)
- self.debug("stopping")
+ self.debug("out of stopevent loop")
if p.poll() == None:
+ self.debug("killing compile job with SIGTERM")
os.kill(p.pid, SIGTERM)
p.wait()
os.close(null)