blob: 519adaf8b459d997b6dd825a282825c15b712a38 [file] [log] [blame]
mblighf4c35322006-03-13 01:01:10 +00001import test
2from autotest_utils import *
3
apw7a0d5782006-04-21 14:21:17 +00004class kernbench(test.test):
mbligh82641862006-04-23 06:21:36 +00005 def setup(self, kernelver = '/usr/local/src/linux-2.6.14.tar.bz2',
6 config = os.environ['AUTODIR'] + "/tests/kernbench/config"):
mblighf4c35322006-03-13 01:01:10 +00007
mbligh82641862006-04-23 06:21:36 +00008 self.top_dir = self.job.tmpdir+'/kernbench'
9 kernel = self.job.kernel(self.top_dir, kernelver)
mbligh6dccb692006-04-21 20:25:52 +000010 kernel.config(config)
mblighf4c35322006-03-13 01:01:10 +000011
12
mbligh82641862006-04-23 06:21:36 +000013 def execute(self, iterations = 1, threads = 2 * count_cpus()):
14 print "kernbench x %d: %d threads" % (iterations, threads)
15
apw7a0d5782006-04-21 14:21:17 +000016 kernel.build_timed(threads) # warmup run
mblighf4c35322006-03-13 01:01:10 +000017 for i in range(1, iterations+1):
apw7a0d5782006-04-21 14:21:17 +000018 kernel.build_timed(threads, '../log/time.%d' % i)
mblighf4c35322006-03-13 01:01:10 +000019
20 os.chdir(top_dir + '/log')
apwc7846102006-04-06 18:22:13 +000021 system("grep elapsed time.* > time")