1 .TH READPROFILE 1 "May 1996"
4 readprofile - a tool to read kernel profiling information
12 This manpage documents version 2.0 of the program.
21 information to print ascii data on standard output.
23 organized in three columns: the first is the number of clock ticks,
24 the second is the name of the C function in the kernel where those many
25 ticks occurred, and the third is the normalized `load' of the procedure,
26 calculated as a ratio between the number of ticks and the length of
27 the procedure. The output is filled with blanks to ease readability.
30 Available command line options are the following:
34 Specify a mapfile, which by default is
35 .B /usr/src/linux/System.map.
36 You should specify the map file on cmdline if your current kernel isn't the
37 last one you compiled. If the name of the map file ends with `.gz' it
38 is decompressed on the fly.
42 Specify a different profiling buffer, which by default is
44 Using a different pro-file is useful if you want to `freeze' the
45 kernel profiling at some time and read it later. The
47 file can be copied using `cat' or `cp'. There is no more support for
48 compressed profile buffers, like in
50 because the program needs to know the size of the buffer in advance.
56 only print the profiling step used by the kernel.
57 The profiling step is the resolution of the profiling buffer, and
58 is chosen during kernel configuration (through `make config'),
59 or in the kernel's command line.
62 (terse) switch is used together with
64 only the decimal number is printed.
68 Print all symbols in the mapfile. By default the procedures with 0 reported
69 ticks are not printed.
73 Reset the profiling buffer. This can only be invoked by root, because
75 is readable by everybody but writable only by the superuser. However,
78 setuid 0, in order to reset the buffer without gaining privileges.
82 On some architectures it is possible to alter the frequency at which
83 the kernel delivers profiling interrupts to each CPU. This option allows you to
84 set the frequency, as a multiplier of the system clock frequency, HZ.
85 This is supported on i386-SMP (2.2 and 2.4 kernel) and also on sparc-SMP
86 and sparc64-SMP (2.4 kernel). This option also resets the profiling buffer,
87 and requires superuser privileges.
91 Verbose. The output is organized in four columns and filled with blanks.
92 The first column is the RAM address of a kernel function, the second is
93 the name of the function, the third is the number of clock ticks and the
94 last is the normalized load.
100 print its version number and exit.
103 Browse the profiling buffer ordering by clock ticks:
105 readprofile | sort -nr | less
108 Print the 20 most loaded procedures:
110 readprofile | sort -nr +2 | head -20
113 Print only filesystem profile:
115 readprofile | grep _ext2
118 Look at all the kernel information, with ram addresses"
120 readprofile -av | less
123 Browse a `freezed' profile buffer for a non current kernel:
125 readprofile -p ~/profile.freeze -m /zImage.map.gz
128 Request profiling at 2kHz per CPU, and reset the profiling buffer
130 sudo readprofile -M 20
138 only works with an 1.3.x or newer kernel,
141 changed in the step from 1.2 to 1.3
144 This program only works with ELF kernels. The change for a.out kernels
145 is trivial, and left as an exercise to the a.out user.
148 To enable profiling, the kernel must be rebooted, because no profiling module
149 is available, and it wouldn't be easy to build. To enable profiling,
150 you can specify "profile=2" (or another number) on the kernel commandline.
151 The number you specify is the two-exponent used as profiling step.
154 Profiling is disabled when interrupts are inhibited. This means that many
155 profiling ticks happen when interrupts are re-enabled. Watch out for
156 misleading information.
160 /proc/profile A binary snapshot of the profiling buffer.
161 /usr/src/linux/System.map The symbol table for the kernel.
162 /usr/src/linux/* The program being profiled :-)