ia64/linux-2.6.18-xen.hg

annotate Documentation/basic_profiling.txt @ 0:831230e53067

Import 2.6.18 from kernel.org tarball.
author Ian Campbell <ian.campbell@xensource.com>
date Wed Apr 11 14:15:44 2007 +0100 (2007-04-11)
parents
children
rev   line source
ian@0 1 These instructions are deliberately very basic. If you want something clever,
ian@0 2 go read the real docs ;-) Please don't add more stuff, but feel free to
ian@0 3 correct my mistakes ;-) (mbligh@aracnet.com)
ian@0 4 Thanks to John Levon, Dave Hansen, et al. for help writing this.
ian@0 5
ian@0 6 <test> is the thing you're trying to measure.
ian@0 7 Make sure you have the correct System.map / vmlinux referenced!
ian@0 8
ian@0 9 It is probably easiest to use "make install" for linux and hack
ian@0 10 /sbin/installkernel to copy vmlinux to /boot, in addition to vmlinuz,
ian@0 11 config, System.map, which are usually installed by default.
ian@0 12
ian@0 13 Readprofile
ian@0 14 -----------
ian@0 15 A recent readprofile command is needed for 2.6, such as found in util-linux
ian@0 16 2.12a, which can be downloaded from:
ian@0 17
ian@0 18 http://www.kernel.org/pub/linux/utils/util-linux/
ian@0 19
ian@0 20 Most distributions will ship it already.
ian@0 21
ian@0 22 Add "profile=2" to the kernel command line.
ian@0 23
ian@0 24 clear readprofile -r
ian@0 25 <test>
ian@0 26 dump output readprofile -m /boot/System.map > captured_profile
ian@0 27
ian@0 28 Oprofile
ian@0 29 --------
ian@0 30
ian@0 31 Get the source (see Changes for required version) from
ian@0 32 http://oprofile.sourceforge.net/ and add "idle=poll" to the kernel command
ian@0 33 line.
ian@0 34
ian@0 35 Configure with CONFIG_PROFILING=y and CONFIG_OPROFILE=y & reboot on new kernel
ian@0 36
ian@0 37 ./configure --with-kernel-support
ian@0 38 make install
ian@0 39
ian@0 40 For superior results, be sure to enable the local APIC. If opreport sees
ian@0 41 a 0Hz CPU, APIC was not on. Be aware that idle=poll may mean a performance
ian@0 42 penalty.
ian@0 43
ian@0 44 One time setup:
ian@0 45 opcontrol --setup --vmlinux=/boot/vmlinux
ian@0 46
ian@0 47 clear opcontrol --reset
ian@0 48 start opcontrol --start
ian@0 49 <test>
ian@0 50 stop opcontrol --stop
ian@0 51 dump output opreport > output_file
ian@0 52
ian@0 53 To only report on the kernel, run opreport -l /boot/vmlinux > output_file
ian@0 54
ian@0 55 A reset is needed to clear old statistics, which survive a reboot.
ian@0 56