public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] documentation for basic guide to profiling
@ 2003-02-28  8:12 Martin J. Bligh
  2003-02-28  8:29 ` Andrew Morton
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Martin J. Bligh @ 2003-02-28  8:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: cliffw, Andrew Morton, Steven Pratt, John Levon, Dave Hansen

I was trying to write some simple docs on how to do profiling for people 
to use for really basic stuff. I got it all wrong, but John's kindly 
corrected  it ;-) Andrew asked me to do this as a patch for the 
documentation directory ... feedback would be much appreciated 
(yes, it's oversimplified - it's meant to be).

diff -urpN -X /home/fletch/.diff.exclude virgin/Documentation/basic_profiling.txt oprofile_doc/Documentation/basic_profiling.txt
--- virgin/Documentation/basic_profiling.txt	Wed Dec 31 16:00:00 1969
+++ oprofile_doc/Documentation/basic_profiling.txt	Fri Feb 28 00:05:59 2003
@@ -0,0 +1,44 @@
+These instructions are deliberately very basic. If you want something clever,
+go read the real docs ;-) Please don't add more stuff, but feel free to 
+correct my mistakes ;-)    (mbligh@aracnet.com)
+Thanks to John Levon and Dave Hansen 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.
+
+Readprofile
+-----------
+get readprofile binary fixed for 2.5 / akpm's 2.5 patch from 
+ftp://ftp.kernel.org/pub/linux/people/mbligh/tools/readprofile/
+add "profile=2" to the kernel command line.
+
+clear		echo 2 > /proc/profile
+		<test>
+dump output	readprofile -m /boot/System.map > catured_profile
+
+Oprofile
+--------
+get source (I use 0.5) from http://oprofile.sourceforge.net/
+add "poll=idle" 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
+Athalon		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
+
+start daemon	opcontrol --start-daemon
+clear		opcontrol --reset
+start		opcontrol --start
+		<test>
+stop		opcontrol --stop
+dump output	oprofpp -dl -i /boot/vmlinux  >  output_file
+


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2003-03-03 22:05 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-28  8:12 [PATCH] documentation for basic guide to profiling Martin J. Bligh
2003-02-28  8:29 ` Andrew Morton
2003-02-28 11:22   ` Dave Jones
2003-02-28 15:28     ` Jeff Garzik
2001-01-01  5:27       ` Anton Blanchard
2003-02-28 22:43         ` Martin J. Bligh
2003-02-28 23:05           ` Dave Hansen
2003-02-28 23:11         ` Martin J. Bligh
2003-03-01 17:51           ` Dave Jones
2003-03-01 20:48             ` John Levon
2003-03-02 23:05               ` Dave Jones
2003-03-01 20:55             ` Martin J. Bligh
2003-03-01 21:33               ` Dave Hansen
2003-03-03 21:57           ` Pavel Machek
2003-02-28 17:36 ` Randy.Dunlap
2003-02-28 18:11   ` Martin J. Bligh
2003-02-28 18:13     ` Dave Hansen
2003-02-28 19:30       ` Randy.Dunlap
2003-02-28 21:45         ` Martin J. Bligh
2003-02-28 21:49 ` Andries Brouwer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox