]> git.ipfire.org Git - thirdparty/util-linux.git/blob - sys-utils/readprofile.8
Manual pages: order NOTES / HISTORY / BUGS / EXAMPLE consistently
[thirdparty/util-linux.git] / sys-utils / readprofile.8
1 .TH READPROFILE "8" "October 2011" "util-linux" "System Administration"
2 .SH NAME
3 readprofile \- read kernel profiling information
4 .SH SYNOPSIS
5 .B readprofile
6 [options]
7 .SH VERSION
8 This manpage documents version 2.0 of the program.
9 .SH DESCRIPTION
10 .LP
11 The
12 .B readprofile
13 command uses the
14 .I /proc/profile
15 information to print ascii data on standard output. The output is
16 organized in three columns: the first is the number of clock ticks,
17 the second is the name of the C function in the kernel where those
18 many ticks occurred, and the third is the normalized `load' of the
19 procedure, calculated as a ratio between the number of ticks and the
20 length of the procedure. The output is filled with blanks to ease
21 readability.
22 .SH OPTIONS
23 .TP
24 \fB\-a\fR, \fB\-\-all\fR
25 Print all symbols in the mapfile. By default the procedures with
26 reported ticks are not printed.
27 .TP
28 \fB\-b\fR, \fB\-\-histbin\fR
29 Print individual histogram-bin counts.
30 .TP
31 \fB\-i\fR, \fB\-\-info\fR
32 Info. This makes
33 .B readprofile
34 only print the profiling step used by the kernel. The profiling step
35 is the resolution of the profiling buffer, and is chosen during
36 kernel configuration (through `make config'), or in the kernel's
37 command line. If the
38 .B \-t
39 (terse) switch is used together with
40 .B \-i
41 only the decimal number is printed.
42 .TP
43 \fB\-m\fR, \fB\-\-mapfile\fR \fImapfile\fR
44 Specify a mapfile, which by default is
45 .IR /usr/src/linux/System.map .
46 You should specify the map file on cmdline if your current kernel
47 isn't the last one you compiled, or if you keep System.map elsewhere.
48 If the name of the map file ends with `.gz' it is decompressed on the
49 fly.
50 .TP
51 \fB\-M\fR, \fB\-\-multiplier\fR \fImultiplier\fR
52 On some architectures it is possible to alter the frequency at which
53 the kernel delivers profiling interrupts to each CPU. This option
54 allows you to set the frequency, as a multiplier of the system clock
55 frequency, HZ. Linux 2.6.16 dropped multiplier support for most systems.
56 This option also resets the profiling buffer, and requires superuser
57 privileges.
58 .TP
59 \fB\-p\fR, \fB\-\-profile\fR \fIpro-file\fR
60 Specify a different profiling buffer, which by default is
61 .IR /proc/profile .
62 Using a different pro-file is useful if you want to `freeze' the
63 kernel profiling at some time and read it later. The
64 .I /proc/profile
65 file can be copied using `cat' or `cp'. There is no more support for
66 compressed profile buffers, like in
67 .B readprofile-1.1,
68 because the program needs to know the size of the buffer in advance.
69 .TP
70 \fB\-r\fR, \fB\-\-reset\fR
71 Reset the profiling buffer. This can only be invoked by root,
72 because
73 .I /proc/profile
74 is readable by everybody but writable only by the superuser.
75 However, you can make
76 .B readprofile
77 set-user-ID 0, in order to reset the buffer without gaining privileges.
78 .TP
79 \fB\-s, \fB\-\-counters\fR
80 Print individual counters within functions.
81 .TP
82 \fB\-v\fR, \fB\-\-verbose\fR
83 Verbose. The output is organized in four columns and filled with
84 blanks. The first column is the RAM address of a kernel function,
85 the second is the name of the function, the third is the number of
86 clock ticks and the last is the normalized load.
87 .TP
88 \fB\-V\fR, \fB\-\-version\fR
89 Display version information and exit.
90 .TP
91 \fB\-h\fR, \fB\-\-help\fR
92 Display help text and exit.
93 .SH FILES
94 .nf
95 /proc/profile A binary snapshot of the profiling buffer.
96 /usr/src/linux/System.map The symbol table for the kernel.
97 /usr/src/linux/* The program being profiled :-)
98 .fi
99 .SH BUGS
100 .LP
101 .B readprofile
102 only works with a 1.3.x or newer kernel, because
103 .I /proc/profile
104 changed in the step from 1.2 to 1.3
105 .LP
106 This program only works with ELF kernels. The change for a.out
107 kernels is trivial, and left as an exercise to the a.out user.
108 .LP
109 To enable profiling, the kernel must be rebooted, because no
110 profiling module is available, and it wouldn't be easy to build. To
111 enable profiling, you can specify "profile=2" (or another number) on
112 the kernel commandline. The number you specify is the two-exponent
113 used as profiling step.
114 .LP
115 Profiling is disabled when interrupts are inhibited. This means that
116 many profiling ticks happen when interrupts are re-enabled. Watch
117 out for misleading information.
118 .SH EXAMPLE
119 Browse the profiling buffer ordering by clock ticks:
120 .nf
121 readprofile | sort \-nr | less
122
123 .fi
124 Print the 20 most loaded procedures:
125 .nf
126 readprofile | sort \-nr +2 | head \-20
127
128 .fi
129 Print only filesystem profile:
130 .nf
131 readprofile | grep _ext2
132
133 .fi
134 Look at all the kernel information, with ram addresses:
135 .nf
136 readprofile \-av | less
137
138 .fi
139 Browse a `frozen' profile buffer for a non current kernel:
140 .nf
141 readprofile \-p ~/profile.freeze \-m /zImage.map.gz
142
143 .fi
144 Request profiling at 2kHz per CPU, and reset the profiling buffer:
145 .nf
146 sudo readprofile \-M 20
147 .fi
148 .SH AVAILABILITY
149 The readprofile command is part of the util-linux package and is
150 available from
151 .UR https://\:www.kernel.org\:/pub\:/linux\:/utils\:/util-linux/
152 Linux Kernel Archive
153 .UE .