OLD | NEW |
1 """ | 1 """ |
2 Lockstat is the basic tool used to control the kernel's Lockmeter | 2 Lockstat is the basic tool used to control the kernel's Lockmeter |
3 functionality: e.g., turning the kernel's data gathering on or off, and | 3 functionality: e.g., turning the kernel's data gathering on or off, and |
4 retrieving that data from the kernel so that Lockstat can massage it and | 4 retrieving that data from the kernel so that Lockstat can massage it and |
5 produce printed reports. See http://oss.sgi.com/projects/lockmeter for | 5 produce printed reports. See http://oss.sgi.com/projects/lockmeter for |
6 details. | 6 details. |
7 | 7 |
8 NOTE: if you get compile errors from config.h, referring you to a FAQ, | 8 NOTE: if you get compile errors from config.h, referring you to a FAQ, |
9 you might need to do 'cat < /dev/null > /usr/include/linux/config.h'. | 9 you might need to do 'cat < /dev/null > /usr/include/linux/config.h'. |
10 But read the FAQ first. | 10 But read the FAQ first. |
11 """ | 11 """ |
12 import os | 12 import os |
13 from autotest_lib.client.bin import utils, profiler | 13 from autotest_lib.client.bin import utils, profiler |
14 | 14 |
15 class lockmeter(profiler.profiler): | 15 class lockmeter(profiler.profiler): |
16 version = 1 | 16 version = 1 |
17 | 17 |
18 # ftp://oss.sgi.com/projects/lockmeter/download/lockstat-1.4.11.tar.gz | 18 # ftp://oss.sgi.com/projects/lockmeter/download/lockstat-1.4.11.tar.gz |
19 # patched with lockstat.diff | 19 # patched with lockstat.diff |
20 # ftp://oss.sgi.com/projects/lockmeter/download/v2.6/patch.2.6.14-lockmeter-1.gz | 20 # ftp://oss.sgi.com/projects/lockmeter/download/v2.6/patch.2.6.14-lockmeter-1.gz |
21 # is the kernel patch | 21 # is the kernel patch |
22 | 22 |
23 def setup(self, tarball = 'lockstat-1.4.11.tar.bz2'): | 23 def setup(self, tarball = 'lockstat-1.4.11.tar.bz2'): |
24 self.tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) | 24 self.tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) |
25 utils.extract_tarball_to_dir(self.tarball, self.srcdir) | 25 utils.extract_tarball_to_dir(self.tarball, self.srcdir) |
26 os.chdir(self.srcdir) | 26 os.chdir(self.srcdir) |
27 | 27 |
28 utils.system('make') | 28 utils.make() |
29 self.cmd = self.srcdir + '/lockstat' | 29 self.cmd = self.srcdir + '/lockstat' |
30 | 30 |
31 | 31 |
32 def initialize(self): | 32 def initialize(self): |
33 self.job.require_gcc() | 33 self.job.require_gcc() |
34 | 34 |
35 if not os.path.exists('/proc/lockmeter'): | 35 if not os.path.exists('/proc/lockmeter'): |
36 msg = ('Lockmeter is not compiled into your kernel' | 36 msg = ('Lockmeter is not compiled into your kernel' |
37 'Please fix and try again') | 37 'Please fix and try again') |
38 print msg | 38 print msg |
39 raise AssertionError(msg) | 39 raise AssertionError(msg) |
40 | 40 |
41 | 41 |
42 def start(self, test): | 42 def start(self, test): |
43 utils.system(self.cmd + ' off') | 43 utils.system(self.cmd + ' off') |
44 utils.system(self.cmd + ' reset') | 44 utils.system(self.cmd + ' reset') |
45 utils.system(self.cmd + ' on') | 45 utils.system(self.cmd + ' on') |
46 | 46 |
47 | 47 |
48 def stop(self, test): | 48 def stop(self, test): |
49 utils.system(self.cmd + ' off') | 49 utils.system(self.cmd + ' off') |
50 | 50 |
51 | 51 |
52 def report(self, test): | 52 def report(self, test): |
53 args = ' -m ' + utils.get_systemmap() | 53 args = ' -m ' + utils.get_systemmap() |
54 self.output = self.profdir + '/results/lockstat' | 54 self.output = self.profdir + '/results/lockstat' |
55 utils.system(self.cmd + args + ' print > ' + self.output) | 55 utils.system(self.cmd + args + ' print > ' + self.output) |
OLD | NEW |