Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / v9 / man / man1 / dprofpp.1
CommitLineData
920dae64
AT
1.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
2.\"
3.\" Standard preamble:
4.\" ========================================================================
5.de Sh \" Subsection heading
6.br
7.if t .Sp
8.ne 5
9.PP
10\fB\\$1\fR
11.PP
12..
13.de Sp \" Vertical space (when we can't use .PP)
14.if t .sp .5v
15.if n .sp
16..
17.de Vb \" Begin verbatim text
18.ft CW
19.nf
20.ne \\$1
21..
22.de Ve \" End verbatim text
23.ft R
24.fi
25..
26.\" Set up some character translations and predefined strings. \*(-- will
27.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28.\" double quote, and \*(R" will give a right double quote. | will give a
29.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31.\" expand to `' in nroff, nothing in troff, for use with C<>.
32.tr \(*W-|\(bv\*(Tr
33.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34.ie n \{\
35. ds -- \(*W-
36. ds PI pi
37. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
39. ds L" ""
40. ds R" ""
41. ds C` ""
42. ds C' ""
43'br\}
44.el\{\
45. ds -- \|\(em\|
46. ds PI \(*p
47. ds L" ``
48. ds R" ''
49'br\}
50.\"
51.\" If the F register is turned on, we'll generate index entries on stderr for
52.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53.\" entries marked with X<> in POD. Of course, you'll have to process the
54.\" output yourself in some meaningful fashion.
55.if \nF \{\
56. de IX
57. tm Index:\\$1\t\\n%\t"\\$2"
58..
59. nr % 0
60. rr F
61.\}
62.\"
63.\" For nroff, turn off justification. Always turn off hyphenation; it makes
64.\" way too many mistakes in technical documents.
65.hy 0
66.if n .na
67.\"
68.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69.\" Fear. Run. Save yourself. No user-serviceable parts.
70. \" fudge factors for nroff and troff
71.if n \{\
72. ds #H 0
73. ds #V .8m
74. ds #F .3m
75. ds #[ \f1
76. ds #] \fP
77.\}
78.if t \{\
79. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80. ds #V .6m
81. ds #F 0
82. ds #[ \&
83. ds #] \&
84.\}
85. \" simple accents for nroff and troff
86.if n \{\
87. ds ' \&
88. ds ` \&
89. ds ^ \&
90. ds , \&
91. ds ~ ~
92. ds /
93.\}
94.if t \{\
95. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101.\}
102. \" troff and (daisy-wheel) nroff accents
103.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110.ds ae a\h'-(\w'a'u*4/10)'e
111.ds Ae A\h'-(\w'A'u*4/10)'E
112. \" corrections for vroff
113.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115. \" for low resolution devices (crt and lpr)
116.if \n(.H>23 .if \n(.V>19 \
117\{\
118. ds : e
119. ds 8 ss
120. ds o a
121. ds d- d\h'-1'\(ga
122. ds D- D\h'-1'\(hy
123. ds th \o'bp'
124. ds Th \o'LP'
125. ds ae ae
126. ds Ae AE
127.\}
128.rm #[ #] #H #V #F C
129.\" ========================================================================
130.\"
131.IX Title "DPROFPP 1"
132.TH DPROFPP 1 "2007-06-19" "perl v5.8.8" "Perl Programmers Reference Guide"
133.SH "NAME"
134dprofpp \- display perl profile data
135.SH "SYNOPSIS"
136.IX Header "SYNOPSIS"
137dprofpp [\fB\-a\fR|\fB\-z\fR|\fB\-l\fR|\fB\-v\fR|\fB\-U\fR] [\fB\-d\fR] [\fB\-s\fR|\fB\-r\fR|\fB\-u\fR] [\fB\-q\fR] [\fB\-F\fR] [\fB\-I|\-E\fR] [\fB\-O cnt\fR] [\fB\-A\fR] [\fB\-R\fR] [\fB\-S\fR] [\fB\-g subroutine\fR] [\fB\-G\fR <regexp> [\fB\-P\fR]] [\fB\-f\fR <regexp>] [profile]
138.PP
139dprofpp \fB\-T\fR [\fB\-F\fR] [\fB\-g subroutine\fR] [profile]
140.PP
141dprofpp \fB\-t\fR [\fB\-F\fR] [\fB\-g subroutine\fR] [profile]
142.PP
143dprofpp \fB\-G\fR <regexp> [\fB\-P\fR] [profile]
144.PP
145dprofpp \fB\-p script\fR [\fB\-Q\fR] [other opts]
146.PP
147dprofpp \fB\-V\fR [profile]
148.SH "DESCRIPTION"
149.IX Header "DESCRIPTION"
150The \fIdprofpp\fR command interprets profile data produced by a profiler, such
151as the Devel::DProf profiler. Dprofpp will read the file \fItmon.out\fR and
152display the 15 subroutines which are using the most time. By default
153the times for each subroutine are given exclusive of the times of their
154child subroutines.
155.PP
156To profile a Perl script run the perl interpreter with the \fB\-d\fR switch. So
157to profile script \fItest.pl\fR with Devel::DProf use the following:
158.PP
159.Vb 1
160\& $ perl5 -d:DProf test.pl
161.Ve
162.PP
163Then run dprofpp to analyze the profile. The output of dprofpp depends
164on the flags to the program and the version of Perl you're using.
165.PP
166.Vb 9
167\& $ dprofpp -u
168\& Total Elapsed Time = 1.67 Seconds
169\& User Time = 0.61 Seconds
170\& Exclusive Times
171\& %Time Seconds #Calls sec/call Name
172\& 52.4 0.320 2 0.1600 main::foo
173\& 45.9 0.280 200 0.0014 main::bar
174\& 0.00 0.000 1 0.0000 DynaLoader::import
175\& 0.00 0.000 1 0.0000 main::baz
176.Ve
177.PP
178The dprofpp tool can also run the profiler before analyzing the profile
179data. The above two commands can be executed with one dprofpp command.
180.PP
181.Vb 1
182\& $ dprofpp -u -p test.pl
183.Ve
184.PP
185Consult \*(L"\s-1PROFILE\s0 \s-1FORMAT\s0\*(R" in Devel::DProf for a description of the raw profile.
186.SH "OUTPUT"
187.IX Header "OUTPUT"
188Columns are:
189.IP "%Time" 4
190.IX Item "%Time"
191Percentage of time spent in this routine.
192.IP "#Calls" 4
193.IX Item "#Calls"
194Number of calls to this routine.
195.IP "sec/call" 4
196.IX Item "sec/call"
197Average number of seconds per call to this routine.
198.IP "Name" 4
199.IX Item "Name"
200Name of routine.
201.IP "CumulS" 4
202.IX Item "CumulS"
203Time (in seconds) spent in this routine and routines called from it.
204.IP "ExclSec" 4
205.IX Item "ExclSec"
206Time (in seconds) spent in this routine (not including those called
207from it).
208.IP "Csec/c" 4
209.IX Item "Csec/c"
210Average time (in seconds) spent in each call of this routine
211(including those called from it).
212.SH "OPTIONS"
213.IX Header "OPTIONS"
214.IP "\fB\-a\fR" 5
215.IX Item "-a"
216Sort alphabetically by subroutine names.
217.IP "\fB\-d\fR" 5
218.IX Item "-d"
219Reverse whatever sort is used
220.IP "\fB\-A\fR" 5
221.IX Item "-A"
222Count timing for autoloaded subroutine as timing for \f(CW*::AUTOLOAD\fR.
223Otherwise the time to autoload it is counted as time of the subroutine
224itself (there is no way to separate autoload time from run time).
225.Sp
226This is going to be irrelevant with newer Perls. They will inform
227\&\f(CW\*(C`Devel::DProf\*(C'\fR \fIwhen\fR the \f(CW\*(C`AUTOLOAD\*(C'\fR switches to actual subroutine,
228so a separate statistics for \f(CW\*(C`AUTOLOAD\*(C'\fR will be collected no matter
229whether this option is set.
230.IP "\fB\-R\fR" 5
231.IX Item "-R"
232Count anonymous subroutines defined in the same package separately.
233.IP "\fB\-E\fR" 5
234.IX Item "-E"
235(default) Display all subroutine times exclusive of child subroutine times.
236.IP "\fB\-F\fR" 5
237.IX Item "-F"
238Force the generation of fake exit timestamps if dprofpp reports that the
239profile is garbled. This is only useful if dprofpp determines that the
240profile is garbled due to missing exit timestamps. You're on your own if
241you do this. Consult the \s-1BUGS\s0 section.
242.IP "\fB\-I\fR" 5
243.IX Item "-I"
244Display all subroutine times inclusive of child subroutine times.
245.IP "\fB\-l\fR" 5
246.IX Item "-l"
247Sort by number of calls to the subroutines. This may help identify
248candidates for inlining.
249.IP "\fB\-O cnt\fR" 5
250.IX Item "-O cnt"
251Show only \fIcnt\fR subroutines. The default is 15.
252.IP "\fB\-p script\fR" 5
253.IX Item "-p script"
254Tells dprofpp that it should profile the given script and then interpret its
255profile data. See \fB\-Q\fR.
256.IP "\fB\-Q\fR" 5
257.IX Item "-Q"
258Used with \fB\-p\fR to tell dprofpp to quit after profiling the script, without
259interpreting the data.
260.IP "\fB\-q\fR" 5
261.IX Item "-q"
262Do not display column headers.
263.IP "\fB\-r\fR" 5
264.IX Item "-r"
265Display elapsed real times rather than user+system times.
266.IP "\fB\-s\fR" 5
267.IX Item "-s"
268Display system times rather than user+system times.
269.IP "\fB\-T\fR" 5
270.IX Item "-T"
271Display subroutine call tree to stdout. Subroutine statistics are
272not displayed.
273.IP "\fB\-t\fR" 5
274.IX Item "-t"
275Display subroutine call tree to stdout. Subroutine statistics are not
276displayed. When a function is called multiple consecutive times at the same
277calling level then it is displayed once with a repeat count.
278.IP "\fB\-S\fR" 5
279.IX Item "-S"
280Display \fImerged\fR subroutine call tree to stdout. Statistics are
281displayed for each branch of the tree.
282.Sp
283When a function is called multiple (\fInot necessarily consecutive\fR)
284times in the same branch then all these calls go into one branch of
285the next level. A repeat count is output together with combined
286inclusive, exclusive and kids time.
287.Sp
288Branches are sorted with regard to inclusive time.
289.IP "\fB\-U\fR" 5
290.IX Item "-U"
291Do not sort. Display in the order found in the raw profile.
292.IP "\fB\-u\fR" 5
293.IX Item "-u"
294Display user times rather than user+system times.
295.IP "\fB\-V\fR" 5
296.IX Item "-V"
297Print dprofpp's version number and exit. If a raw profile is found then its
298\&\s-1XS_VERSION\s0 variable will be displayed, too.
299.IP "\fB\-v\fR" 5
300.IX Item "-v"
301Sort by average time spent in subroutines during each call. This may help
302identify candidates for inlining.
303.IP "\fB\-z\fR" 5
304.IX Item "-z"
305(default) Sort by amount of user+system time used. The first few lines
306should show you which subroutines are using the most time.
307.ie n .IP "\fB\-g\fR ""subroutine""" 5
308.el .IP "\fB\-g\fR \f(CWsubroutine\fR" 5
309.IX Item "-g subroutine"
310Ignore subroutines except \f(CW\*(C`subroutine\*(C'\fR and whatever is called from it.
311.IP "\fB\-G\fR <regexp>" 5
312.IX Item "-G <regexp>"
313Aggregate \*(L"Group\*(R" all calls matching the pattern together.
314For example this can be used to group all calls of a set of packages
315.Sp
316.Vb 1
317\& -G "(package1::)|(package2::)|(package3::)"
318.Ve
319.Sp
320or to group subroutines by name:
321.Sp
322.Vb 1
323\& -G "getNum"
324.Ve
325.IP "\fB\-P\fR" 5
326.IX Item "-P"
327Used with \-G to aggregate \*(L"Pull\*(R" together all calls that did not match \-G.
328.IP "\fB\-f\fR <regexp>" 5
329.IX Item "-f <regexp>"
330Filter all calls matching the pattern.
331.IP "\fB\-h\fR" 5
332.IX Item "-h"
333Display brief help and exit.
334.IP "\fB\-H\fR" 5
335.IX Item "-H"
336Display long help and exit.
337.SH "ENVIRONMENT"
338.IX Header "ENVIRONMENT"
339The environment variable \fB\s-1DPROFPP_OPTS\s0\fR can be set to a string containing
340options for dprofpp. You might use this if you prefer \fB\-I\fR over \fB\-E\fR or
341if you want \fB\-F\fR on all the time.
342.PP
343This was added fairly lazily, so there are some undesirable side effects.
344Options on the commandline should override options in DPROFPP_OPTS\-\-but
345don't count on that in this version.
346.SH "BUGS"
347.IX Header "BUGS"
348Applications which call \fI_exit()\fR or \fIexec()\fR from within a subroutine
349will leave an incomplete profile. See the \fB\-F\fR option.
350.PP
351Any bugs in Devel::DProf, or any profiler generating the profile data, could
352be visible here. See \*(L"\s-1BUGS\s0\*(R" in Devel::DProf.
353.PP
354Mail bug reports and feature requests to the perl5\-porters mailing list at
355\&\fI<perl5\-porters@perl.org>\fR. Bug reports should include the
356output of the \fB\-V\fR option.
357.SH "FILES"
358.IX Header "FILES"
359.Vb 2
360\& dprofpp - profile processor
361\& tmon.out - raw profile
362.Ve
363.SH "SEE ALSO"
364.IX Header "SEE ALSO"
365perl, Devel::DProf, \fItimes\fR\|(2)