version 2, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
DPROFPP |
|
|
2 |
!!!DPROFPP |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
OUTPUT |
|
|
7 |
OPTIONS |
|
|
8 |
ENVIRONMENT |
|
|
9 |
BUGS |
|
|
10 |
FILES |
|
|
11 |
SEE ALSO |
|
|
12 |
---- |
|
|
13 |
!!NAME |
|
|
14 |
|
|
|
15 |
|
|
|
16 |
dprofpp - display perl profile data |
|
|
17 |
!!SYNOPSIS |
|
|
18 |
|
|
|
19 |
|
|
|
20 |
dprofpp [[__-a-z-l-v-U__] [[__-s-r-u__] [[__-q__] |
|
|
21 |
[[__-F__] [[__-I-E__] [[__-O cnt__] [[__-A__] |
|
|
22 |
[[__-R__] [[__-S__] [[__-g subroutine__] |
|
|
23 |
[[profile] |
|
|
24 |
|
|
|
25 |
|
|
|
26 |
dprofpp __-T__ [[__-F__] [[__-g subroutine__] |
|
|
27 |
[[profile] |
|
|
28 |
|
|
|
29 |
|
|
|
30 |
dprofpp __-t__ [[__-F__] [[__-g subroutine__] |
|
|
31 |
[[profile] |
|
|
32 |
|
|
|
33 |
|
|
|
34 |
dprofpp __-p script__ [[__-Q__] [[other |
|
|
35 |
opts] |
|
|
36 |
|
|
|
37 |
|
|
|
38 |
dprofpp __-V__ [[profile] |
|
|
39 |
!!DESCRIPTION |
|
|
40 |
|
|
|
41 |
|
|
|
42 |
The ''dprofpp'' command interprets profile data produced |
|
|
43 |
by a profiler, such as the Devel::DProf profiler. Dprofpp |
|
|
44 |
will read the file ''tmon.out'' and will display the 15 |
|
|
45 |
subroutines which are using the most time. By default the |
|
|
46 |
times for each subroutine are given exclusive of the times |
|
|
47 |
of their child subroutines. |
|
|
48 |
|
|
|
49 |
|
|
|
50 |
To profile a Perl script run the perl interpreter with the |
|
|
51 |
__-d__ switch. So to profile script ''test.pl'' with |
|
|
52 |
Devel::DProf the following command should be |
|
|
53 |
used. |
|
|
54 |
|
|
|
55 |
|
|
|
56 |
$ perl5 -d:DProf test.pl |
|
|
57 |
Then run dprofpp to analyze the profile. The output of dprofpp depends on the flags to the program and the version of Perl you're using. |
|
|
58 |
|
|
|
59 |
|
|
|
60 |
$ dprofpp -u |
|
|
61 |
Total Elapsed Time = 1.67 Seconds |
|
|
62 |
User Time = 0.61 Seconds |
|
|
63 |
Exclusive Times |
|
|
64 |
%Time Seconds #Calls sec/call Name |
|
|
65 |
52.4 0.320 2 0.1600 main::foo |
|
|
66 |
45.9 0.280 200 0.0014 main::bar |
2 |
perry |
67 |
0.00 0.000 1 0.0000 !DynaLoader::import |
1 |
perry |
68 |
0.00 0.000 1 0.0000 main::baz |
|
|
69 |
The dprofpp tool can also run the profiler before analyzing the profile data. The above two commands can be executed with one dprofpp command. |
|
|
70 |
|
|
|
71 |
|
|
|
72 |
$ dprofpp -u -p test.pl |
|
|
73 |
Consult `` PROFILE FORMAT '' in Devel::DProf for a description of the raw profile. |
|
|
74 |
!!OUTPUT |
|
|
75 |
|
|
|
76 |
|
|
|
77 |
Columns are: |
|
|
78 |
|
|
|
79 |
|
|
|
80 |
%Time |
|
|
81 |
|
|
|
82 |
|
|
|
83 |
Percentage of time spent in this routine. |
|
|
84 |
|
|
|
85 |
|
|
|
86 |
#Calls |
|
|
87 |
|
|
|
88 |
|
|
|
89 |
Number of calls to this routine. |
|
|
90 |
|
|
|
91 |
|
|
|
92 |
sec/call |
|
|
93 |
|
|
|
94 |
|
|
|
95 |
Average number of seconds per call to this |
|
|
96 |
routine. |
|
|
97 |
|
|
|
98 |
|
|
|
99 |
Name |
|
|
100 |
|
|
|
101 |
|
|
|
102 |
Name of routine. |
|
|
103 |
|
|
|
104 |
|
|
|
105 |
CumulS |
|
|
106 |
|
|
|
107 |
|
|
|
108 |
Time (in seconds) spent in this routine and routines called |
|
|
109 |
from it. |
|
|
110 |
|
|
|
111 |
|
2 |
perry |
112 |
!ExclSec |
1 |
perry |
113 |
|
|
|
114 |
|
|
|
115 |
Time (in seconds) spent in this routine (not including those |
|
|
116 |
called from it). |
|
|
117 |
|
|
|
118 |
|
|
|
119 |
Csec/c |
|
|
120 |
|
|
|
121 |
|
|
|
122 |
Average time (in seconds) spent in each call of this routine |
|
|
123 |
(including those called from it). |
|
|
124 |
!!OPTIONS |
|
|
125 |
|
|
|
126 |
|
|
|
127 |
__-a__ |
|
|
128 |
|
|
|
129 |
|
|
|
130 |
Sort alphabetically by subroutine names. |
|
|
131 |
|
|
|
132 |
|
|
|
133 |
__-A__ |
|
|
134 |
|
|
|
135 |
|
|
|
136 |
Count timing for autoloaded subroutine as timing for |
|
|
137 |
*::AUTOLOAD. Otherwise the time to autoload it is |
|
|
138 |
counted as time of the subroutine itself (there is no way to |
|
|
139 |
separate autoload time from run time). |
|
|
140 |
|
|
|
141 |
|
|
|
142 |
This is going to be irrelevant with newer Perls. They will |
|
|
143 |
inform Devel::DProf ''when'' the |
|
|
144 |
AUTOLOAD switches to actual subroutine, so a |
|
|
145 |
separate statistics for AUTOLOAD will be collected |
|
|
146 |
no matter whether this option is set. |
|
|
147 |
|
|
|
148 |
|
|
|
149 |
__-R__ |
|
|
150 |
|
|
|
151 |
|
|
|
152 |
Count anonymous subroutines defined in the same package |
|
|
153 |
separately. |
|
|
154 |
|
|
|
155 |
|
|
|
156 |
__-E__ |
|
|
157 |
|
|
|
158 |
|
|
|
159 |
(default) Display all subroutine times exclusive of child |
|
|
160 |
subroutine times. |
|
|
161 |
|
|
|
162 |
|
|
|
163 |
__-F__ |
|
|
164 |
|
|
|
165 |
|
|
|
166 |
Force the generation of fake exit timestamps if dprofpp |
|
|
167 |
reports that the profile is garbled. This is only useful if |
|
|
168 |
dprofpp determines that the profile is garbled due to |
|
|
169 |
missing exit timestamps. You're on your own if you do this. |
|
|
170 |
Consult the BUGS section. |
|
|
171 |
|
|
|
172 |
|
|
|
173 |
__-I__ |
|
|
174 |
|
|
|
175 |
|
|
|
176 |
Display all subroutine times inclusive of child subroutine |
|
|
177 |
times. |
|
|
178 |
|
|
|
179 |
|
|
|
180 |
__-l__ |
|
|
181 |
|
|
|
182 |
|
|
|
183 |
Sort by number of calls to the subroutines. This may help |
|
|
184 |
identify candidates for inlining. |
|
|
185 |
|
|
|
186 |
|
|
|
187 |
__-O cnt__ |
|
|
188 |
|
|
|
189 |
|
|
|
190 |
Show only ''cnt'' subroutines. The default is |
|
|
191 |
15. |
|
|
192 |
|
|
|
193 |
|
|
|
194 |
__-p script__ |
|
|
195 |
|
|
|
196 |
|
|
|
197 |
Tells dprofpp that it should profile the given script and |
|
|
198 |
then interpret its profile data. See __-Q__. |
|
|
199 |
|
|
|
200 |
|
|
|
201 |
__-Q__ |
|
|
202 |
|
|
|
203 |
|
|
|
204 |
Used with __-p__ to tell dprofpp to quit after profiling |
|
|
205 |
the script, without interpreting the data. |
|
|
206 |
|
|
|
207 |
|
|
|
208 |
__-q__ |
|
|
209 |
|
|
|
210 |
|
|
|
211 |
Do not display column headers. |
|
|
212 |
|
|
|
213 |
|
|
|
214 |
__-r__ |
|
|
215 |
|
|
|
216 |
|
|
|
217 |
Display elapsed real times rather than user+system |
|
|
218 |
times. |
|
|
219 |
|
|
|
220 |
|
|
|
221 |
__-s__ |
|
|
222 |
|
|
|
223 |
|
|
|
224 |
Display system times rather than user+system |
|
|
225 |
times. |
|
|
226 |
|
|
|
227 |
|
|
|
228 |
__-T__ |
|
|
229 |
|
|
|
230 |
|
|
|
231 |
Display subroutine call tree to stdout. Subroutine |
|
|
232 |
statistics are not displayed. |
|
|
233 |
|
|
|
234 |
|
|
|
235 |
__-t__ |
|
|
236 |
|
|
|
237 |
|
|
|
238 |
Display subroutine call tree to stdout. Subroutine |
|
|
239 |
statistics are not displayed. When a function is called |
|
|
240 |
multiple consecutive times at the same calling level then it |
|
|
241 |
is displayed once with a repeat count. |
|
|
242 |
|
|
|
243 |
|
|
|
244 |
__-S__ |
|
|
245 |
|
|
|
246 |
|
|
|
247 |
Display ''merged'' subroutine call tree to stdout. |
|
|
248 |
Statistics is displayed for each branch of the |
|
|
249 |
tree. |
|
|
250 |
|
|
|
251 |
|
|
|
252 |
When a function is called multiple (''not necessarily |
|
|
253 |
consecutive'') times in the same branch then all these |
|
|
254 |
calls go into one branch of the next level. A repeat count |
|
|
255 |
is output together with combined inclusive, exclusive and |
|
|
256 |
kids time. |
|
|
257 |
|
|
|
258 |
|
|
|
259 |
Branches are sorted w.r.t. inclusive time. |
|
|
260 |
|
|
|
261 |
|
|
|
262 |
__-U__ |
|
|
263 |
|
|
|
264 |
|
|
|
265 |
Do not sort. Display in the order found in the raw |
|
|
266 |
profile. |
|
|
267 |
|
|
|
268 |
|
|
|
269 |
__-u__ |
|
|
270 |
|
|
|
271 |
|
|
|
272 |
Display user times rather than user+system |
|
|
273 |
times. |
|
|
274 |
|
|
|
275 |
|
|
|
276 |
__-V__ |
|
|
277 |
|
|
|
278 |
|
|
|
279 |
Print dprofpp's version number and exit. If a raw profile is |
|
|
280 |
found then its XS_VERSION variable will be |
|
|
281 |
displayed, too. |
|
|
282 |
|
|
|
283 |
|
|
|
284 |
__-v__ |
|
|
285 |
|
|
|
286 |
|
|
|
287 |
Sort by average time spent in subroutines during each call. |
|
|
288 |
This may help identify candidates for inlining. |
|
|
289 |
|
|
|
290 |
|
|
|
291 |
__-z__ |
|
|
292 |
|
|
|
293 |
|
|
|
294 |
(default) Sort by amount of user+system time used. The first |
|
|
295 |
few lines should show you which subroutines are using the |
|
|
296 |
most time. |
|
|
297 |
|
|
|
298 |
|
|
|
299 |
__-g__ subroutine |
|
|
300 |
|
|
|
301 |
|
|
|
302 |
Ignore subroutines except subroutine and whatever |
|
|
303 |
is called from it. |
|
|
304 |
!!ENVIRONMENT |
|
|
305 |
|
|
|
306 |
|
|
|
307 |
The environment variable __DPROFPP_OPTS__ |
|
|
308 |
can be set to a string containing options for dprofpp. You |
|
|
309 |
might use this if you prefer __-I__ over __-E__ or if |
|
|
310 |
you want __-F__ on all the time. |
|
|
311 |
|
|
|
312 |
|
|
|
313 |
This was added fairly lazily, so there are some undesirable |
|
|
314 |
side effects. Options on the commandline should override |
|
|
315 |
options in DPROFPP_OPTS--but don't count on that in this |
|
|
316 |
version. |
|
|
317 |
!!BUGS |
|
|
318 |
|
|
|
319 |
|
|
|
320 |
Applications which call ''_exit()'' or ''exec()'' from |
|
|
321 |
within a subroutine will leave an incomplete profile. See |
|
|
322 |
the __-F__ option. |
|
|
323 |
|
|
|
324 |
|
|
|
325 |
Any bugs in Devel::DProf, or any profiler generating the |
|
|
326 |
profile data, could be visible here. See `` |
|
|
327 |
BUGS '' in Devel::DProf. |
|
|
328 |
|
|
|
329 |
|
|
|
330 |
Mail bug reports and feature requests to the perl5-porters |
|
|
331 |
mailing list at ''''. Bug |
|
|
332 |
reports should include the output of the __-V__ |
|
|
333 |
option. |
|
|
334 |
!!FILES |
|
|
335 |
|
|
|
336 |
|
|
|
337 |
dprofpp - profile processor |
|
|
338 |
tmon.out - raw profile |
|
|
339 |
!!SEE ALSO |
|
|
340 |
|
|
|
341 |
|
|
|
342 |
perl, Devel::DProf, times(2) |
|
|
343 |
---- |