]> git.ipfire.org Git - thirdparty/util-linux.git/blame - sys-utils/readprofile.1
Imported from util-linux-2.5 tarball.
[thirdparty/util-linux.git] / sys-utils / readprofile.1
CommitLineData
6dbe3af9
KZ
1.TH READPROFILE 1 "January 1995"
2.UC 4
3.SH NAME
4readprofile - a tool to read kernel profiling information
5.SH SYNOPSIS
6.B readprofile
7[
8.I options
9]
10
11.SH VERSION
12This manpage documents version 1.1 of the program.
13
14.SH DESCRIPTION
15
16.LP
17The
18.B readprofile
19command uses the
20.B /proc/profile
21information to print ascii data on standard output.
22The output is
23organized in three columns: the first is the number of clock ticks,
24the second is the name of the C function in the kernel where those many
25ticks occurred, and the third is the normalized `load' of the procedure,
26calculated as a ratio between the number of thicks and the lenght of
27the procedure. The output is filled with blanks to ease readability.
28
29.LP
30Available command line options are the following:
31
32.TP
33.RB -m " mapfile"
34Specify a mapfile, which by default is
35.B /usr/src/linux/System.map.
36To ease use of
37.B readprofile
38with kernels in the 1.1.7x series, if the default file can't be opened,
39the alternate file
40.B /usr/src/linux/zSystem.map
41is tried.
42You should specify the map file on cmdline if your current kernel isn't the
43last one you compiled. If the name of the map file ends with `.gz' it
44is decompressed on the fly.
45
46.TP
47.RB -p " pro-file"
48Specify a different profiling buffer, which by default is
49.B /proc/profile.
50Using a different pro-file is useful if you want to `freeze' the
51kernel profiling at some time and read it later. The
52.B /proc/profile
53file can be copied using `cat' or `cp'. If the name of the pro-file
54ends by `.gz' it is decompressed on the fly. The pro-file is such that
55.B gzip
56shrinks it by 50-100 times.
57
58.TP
59.B -i
60Info. This makes
61.B readprofile
62only print the profiling step used by the kernel.
63The profiling step is the resolution of the profiling buffer, and
64is chosen during kernel configuration (through `make config').
65If the
66.B -t
67(terse) switch is used together with
68.B -i
69only the decimal number is printed.
70
71.TP
72.B -a
73Print all symbols in the mapfile. By default the procedures with 0 reported
74ticks are not printed.
75
76.TP
77.B -r
78Reset the profiling buffer. This can only be invoked by root, because
79.B /proc/profile
80is readable by everybody but writable only by the superuser.
81
82.TP
83.B -t
84Terse. This causes the output to be unfilled. It is the format used in the
85first release of
86.B readprofile.
87
88.TP
89.B -v
90Verbose. The output is organized in four columns and filled with blanks.
91The first column is the RAM address of a kernel function, the second is
92the name of the function, the third is the number of clock ticks and the
93last is the normalized load.
94
95.TP
96.B -V
97Version. This makes
98.B readprofile
99print its version number and exit.
100
101.SH EXAMPLES
102Browse the profiling buffer ordering by clock ticks:
103.nf
104 readprofile | sort -nr | less
105
106.fi
107Print the 20 most loaded procedures:
108.nf
109 readprofile | sort -nr +2 | head -20
110
111.fi
112Print only filesystem profile:
113.nf
114 readprofile | grep _ext2
115
116.fi
117Look at all the kernel information, with ram addresses"
118.nf
119 readprofile -av | less
120
121.fi
122Browse a gzipped `freezed' profile buffer for a non current kernel:
123.nf
124 readprofile -p ~/profile.freeze.gz -m /zImage.map
125
126.fi
127
128.SH BUGS
129
130.LP
131.B readprofile
132needs a kernel version 1.1.73 or newer, because
133.B /proc/profile
134is absent
135in older versions.
136
137.LP
138To enable profiling, the kernel must be reconfigured, recompiled, and
139rebooted. No profiling module is available, and it wouldn't be easy to
140build. So this can be construed as a feature.
141
142.LP
143Profiling is disabled when interrupts are inhibited. This means that many
144profiling ticks happen when interrupts are re-enabled. Watch out for
145misleading information.
146
147.SH AUTHOR
148
149Readprofile and /proc/profile are by Alessandro Rubini (rubini@ipvvis.unipv.it)
150
151.SH FILES
152.nf
153/proc/profile A binary snapshot of the profiling buffer.
154/usr/src/linux/System.map The symbol table for the kernel.
155/usr/src/linux/zSystem.map Old name for the symbol table.
156
157/usr/src/linux/* The program being profiled :-)
158.fi
159