]> git.ipfire.org Git - thirdparty/util-linux.git/blob - sys-utils/readprofile.8.adoc
Merge branch 'PR/lscpu-caches-sep' of github.com:karelzak/util-linux-work
[thirdparty/util-linux.git] / sys-utils / readprofile.8.adoc
1 //po4a: entry man manual
2 = readprofile(8)
3 :doctype: manpage
4 :man manual: System Administration
5 :man source: util-linux {release-version}
6 :page-layout: base
7 :command: readprofile
8
9 == NAME
10
11 readprofile - read kernel profiling information
12
13 == SYNOPSIS
14
15 *readprofile* [options]
16
17 == VERSION
18
19 This manpage documents version 2.0 of the program.
20
21 == DESCRIPTION
22
23 The *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*::
28 Print all symbols in the mapfile. By default the procedures with reported ticks are not printed.
29
30 *-b*, *--histbin*::
31 Print individual histogram-bin counts.
32
33 *-i*, *--info*::
34 Info. 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.
35
36 *-m*, *--mapfile* _mapfile_::
37 Specify 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.
38
39 *-M*, *--multiplier* _multiplier_::
40 On 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.
41
42 *-p*, *--profile* _pro-file_::
43 Specify 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.
44
45 *-r*, *--reset*::
46 Reset 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.
47
48 *-s, --counters*::
49 Print individual counters within functions.
50
51 *-v*, *--verbose*::
52 Verbose. 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.
53
54 include::man-common/help-version.adoc[]
55
56 == FILES
57
58 _/proc/profile_::
59 A binary snapshot of the profiling buffer.
60
61 _/usr/src/linux/System.map_::
62 The symbol table for the kernel.
63
64 _/usr/src/linux/*_::
65 The program being profiled :-)
66
67 == BUGS
68
69 *readprofile* only works with a 1.3.x or newer kernel, because _/proc/profile_ changed in the step from 1.2 to 1.3.
70
71 This program only works with ELF kernels. The change for a.out kernels is trivial, and left as an exercise to the a.out user.
72
73 To 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.
74
75 Profiling is disabled when interrupts are inhibited. This means that many profiling ticks happen when interrupts are re-enabled. Watch out for misleading information.
76
77 == EXAMPLE
78
79 Browse the profiling buffer ordering by clock ticks:
80
81 ....
82 readprofile | sort -nr | less
83 ....
84
85 Print the 20 most loaded procedures:
86
87 ....
88 readprofile | sort -nr +2 | head -20
89 ....
90
91 Print only filesystem profile:
92
93 ....
94 readprofile | grep _ext2
95 ....
96
97 Look at all the kernel information, with ram addresses:
98
99 ....
100 readprofile -av | less
101 ....
102
103 Browse a 'frozen' profile buffer for a non current kernel:
104
105 ....
106 readprofile -p ~/profile.freeze -m /zImage.map.gz
107 ....
108
109 Request profiling at 2kHz per CPU, and reset the profiling buffer:
110
111 ....
112 sudo readprofile -M 20
113 ....
114
115 include::man-common/bugreports.adoc[]
116
117 include::man-common/footer.adoc[]
118
119 ifdef::translation[]
120 include::man-common/translation.adoc[]
121 endif::[]