OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / util-linux / original / man1 / 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, or if you keep System.map elsewhere. If the name of
38 the map file ends with `.gz' it 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 -b
73 Print individual histogram-bin counts.
74
75 .TP
76 .B -r
77 Reset the profiling buffer. This can only be invoked by root, because
78 .B /proc/profile
79 is readable by everybody but writable only by the superuser. However,
80 you can make 
81 .B readprofile
82 setuid 0, in order to reset the buffer without gaining privileges.
83
84 .TP
85 .RB -M " multiplier"
86 On some architectures it is possible to alter the frequency at which
87 the kernel delivers profiling interrupts to each CPU.  This option allows you to
88 set the frequency, as a multiplier of the system clock frequency, HZ.
89 This is supported on i386-SMP (2.2 and 2.4 kernel) and also on sparc-SMP
90 and sparc64-SMP (2.4 kernel).  This option also resets the profiling buffer,
91 and requires superuser privileges.
92
93 .TP
94 .B -v
95 Verbose. The output is organized in four columns and filled with blanks.
96 The first column is the RAM address of a kernel function, the second is
97 the name of the function, the third is the number of clock ticks and the
98 last is the normalized load.
99
100 .TP
101 .B -V
102 Version. This makes
103 .B readprofile
104 print its version number and exit.
105
106 .SH EXAMPLES
107 Browse the profiling buffer ordering by clock ticks:
108 .nf
109    readprofile | sort -nr | less
110
111 .fi
112 Print the 20 most loaded procedures:
113 .nf
114    readprofile | sort -nr +2 | head -20
115
116 .fi
117 Print only filesystem profile:
118 .nf
119    readprofile | grep _ext2
120
121 .fi
122 Look at all the kernel information, with ram addresses"
123 .nf
124    readprofile -av | less
125
126 .fi
127 Browse a `freezed' profile buffer for a non current kernel:
128 .nf
129    readprofile -p ~/profile.freeze -m /zImage.map.gz
130
131 .fi
132 Request profiling at 2kHz per CPU, and reset the profiling buffer
133 .nf
134    sudo readprofile -M 20
135
136 .fi
137
138 .SH BUGS
139
140 .LP
141 .B readprofile
142 only works with an 1.3.x or newer kernel,
143 because 
144 .B /proc/profile
145 changed in the step from 1.2 to 1.3
146
147 .LP
148 This program only works with ELF kernels. The change for a.out kernels
149 is trivial, and left as an exercise to the a.out user.
150
151 .LP
152 To enable profiling, the kernel must be rebooted, because no profiling module
153 is available, and it wouldn't be easy to build. To enable profiling,
154 you can specify "profile=2" (or another number) on the kernel commandline.
155 The number you specify is the two-exponent used as profiling step.
156
157 .LP
158 Profiling is disabled when interrupts are inhibited. This means that many
159 profiling ticks happen when interrupts are re-enabled. Watch out for
160 misleading information.
161
162 .SH FILES
163 .nf
164 /proc/profile              A binary snapshot of the profiling buffer.
165 /usr/src/linux/System.map  The symbol table for the kernel.
166 /usr/src/linux/*           The program being profiled :-)
167 .fi
168