Make option to do profiling only runs.
Signed-off-by: Ameya Gujar <ameya@google.com>
For tests that are run with profiling, this patch adds the option of skipping the non-profiling run. Previously we did two runs of the test, one with profiling and the other without. Now, one can do a job.profilers.set_only (True) to run only with profiling.
git-svn-id: http://test.kernel.org/svn/autotest/trunk@543 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/tests/unixbench/unixbench.py b/client/tests/unixbench/unixbench.py
index 8d42637..d28c4d5 100755
--- a/client/tests/unixbench/unixbench.py
+++ b/client/tests/unixbench/unixbench.py
@@ -13,13 +13,14 @@
system('make')
def execute(self, iterations = 1, args = ''):
- for i in range(iterations):
- os.chdir(self.srcdir)
- vars = 'TMPDIR=\"%s\" RESULTDIR=\"%s\"' % (self.tmpdir, self.resultsdir)
- system(vars + ' ./Run ' + args)
+ vars = 'TMPDIR=\"%s\" RESULTDIR=\"%s\"' % (self.tmpdir, self.resultsdir)
+ profilers = self.job.profilers
+ if not profilers.only():
+ for i in range(iterations):
+ os.chdir(self.srcdir)
+ system(vars + ' ./Run ' + args)
# Do a profiling run if necessary
- profilers = self.job.profilers
if profilers.present():
profilers.start(self)
system(vars + ' ./Run ' + args)