218 lines
6.2 KiB
HTML
218 lines
6.2 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of READPROFILE</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>READPROFILE</H1>
|
|
Section: System Administration (8)<BR>Updated: October 2011<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
readprofile - read kernel profiling information
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>readprofile</B>
|
|
|
|
[options]
|
|
<A NAME="lbAD"> </A>
|
|
<H2>VERSION</H2>
|
|
|
|
This manpage documents version 2.0 of the program.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<P>
|
|
|
|
The
|
|
<B>readprofile</B>
|
|
|
|
command uses the
|
|
<I>/proc/profile</I>
|
|
|
|
information to print ascii data on standard output. The output is
|
|
organized in three columns: the first is the number of clock ticks,
|
|
the second is the name of the C function in the kernel where those
|
|
many ticks occurred, and the third is the normalized `load' of the
|
|
procedure, calculated as a ratio between the number of ticks and the
|
|
length of the procedure. The output is filled with blanks to ease
|
|
readability.
|
|
<A NAME="lbAF"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="1"><B>-a</B>, <B>--all</B><DD>
|
|
Print all symbols in the mapfile. By default the procedures with
|
|
reported ticks are not printed.
|
|
<DT id="2"><B>-b</B>, <B>--histbin</B><DD>
|
|
Print individual histogram-bin counts.
|
|
<DT id="3"><B>-i</B>, <B>--info</B><DD>
|
|
Info. This makes
|
|
<B>readprofile</B>
|
|
|
|
only print the profiling step used by the kernel. The profiling step
|
|
is the resolution of the profiling buffer, and is chosen during
|
|
kernel configuration (through `make config'), or in the kernel's
|
|
command line. If the
|
|
<B>-t</B>
|
|
|
|
(terse) switch is used together with
|
|
<B>-i</B>
|
|
|
|
only the decimal number is printed.
|
|
<DT id="4"><B>-m</B>, <B>--mapfile</B> <I>mapfile</I><DD>
|
|
Specify a mapfile, which by default is
|
|
<I>/usr/src/linux/System.map</I>.
|
|
|
|
You should specify the map file on cmdline if your current kernel
|
|
isn't the last one you compiled, or if you keep System.map elsewhere.
|
|
If the name of the map file ends with `.gz' it is decompressed on the
|
|
fly.
|
|
<DT id="5"><B>-M</B>, <B>--multiplier</B> <I>multiplier</I><DD>
|
|
On some architectures it is possible to alter the frequency at which
|
|
the kernel delivers profiling interrupts to each CPU. This option
|
|
allows you to set the frequency, as a multiplier of the system clock
|
|
frequency, HZ. Linux 2.6.16 dropped multiplier support for most systems.
|
|
This option also resets the profiling buffer, and requires superuser
|
|
privileges.
|
|
<DT id="6"><B>-p</B>, <B>--profile</B> <I>pro-file</I><DD>
|
|
Specify a different profiling buffer, which by default is
|
|
<I>/proc/profile</I>.
|
|
|
|
Using a different pro-file is useful if you want to `freeze' the
|
|
kernel profiling at some time and read it later. The
|
|
<I>/proc/profile</I>
|
|
|
|
file can be copied using `cat' or `cp'. There is no more support for
|
|
compressed profile buffers, like in
|
|
<B>readprofile-1.1,</B>
|
|
|
|
because the program needs to know the size of the buffer in advance.
|
|
<DT id="7"><B>-r</B>, <B>--reset</B><DD>
|
|
Reset the profiling buffer. This can only be invoked by root,
|
|
because
|
|
<I>/proc/profile</I>
|
|
|
|
is readable by everybody but writable only by the superuser.
|
|
However, you can make
|
|
<B>readprofile</B>
|
|
|
|
set-user-ID 0, in order to reset the buffer without gaining privileges.
|
|
<DT id="8"><B>-s, --counters</B><DD>
|
|
Print individual counters within functions.
|
|
<DT id="9"><B>-v</B>, <B>--verbose</B><DD>
|
|
Verbose. The output is organized in four columns and filled with
|
|
blanks. The first column is the RAM address of a kernel function,
|
|
the second is the name of the function, the third is the number of
|
|
clock ticks and the last is the normalized load.
|
|
<DT id="10"><B>-V</B>, <B>--version</B><DD>
|
|
Display version information and exit.
|
|
<DT id="11"><B>-h</B>, <B>--help</B><DD>
|
|
Display help text and exit.
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>EXAMPLES</H2>
|
|
|
|
Browse the profiling buffer ordering by clock ticks:
|
|
<PRE>
|
|
readprofile | sort -nr | less
|
|
|
|
</PRE>
|
|
|
|
Print the 20 most loaded procedures:
|
|
<PRE>
|
|
readprofile | sort -nr +2 | head -20
|
|
|
|
</PRE>
|
|
|
|
Print only filesystem profile:
|
|
<PRE>
|
|
readprofile | grep _ext2
|
|
|
|
</PRE>
|
|
|
|
Look at all the kernel information, with ram addresses:
|
|
<PRE>
|
|
readprofile -av | less
|
|
|
|
</PRE>
|
|
|
|
Browse a `frozen' profile buffer for a non current kernel:
|
|
<PRE>
|
|
readprofile -p ~/profile.freeze -m /zImage.map.gz
|
|
|
|
</PRE>
|
|
|
|
Request profiling at 2kHz per CPU, and reset the profiling buffer:
|
|
<PRE>
|
|
sudo readprofile -M 20
|
|
</PRE>
|
|
|
|
<A NAME="lbAH"> </A>
|
|
<H2>BUGS</H2>
|
|
|
|
<P>
|
|
|
|
<B>readprofile</B>
|
|
|
|
only works with a 1.3.x or newer kernel, because
|
|
<I>/proc/profile</I>
|
|
|
|
changed in the step from 1.2 to 1.3
|
|
<P>
|
|
|
|
This program only works with ELF kernels. The change for a.out
|
|
kernels is trivial, and left as an exercise to the a.out user.
|
|
<P>
|
|
|
|
To enable profiling, the kernel must be rebooted, because no
|
|
profiling module is available, and it wouldn't be easy to build. To
|
|
enable profiling, you can specify "profile=2" (or another number) on
|
|
the kernel commandline. The number you specify is the two-exponent
|
|
used as profiling step.
|
|
<P>
|
|
|
|
Profiling is disabled when interrupts are inhibited. This means that
|
|
many profiling ticks happen when interrupts are re-enabled. Watch
|
|
out for misleading information.
|
|
<A NAME="lbAI"> </A>
|
|
<H2>FILES</H2>
|
|
|
|
<PRE>
|
|
/proc/profile A binary snapshot of the profiling buffer.
|
|
/usr/src/linux/System.map The symbol table for the kernel.
|
|
/usr/src/linux/* The program being profiled :-)
|
|
</PRE>
|
|
|
|
<A NAME="lbAJ"> </A>
|
|
<H2>AVAILABILITY</H2>
|
|
|
|
The readprofile command is part of the util-linux package and is
|
|
available from
|
|
|
|
Linux Kernel Archive
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="12"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="13"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="14"><A HREF="#lbAD">VERSION</A><DD>
|
|
<DT id="15"><A HREF="#lbAE">DESCRIPTION</A><DD>
|
|
<DT id="16"><A HREF="#lbAF">OPTIONS</A><DD>
|
|
<DT id="17"><A HREF="#lbAG">EXAMPLES</A><DD>
|
|
<DT id="18"><A HREF="#lbAH">BUGS</A><DD>
|
|
<DT id="19"><A HREF="#lbAI">FILES</A><DD>
|
|
<DT id="20"><A HREF="#lbAJ">AVAILABILITY</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:15 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|