Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(688)

Side by Side Diff: client/profilers/lockmeter/lockmeter.py

Issue 3554003: Merge remote branch 'cros/upstream' into tempbranch3 (Closed) Base URL: http://git.chromium.org/git/autotest.git
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « client/profilers/ftrace/trace-cmd.tar.bz2 ('k') | client/profilers/lttng/lttng.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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)
OLDNEW
« no previous file with comments | « client/profilers/ftrace/trace-cmd.tar.bz2 ('k') | client/profilers/lttng/lttng.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698