public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andries Brouwer <aebr@win.tue.nl>
To: "Martin J. Bligh" <mbligh@aracnet.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	cliffw@osdl.org, Andrew Morton <akpm@zip.com.au>,
	Steven Pratt <slpratt@austin.ibm.com>,
	John Levon <levon@movementarian.org>,
	Dave Hansen <haveblue@us.ibm.com>
Subject: Re: [PATCH] documentation for basic guide to profiling
Date: Fri, 28 Feb 2003 22:49:37 +0100	[thread overview]
Message-ID: <20030228214937.GA15540@win.tue.nl> (raw)
In-Reply-To: <8550000.1046419962@[10.10.2.4]>

On Fri, Feb 28, 2003 at 12:12:42AM -0800, Martin J. Bligh wrote:

> +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

As far as I can see, the 2 is meaningless here. This should just be

	echo > /proc/profile

(On SMP when writing sizeof(int) bytes, the value written
is significant. But 1 or 2 is not sizeof(int).)

Andries

-----
Fragment of some notes:

<sect1>Profiling the kernel<p>
There are several facilities to see where the kernel spends
its resources. A simple one is the profiling function, that
stores the current EIP (instruction pointer) at each clock tick.
<p>
Boot the kernel with command line option <tt>profile=2</tt>
(or some other number instead of 2). This will cause
a file <tt>/proc/profile</tt> to be created.
The number given after <tt>profile=</tt> is the number of positions
EIP is shifted right when profiling. So a large number gives a
coarse profile.
The counters are reset by writing to <tt>/proc/profile</tt>.
The utility <tt>readprofile</tt> will output statistics for you.
It does not sort - you have to invoke <tt>sort</tt> explicitly.
But given a memory map it will translate addresses to kernel symbols.
<p>
See <tt>kernel/profile.c</tt> and <tt>fs/proc/proc_misc.c</tt>
and <tt>readprofile(1)</tt>.
<p>
For example:
<verb>
# echo > /proc/profile
...
# readprofile -m System.map-2.5.59 | sort -nr | head -2
510502 total                                      0.1534
508548 default_idle                           10594.7500
</verb>

      parent reply	other threads:[~2003-02-28 21:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030228214937.GA15540@win.tue.nl \
    --to=aebr@win.tue.nl \
    --cc=akpm@zip.com.au \
    --cc=cliffw@osdl.org \
    --cc=haveblue@us.ibm.com \
    --cc=levon@movementarian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@aracnet.com \
    --cc=slpratt@austin.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox