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