From: Markus Lehtonen Date: Thu, 16 Jun 2016 11:29:46 +0000 (+0300) Subject: oeqa.buildperf: add method to log shell commands X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~25189 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f0b11ba1266f9c650cf34d9b394d72009ee7207;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git oeqa.buildperf: add method to log shell commands Add new methods to BuildPerfTest class for running a shell command and logging its output. Signed-off-by: Markus Lehtonen Signed-off-by: Ross Burton --- diff --git a/meta/lib/oeqa/buildperf/base.py b/meta/lib/oeqa/buildperf/base.py index d608061ec05..230a7e7925c 100644 --- a/meta/lib/oeqa/buildperf/base.py +++ b/meta/lib/oeqa/buildperf/base.py @@ -112,6 +112,11 @@ class BuildPerfTest(object): """Actual test payload""" raise NotImplementedError + def log_cmd_output(self, cmd): + """Run a command and log it's output""" + with open(self.cmd_log, 'a') as fobj: + runCmd(cmd, stdout=fobj) + def measure_cmd_resources(self, cmd, name, legend): """Measure system resource usage of a command""" def str_time_to_timedelta(strtime):