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