blob: 41b70b23c44aad0a7e2ac44dc25d4f2a9d10091b [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):
5 def execute(self,
mblighf4c35322006-03-13 01:01:10 +00006 iterations = 1,
7 threads = 2 * count_cpus(),
mbligh2fbaa002006-04-21 19:51:13 +00008 kernelver = '/usr/local/src//linux-2.6.14.tar.bz2',
mbligh55f2d9c2006-04-02 20:58:54 +00009 config = os.environ['AUTODIRBIN'] + "/tests/kernbench/config"):
mblighf4c35322006-03-13 01:01:10 +000010
11 print "kernbench -j %d -i %d -c %s -k %s" % (threads, iterations, config, kernelver)
12
13 self.iterations = iterations
14 self.threads = threads
15 self.kernelver = kernelver
16 self.config = config
17
apw7a0d5782006-04-21 14:21:17 +000018 top_dir = self.job.tmpdir+'/kernbench'
19 kernel = self.job.kernel(top_dir, kernelver)
mblighf4c35322006-03-13 01:01:10 +000020 kernel.config([config])
21
22
apw7a0d5782006-04-21 14:21:17 +000023 kernel.build_timed(threads) # warmup run
mblighf4c35322006-03-13 01:01:10 +000024 for i in range(1, iterations+1):
apw7a0d5782006-04-21 14:21:17 +000025 kernel.build_timed(threads, '../log/time.%d' % i)
mblighf4c35322006-03-13 01:01:10 +000026
27 os.chdir(top_dir + '/log')
apwc7846102006-04-06 18:22:13 +000028 system("grep elapsed time.* > time")