Commit d2c40dc0 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] (o)profile Documentation/basic_profiling.txt updates

From: bert hubert <ahu@ds9a.nl>
Signed-off-by: default avatarbert hubert <ahu@ds9a.nl>
Signed-off-by: default avatarJohn Levon <levon@movementarian.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c98476cb
......@@ -5,16 +5,19 @@ Thanks to John Levon, Dave Hansen, et al. for help writing this.
<test> is the thing you're trying to measure.
Make sure you have the correct System.map / vmlinux referenced!
IMHO it's easier to use "make install" for linux and hack /sbin/installkernel
to copy config files, system.map, vmlinux to /boot.
It is probably easiest to use "make install" for linux and hack
/sbin/installkernel to copy vmlinux to /boot, in addition to vmlinuz,
config, System.map, which are usually installed by default.
Readprofile
-----------
You need a fixed readprofile command for 2.5 ... either get hold of
a current version from:
A recent readprofile command is needed for 2.6, such as found in util-linux
2.12a, which can be downloaded from:
http://www.kernel.org/pub/linux/utils/util-linux/
or get readprofile binary fixed for 2.5 / akpm's 2.5 patch from
ftp://ftp.kernel.org/pub/linux/kernel/people/mbligh/tools/readprofile/
Most distributions will ship it already.
Add "profile=2" to the kernel command line.
......@@ -24,25 +27,26 @@ dump output readprofile -m /boot/System.map > captured_profile
Oprofile
--------
get source (I use 0.5) from http://oprofile.sourceforge.net/
add "idle=poll" to the kernel command line
Get the source (I use 0.8) from http://oprofile.sourceforge.net/
and add "idle=poll" to the kernel command line
Configure with CONFIG_PROFILING=y and CONFIG_OPROFILE=y & reboot on new kernel
./configure --with-kernel-support
make install
One time setup (pick appropriate one for your CPU):
P3 opcontrol --setup --vmlinux=/boot/vmlinux \
--ctr0-event=CPU_CLK_UNHALTED --ctr0-count=100000
Athlon/x86-64 opcontrol --setup --vmlinux=/boot/vmlinux \
--ctr0-event=RETIRED_INSNS --ctr0-count=100000
P4 opcontrol --setup --vmlinux=/boot/vmlinux \
--ctr0-event=GLOBAL_POWER_EVENTS \
--ctr0-unit-mask=1 --ctr0-count=100000
For superior results, be sure to enable the local APIC. If opreport sees
a 0Hz CPU, APIC was not on. Be aware that idle=poll may mean a performance
penalty.
One time setup:
opcontrol --setup --vmlinux=/boot/vmlinux
start daemon opcontrol --start-daemon
clear opcontrol --reset
start opcontrol --start
<test>
stop opcontrol --stop
dump output oprofpp -dl -i /boot/vmlinux > output_file
dump output opreport > output_file
To only report on the kernel, run opreport /boot/vmlinux > output_file
A reset is needed to clear old statistics, which survive a reboot.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment