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/kernbench/kernbench.py b/client/tests/kernbench/kernbench.py
index 152cbc1..3ece724 100755
--- a/client/tests/kernbench/kernbench.py
+++ b/client/tests/kernbench/kernbench.py
@@ -49,12 +49,13 @@
 		print "kernbench x %d: %d threads" % (iterations, threads)
 
 		kernel.build_timed(threads)         # warmup run
-		for i in range(iterations):
-			logfile = self.resultsdir+'/time.%d' % i
-			kernel.build_timed(threads, logfile)
+		profilers = self.job.profilers
+                if not profilers.only():
+		        for i in range(iterations):
+			        logfile = self.resultsdir+'/time.%d' % i
+			        kernel.build_timed(threads, logfile)
 
 		# Do a profiling run if necessary
-		profilers = self.job.profilers
 		if profilers.present():
 			profilers.start(self)
 			logfile = self.resultsdir+'/time.profile'