1 .TH READPROFILE 1 "May 1996"
4 readprofile - a tool to read kernel profiling information
10 This manpage documents version 2.0 of the program.
19 information to print ascii data on standard output.
21 organized in three columns: the first is the number of clock ticks,
22 the second is the name of the C function in the kernel where those many
23 ticks occurred, and the third is the normalized `load' of the procedure,
24 calculated as a ratio between the number of ticks and the length of
25 the procedure. The output is filled with blanks to ease readability.
28 Available command line options are the following:
32 Specify a mapfile, which by default is
33 .B /usr/src/linux/System.map.
34 You should specify the map file on cmdline if your current kernel isn't the
35 last one you compiled, or if you keep System.map elsewhere. If the name of
36 the map file ends with `.gz' it is decompressed on the fly.
40 Specify a different profiling buffer, which by default is
42 Using a different pro-file is useful if you want to `freeze' the
43 kernel profiling at some time and read it later. The
45 file can be copied using `cat' or `cp'. There is no more support for
46 compressed profile buffers, like in
48 because the program needs to know the size of the buffer in advance.
54 only print the profiling step used by the kernel.
55 The profiling step is the resolution of the profiling buffer, and
56 is chosen during kernel configuration (through `make config'),
57 or in the kernel's command line.
60 (terse) switch is used together with
62 only the decimal number is printed.
66 Print all symbols in the mapfile. By default the procedures with 0 reported
67 ticks are not printed.
71 Print individual histogram-bin counts.
75 Reset the profiling buffer. This can only be invoked by root, because
77 is readable by everybody but writable only by the superuser. However,
80 setuid 0, in order to reset the buffer without gaining privileges.
84 On some architectures it is possible to alter the frequency at which
85 the kernel delivers profiling interrupts to each CPU. This option allows you to
86 set the frequency, as a multiplier of the system clock frequency, HZ.
87 This is supported on i386-SMP (2.2 and 2.4 kernel) and also on sparc-SMP
88 and sparc64-SMP (2.4 kernel). This option also resets the profiling buffer,
89 and requires superuser privileges.
93 Verbose. The output is organized in four columns and filled with blanks.
94 The first column is the RAM address of a kernel function, the second is
95 the name of the function, the third is the number of clock ticks and the
96 last is the normalized load.
102 print its version number and exit.
105 Browse the profiling buffer ordering by clock ticks:
107 readprofile | sort -nr | less
110 Print the 20 most loaded procedures:
112 readprofile | sort -nr +2 | head -20
115 Print only filesystem profile:
117 readprofile | grep _ext2
120 Look at all the kernel information, with ram addresses"
122 readprofile -av | less
125 Browse a `freezed' profile buffer for a non current kernel:
127 readprofile -p ~/profile.freeze -m /zImage.map.gz
130 Request profiling at 2kHz per CPU, and reset the profiling buffer
132 sudo readprofile -M 20
140 only works with an 1.3.x or newer kernel,
143 changed in the step from 1.2 to 1.3
146 This program only works with ELF kernels. The change for a.out kernels
147 is trivial, and left as an exercise to the a.out user.
150 To enable profiling, the kernel must be rebooted, because no profiling module
151 is available, and it wouldn't be easy to build. To enable profiling,
152 you can specify "profile=2" (or another number) on the kernel commandline.
153 The number you specify is the two-exponent used as profiling step.
156 Profiling is disabled when interrupts are inhibited. This means that many
157 profiling ticks happen when interrupts are re-enabled. Watch out for
158 misleading information.
162 /proc/profile A binary snapshot of the profiling buffer.
163 /usr/src/linux/System.map The symbol table for the kernel.
164 /usr/src/linux/* The program being profiled :-)
168 The readprofile command is part of the util-linux-ng package and is available from
169 ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.