Signed-off-by: Raphaël Beamonte <raphael.beamonte@xxxxxxxxx> --- rteval/rteval.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/rteval/rteval.py b/rteval/rteval.py index a432233..f54c1f4 100644 --- a/rteval/rteval.py +++ b/rteval/rteval.py @@ -63,6 +63,17 @@ import rtevalMailer from cputopology import CPUtopology +pathSave={} +def getcmdpath(which): + if not pathSave.has_key(which): + cmd = '/usr/bin/which %s' % which + c = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) + pathSave[which] = c.stdout.read().strip() + if not pathSave[which]: + raise RuntimeError, "Command '%s' is unknown on this system" % which + return pathSave[which] + + sigint_received = False def sigint_handler(signum, frame): global sigint_received @@ -249,7 +260,7 @@ class RtEval(object): policies = {'FF':'fifo', 'RR':'rrobin', 'TS':'other', '?':'unknown' } ret_kthreads = {} self.debug("getting kthread status") - cmd = '/bin/ps -eocommand,pid,policy,rtprio,comm' + cmd = '%s -eocommand,pid,policy,rtprio,comm' % getcmdpath('ps') self.debug("cmd: %s" % cmd) c = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) for p in c.stdout: -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html