Note: ommited src dir from the email Add powertop profiler
Signed-off-by: Martin J. Bligh <[email protected]> Index: profilers/powertop/control =================================================================== --- profilers/powertop/control (revision 0) +++ profilers/powertop/control (revision 0) @@ -0,0 +1,3 @@ +job.profilers.add('powertop') +job.run_test('sleeptest', seconds=20) +job.profilers.delete('powertop') Index: profilers/powertop/__init__.py =================================================================== Index: profilers/powertop/powertop.py =================================================================== --- profilers/powertop/powertop.py (revision 0) +++ profilers/powertop/powertop.py (revision 0) @@ -0,0 +1,35 @@ +import time, os +from autotest_lib.client.bin import utils, profiler + +class powertop(profiler.profiler): + version = 1 + preserve_srcdir = True + + # filenames: list of filenames to cat + def setup(self, *args, **dargs): + os.chdir(self.srcdir) + utils.system('make') + + + def start(self, test): + self.child_pid = os.fork() + if self.child_pid: # parent + return None + else: # child + powertop = os.path.join(self.srcdir, 'powertop') + ' -d' + outputfile = os.path.join(test.profdir, 'powertop') + while True: + output = open(outputfile, 'a') + output.write(time.asctime() + '\n') + data = utils.system_output('%s >> %s' % (powertop, outputfile)) + output.write(data) + output.write('\n=========================\n') + output.close() + + + def stop(self, test): + os.kill(self.child_pid, 15) + + + def report(self, test): + return None _______________________________________________ Autotest mailing list [email protected] http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
