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