hiprofile is a small python script to extract data from an oprofile session and generate a HTML report for analysis.

See some sample output of hiprofile.

Hiprofile is distributed under the GNU General Public License (GPL).

download

Hiprofile is available in a few formats:

file size description
hiprofile_0.1_all.deb 29kB Debian/Ubuntu package
hiprofile-1.0-py2.6.egg 32kB Python egg format
hiprofile-1.0.tar.gz 19kB Source tarball

If you're running Debian or Ubuntu, just grab the .deb and install that with dpkg -i. Otherwise, you can use the "easy_install" utility included in python-setuptools:

[jk@pingu ~]$ easy_install http://ozlabs.org/~jk/projects/hiprofile/downloads/hiprofile-1.0-py2.6.egg

usage

hiprofile generates reports from existing oprofile runs. The oprofile manual has extensive documentation on this, but it's basically a matter of:

[jk@pingu ~]$ sudo opcontrol --setup --vmlinux=/boot/vmlinux-$(uname -r) --separate=kernel,lib
[jk@pingu ~]$ sudo opcontrol --start
[jk@pingu ~]$  [run program to profile]
[jk@pingu ~]$ sudo opcontrol --stop

Once you have recorded your profile data, you can run hiprofile to generate a report:

[jk@pingu ~]$ hiprofile -o profile-output/

This will generate a nice report in the profile-output/ directory. Point your browser to the index.html file in this directory to view the report.

Running on a different machine

If you'd prefer to run hiprofile on a separate machine (say you're profiling a server, and have hiprofile installed on your desktop machine), you can use the -r <remote-host> option:

[jk@pingu ~]$ hiprofile -r my-server.example.com -o profile-output/

You must have ssh access to the remote machine for this to work.

Specifying which opreport and opannotate binaries to use

If you need to use a specific install of opreport or opannotate that isn't in your PATH, you can use the --opannotate and --opreport options. For example:

[jk@pingu ~]$ hiprofile -r my-server.example.com \
	     --opreport=/build/oprofile-0.9.4/bin/opreport \
	     --opannotate=/build/oprofile-0.9.4/bin/opannotate \
	     -o profile-output

source code access

The source for hiprofile is available from git, just clone git://ozlabs.org/home/jk/git/hiprofile/

Hiprofile is distributed under the GNU General Public License. Read the COPYING file included in the distribution for details.