1 These instructions are deliberately very basic. If you want something clever,
2 go read the real docs ;-) Please don't add more stuff, but feel free to
3 correct my mistakes ;-) (mbligh@aracnet.com)
4 Thanks to John Levon, Dave Hansen, et al. for help writing this.
6 <test> is the thing you're trying to measure.
7 Make sure you have the correct System.map / vmlinux referenced!
8 IMHO it's easier to use "make install" for linux and hack /sbin/installkernel
9 to copy config files, system.map, vmlinux to /boot.
13 You need a fixed readprofile command for 2.5 ... either get hold of
14 a current version from:
15 http://www.kernel.org/pub/linux/utils/util-linux/
16 or get readprofile binary fixed for 2.5 / akpm's 2.5 patch from
17 ftp://ftp.kernel.org/pub/linux/kernel/people/mbligh/tools/readprofile/
19 Add "profile=2" to the kernel command line.
23 dump output readprofile -m /boot/System.map > captured_profile
27 get source (I use 0.5) from http://oprofile.sourceforge.net/
28 add "idle=poll" to the kernel command line
29 Configure with CONFIG_PROFILING=y and CONFIG_OPROFILE=y & reboot on new kernel
30 ./configure --with-kernel-support
33 One time setup (pick appropriate one for your CPU):
34 P3 opcontrol --setup --vmlinux=/boot/vmlinux \
35 --ctr0-event=CPU_CLK_UNHALTED --ctr0-count=100000
36 Athlon/x86-64 opcontrol --setup --vmlinux=/boot/vmlinux \
37 --ctr0-event=RETIRED_INSNS --ctr0-count=100000
38 P4 opcontrol --setup --vmlinux=/boot/vmlinux \
39 --ctr0-event=GLOBAL_POWER_EVENTS \
40 --ctr0-unit-mask=1 --ctr0-count=100000
42 start daemon opcontrol --start-daemon
43 clear opcontrol --reset
44 start opcontrol --start
47 dump output oprofpp -dl -i /boot/vmlinux > output_file