summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClark Williams <williams@redhat.com>2011-09-14 09:02:24 -0500
committerDavid Sommerseth <davids@redhat.com>2011-10-07 18:11:05 +0200
commitaa90f0bada630e35b421492553788dd325bbd859 (patch)
tree11eb97cae6b74364bd4be81e4f1e324cad23d634
parent2a5a4fd2967d10bf40660b49d1a0fa69be819067 (diff)
downloadrteval-aa90f0bada630e35b421492553788dd325bbd859.tar.gz
rteval-aa90f0bada630e35b421492553788dd325bbd859.tar.xz
rteval-aa90f0bada630e35b421492553788dd325bbd859.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>
-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)