OLD | NEW |
1 """ | 1 """ |
2 Trace kernel events with Linux Tracing Toolkit (lttng). | 2 Trace kernel events with Linux Tracing Toolkit (lttng). |
3 You need to install the lttng patched kernel in order to use the profiler. | 3 You need to install the lttng patched kernel in order to use the profiler. |
4 | 4 |
5 Examples: | 5 Examples: |
6 job.profilers.add('lttng', tracepoints = None): enable all trace points. | 6 job.profilers.add('lttng', tracepoints = None): enable all trace points. |
7 job.profilers.add('lttng', tracepoints = []): disable all trace points. | 7 job.profilers.add('lttng', tracepoints = []): disable all trace points. |
8 job.profilers.add('lttng', tracepoints = ['kernel_arch_syscall_entry', | 8 job.profilers.add('lttng', tracepoints = ['kernel_arch_syscall_entry', |
9 'kernel_arch_syscall_exit']) | 9 'kernel_arch_syscall_exit']) |
10 will only trace syscall events. | 10 will only trace syscall events. |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 class lttng(profiler.profiler): | 27 class lttng(profiler.profiler): |
28 version = 1 | 28 version = 1 |
29 | 29 |
30 # http://ltt.polymtl.ca/lttng/ltt-control-0.51-12082008.tar.gz | 30 # http://ltt.polymtl.ca/lttng/ltt-control-0.51-12082008.tar.gz |
31 def setup(self, tarball='ltt-control-0.51-12082008.tar.gz', **dargs): | 31 def setup(self, tarball='ltt-control-0.51-12082008.tar.gz', **dargs): |
32 self.tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) | 32 self.tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) |
33 utils.extract_tarball_to_dir(self.tarball, self.srcdir) | 33 utils.extract_tarball_to_dir(self.tarball, self.srcdir) |
34 os.chdir(self.srcdir) | 34 os.chdir(self.srcdir) |
35 | 35 |
36 utils.system('./configure') | 36 utils.configure() |
37 utils.system('make') | 37 utils.make() |
38 | 38 |
39 | 39 |
40 # tracepoints: list of trace points to enable | 40 # tracepoints: list of trace points to enable |
41 # outputsize: size limit for lttng output file. -1: no limit. | 41 # outputsize: size limit for lttng output file. -1: no limit. |
42 def initialize(self, outputsize=1048576, tracepoints=None, **dargs): | 42 def initialize(self, outputsize=1048576, tracepoints=None, **dargs): |
43 self.job.require_gcc() | 43 self.job.require_gcc() |
44 | 44 |
45 self.tracepoints = tracepoints | 45 self.tracepoints = tracepoints |
46 self.ltt_bindir = os.path.join(self.srcdir, 'lttctl') | 46 self.ltt_bindir = os.path.join(self.srcdir, 'lttctl') |
47 self.lttctl = os.path.join(self.ltt_bindir, 'lttctl') | 47 self.lttctl = os.path.join(self.ltt_bindir, 'lttctl') |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 if os.path.isdir(file_path): | 106 if os.path.isdir(file_path): |
107 continue | 107 continue |
108 size = os.stat(file_path)[6] # grab file size | 108 size = os.stat(file_path)[6] # grab file size |
109 if size > self.outputsize: | 109 if size > self.outputsize: |
110 f = open(file_path, 'r+') | 110 f = open(file_path, 'r+') |
111 f.truncate(self.outputsize) | 111 f.truncate(self.outputsize) |
112 f.close() | 112 f.close() |
113 tarball = os.path.join(test.profdir, 'lttng.tar.bz2') | 113 tarball = os.path.join(test.profdir, 'lttng.tar.bz2') |
114 utils.system("tar -cvjf %s -C %s %s" % (tarball, test.profdir, 'lttng')) | 114 utils.system("tar -cvjf %s -C %s %s" % (tarball, test.profdir, 'lttng')) |
115 utils.system('rm -rf ' + self.output) | 115 utils.system('rm -rf ' + self.output) |
OLD | NEW |