| OLD | NEW |
| 1 """ | 1 """ |
| 2 OProfile is a system-wide profiler for Linux systems, | 2 OProfile is a system-wide profiler for Linux systems, |
| 3 capable of profiling all running code at low overhead. | 3 capable of profiling all running code at low overhead. |
| 4 OProfile is released under the GNU GPL. | 4 OProfile is released under the GNU GPL. |
| 5 | 5 |
| 6 It consists of a kernel driver and a daemon for collecting sample data, | 6 It consists of a kernel driver and a daemon for collecting sample data, |
| 7 and several post-profiling tools for turning data into information. | 7 and several post-profiling tools for turning data into information. |
| 8 | 8 |
| 9 More Info: http://oprofile.sourceforge.net/ | 9 More Info: http://oprofile.sourceforge.net/ |
| 10 Will need some libaries to compile. Do 'apt-get build-dep oprofile' | 10 Will need some libaries to compile. Do 'apt-get build-dep oprofile' |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 return | 33 return |
| 34 | 34 |
| 35 try: | 35 try: |
| 36 self.tarball = utils.unmap_url(self.bindir, tarball, | 36 self.tarball = utils.unmap_url(self.bindir, tarball, |
| 37 self.tmpdir) | 37 self.tmpdir) |
| 38 utils.extract_tarball_to_dir(self.tarball, self.srcdir) | 38 utils.extract_tarball_to_dir(self.tarball, self.srcdir) |
| 39 os.chdir(self.srcdir) | 39 os.chdir(self.srcdir) |
| 40 | 40 |
| 41 patch = os.path.join(self.bindir,"oprofile-69455.patch") | 41 patch = os.path.join(self.bindir,"oprofile-69455.patch") |
| 42 utils.system('patch -p1 < %s' % patch) | 42 utils.system('patch -p1 < %s' % patch) |
| 43 utils.system('./configure --with-kernel-support --prefix=' + \ | 43 utils.configure('--with-kernel-support --prefix=' + \ |
| 44 self.srcdir) | 44 self.srcdir) |
| 45 utils.system('make -j %d' % utils.count_cpus()) | 45 utils.make('-j %d' % utils.count_cpus()) |
| 46 utils.system('make install') | 46 utils.make('install') |
| 47 except: | 47 except: |
| 48 # Build from source failed. | 48 # Build from source failed. |
| 49 # But maybe can still use the local copy | 49 # But maybe can still use the local copy |
| 50 local_opcontrol = os.path.exists('/usr/bin/opcontrol') | 50 local_opcontrol = os.path.exists('/usr/bin/opcontrol') |
| 51 local_opreport = os.path.exists('/usr/bin/opreport') | 51 local_opreport = os.path.exists('/usr/bin/opreport') |
| 52 if local == False or not local_opcontrol or not local_opreport: | 52 if local == False or not local_opcontrol or not local_opreport: |
| 53 raise error.AutotestError('No oprofile available') | 53 raise error.AutotestError('No oprofile available') |
| 54 else: | 54 else: |
| 55 # if we managed to build, try again to pick binaries | 55 # if we managed to build, try again to pick binaries |
| 56 self._pick_binaries(True) | 56 self._pick_binaries(True) |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 else: | 146 else: |
| 147 utils.system("echo 'no vmlinux found.' > %s" % reportfile) | 147 utils.system("echo 'no vmlinux found.' > %s" % reportfile) |
| 148 | 148 |
| 149 # output profile summary report | 149 # output profile summary report |
| 150 reportfile = test.profdir + '/oprofile.user' | 150 reportfile = test.profdir + '/oprofile.user' |
| 151 logging.info('Starting oprofile: %s' % self.start_time) | 151 logging.info('Starting oprofile: %s' % self.start_time) |
| 152 utils.system(self.opreport + ' --long-filenames ' + ' >> ' + reportfile) | 152 utils.system(self.opreport + ' --long-filenames ' + ' >> ' + reportfile) |
| 153 logging.info('Ending oprofile: %s' % self.stop_time) | 153 logging.info('Ending oprofile: %s' % self.stop_time) |
| 154 | 154 |
| 155 utils.system(self.opcontrol + ' --shutdown') | 155 utils.system(self.opcontrol + ' --shutdown') |
| OLD | NEW |