]> git.ipfire.org Git - thirdparty/util-linux.git/blob - sys-utils/readprofile.1
Imported from util-linux-2.11b tarball.
[thirdparty/util-linux.git] / sys-utils / readprofile.1
1 .TH READPROFILE 1 "May 1996"
2 .UC 4
3 .SH NAME
4 readprofile - a tool to read kernel profiling information
5 .SH SYNOPSIS
6 .B readprofile
7 [
8 .I options
9 ]
10
11 .SH VERSION
12 This manpage documents version 2.0 of the program.
13
14 .SH DESCRIPTION
15
16 .LP
17 The
18 .B readprofile
19 command uses the
20 .B /proc/profile
21 information to print ascii data on standard output.
22 The output is
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.
28
29 .LP
30 Available command line options are the following:
31
32 .TP
33 .RB -m " mapfile"
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.
39
40 .TP
41 .RB -p " pro-file"
42 Specify a different profiling buffer, which by default is
43 .B /proc/profile.
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
46 .B /proc/profile
47 file can be copied using `cat' or `cp'. There is no more support for
48 compressed profile buffers, like in
49 .B readprofile-1.1,
50 because the program needs to know the size of the buffer in advance.
51
52 .TP
53 .B -i
54 Info. This makes
55 .B readprofile
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.
60 If the
61 .B -t
62 (terse) switch is used together with
63 .B -i
64 only the decimal number is printed.
65
66 .TP
67 .B -a
68 Print all symbols in the mapfile. By default the procedures with 0 reported
69 ticks are not printed.
70
71 .TP
72 .B -r
73 Reset the profiling buffer. This can only be invoked by root, because
74 .B /proc/profile
75 is readable by everybody but writable only by the superuser. However,
76 you can make
77 .B readprofile
78 setuid 0, in order to reset the buffer without gaining privileges.
79
80 .TP
81 .RB -M " multiplier"
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.
88
89 .TP
90 .B -v
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.
95
96 .TP
97 .B -V
98 Version. This makes
99 .B readprofile
100 print its version number and exit.
101
102 .SH EXAMPLES
103 Browse the profiling buffer ordering by clock ticks:
104 .nf
105 readprofile | sort -nr | less
106
107 .fi
108 Print the 20 most loaded procedures:
109 .nf
110 readprofile | sort -nr +2 | head -20
111
112 .fi
113 Print only filesystem profile:
114 .nf
115 readprofile | grep _ext2
116
117 .fi
118 Look at all the kernel information, with ram addresses"
119 .nf
120 readprofile -av | less
121
122 .fi
123 Browse a `freezed' profile buffer for a non current kernel:
124 .nf
125 readprofile -p ~/profile.freeze -m /zImage.map.gz
126
127 .fi
128 Request profiling at 2kHz per CPU, and reset the profiling buffer
129 .nf
130 sudo readprofile -M 20
131
132 .fi
133
134 .SH BUGS
135
136 .LP
137 .B readprofile
138 only works with an 1.3.x or newer kernel,
139 because
140 .B /proc/profile
141 changed in the step from 1.2 to 1.3
142
143 .LP
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.
146
147 .LP
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.
152
153 .LP
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.
157
158 .SH FILES
159 .nf
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 :-)
163 .fi
164