| 1 | .\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13 |
| 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 "2002-08-28" "perl v5.8.0" "Perl Programmers Reference Guide" |
| 133 | .SH "NAME" |
| 134 | dprofpp \- display perl profile data |
| 135 | .SH "SYNOPSIS" |
| 136 | .IX Header "SYNOPSIS" |
| 137 | dprofpp [\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 |
| 139 | dprofpp \fB\-T\fR [\fB\-F\fR] [\fB\-g subroutine\fR] [profile] |
| 140 | .PP |
| 141 | dprofpp \fB\-t\fR [\fB\-F\fR] [\fB\-g subroutine\fR] [profile] |
| 142 | .PP |
| 143 | dprofpp \fB\-G\fR <regexp> [\fB\-P\fR] [profile] |
| 144 | .PP |
| 145 | dprofpp \fB\-p script\fR [\fB\-Q\fR] [other opts] |
| 146 | .PP |
| 147 | dprofpp \fB\-V\fR [profile] |
| 148 | .SH "DESCRIPTION" |
| 149 | .IX Header "DESCRIPTION" |
| 150 | The \fIdprofpp\fR command interprets profile data produced by a profiler, such |
| 151 | as the Devel::DProf profiler. Dprofpp will read the file \fItmon.out\fR and |
| 152 | will display the 15 subroutines which are using the most time. By default |
| 153 | the times for each subroutine are given exclusive of the times of their |
| 154 | child subroutines. |
| 155 | .PP |
| 156 | To profile a Perl script run the perl interpreter with the \fB\-d\fR switch. So |
| 157 | to profile script \fItest.pl\fR with Devel::DProf the following command should |
| 158 | be used. |
| 159 | .PP |
| 160 | .Vb 1 |
| 161 | \& $ perl5 -d:DProf test.pl |
| 162 | .Ve |
| 163 | .PP |
| 164 | Then run dprofpp to analyze the profile. The output of dprofpp depends |
| 165 | on the flags to the program and the version of Perl you're using. |
| 166 | .PP |
| 167 | .Vb 9 |
| 168 | \& $ dprofpp -u |
| 169 | \& Total Elapsed Time = 1.67 Seconds |
| 170 | \& User Time = 0.61 Seconds |
| 171 | \& Exclusive Times |
| 172 | \& %Time Seconds #Calls sec/call Name |
| 173 | \& 52.4 0.320 2 0.1600 main::foo |
| 174 | \& 45.9 0.280 200 0.0014 main::bar |
| 175 | \& 0.00 0.000 1 0.0000 DynaLoader::import |
| 176 | \& 0.00 0.000 1 0.0000 main::baz |
| 177 | .Ve |
| 178 | .PP |
| 179 | The dprofpp tool can also run the profiler before analyzing the profile |
| 180 | data. The above two commands can be executed with one dprofpp command. |
| 181 | .PP |
| 182 | .Vb 1 |
| 183 | \& $ dprofpp -u -p test.pl |
| 184 | .Ve |
| 185 | .PP |
| 186 | Consult \*(L"\s-1PROFILE\s0 \s-1FORMAT\s0\*(R" in Devel::DProf for a description of the raw profile. |
| 187 | .SH "OUTPUT" |
| 188 | .IX Header "OUTPUT" |
| 189 | Columns are: |
| 190 | .IP "%Time" 4 |
| 191 | .IX Item "%Time" |
| 192 | Percentage of time spent in this routine. |
| 193 | .IP "#Calls" 4 |
| 194 | .IX Item "#Calls" |
| 195 | Number of calls to this routine. |
| 196 | .IP "sec/call" 4 |
| 197 | .IX Item "sec/call" |
| 198 | Average number of seconds per call to this routine. |
| 199 | .IP "Name" 4 |
| 200 | .IX Item "Name" |
| 201 | Name of routine. |
| 202 | .IP "CumulS" 4 |
| 203 | .IX Item "CumulS" |
| 204 | Time (in seconds) spent in this routine and routines called from it. |
| 205 | .IP "ExclSec" 4 |
| 206 | .IX Item "ExclSec" |
| 207 | Time (in seconds) spent in this routine (not including those called |
| 208 | from it). |
| 209 | .IP "Csec/c" 4 |
| 210 | .IX Item "Csec/c" |
| 211 | Average time (in seconds) spent in each call of this routine |
| 212 | (including those called from it). |
| 213 | .SH "OPTIONS" |
| 214 | .IX Header "OPTIONS" |
| 215 | .IP "\fB\-a\fR" 5 |
| 216 | .IX Item "-a" |
| 217 | Sort alphabetically by subroutine names. |
| 218 | .IP "\fB\-d\fR" 5 |
| 219 | .IX Item "-d" |
| 220 | Reverse whatever sort is used |
| 221 | .IP "\fB\-A\fR" 5 |
| 222 | .IX Item "-A" |
| 223 | Count timing for autoloaded subroutine as timing for \f(CW*::AUTOLOAD\fR. |
| 224 | Otherwise the time to autoload it is counted as time of the subroutine |
| 225 | itself (there is no way to separate autoload time from run time). |
| 226 | .Sp |
| 227 | This is going to be irrelevant with newer Perls. They will inform |
| 228 | \&\f(CW\*(C`Devel::DProf\*(C'\fR \fIwhen\fR the \f(CW\*(C`AUTOLOAD\*(C'\fR switches to actual subroutine, |
| 229 | so a separate statistics for \f(CW\*(C`AUTOLOAD\*(C'\fR will be collected no matter |
| 230 | whether this option is set. |
| 231 | .IP "\fB\-R\fR" 5 |
| 232 | .IX Item "-R" |
| 233 | Count anonymous subroutines defined in the same package separately. |
| 234 | .IP "\fB\-E\fR" 5 |
| 235 | .IX Item "-E" |
| 236 | (default) Display all subroutine times exclusive of child subroutine times. |
| 237 | .IP "\fB\-F\fR" 5 |
| 238 | .IX Item "-F" |
| 239 | Force the generation of fake exit timestamps if dprofpp reports that the |
| 240 | profile is garbled. This is only useful if dprofpp determines that the |
| 241 | profile is garbled due to missing exit timestamps. You're on your own if |
| 242 | you do this. Consult the \s-1BUGS\s0 section. |
| 243 | .IP "\fB\-I\fR" 5 |
| 244 | .IX Item "-I" |
| 245 | Display all subroutine times inclusive of child subroutine times. |
| 246 | .IP "\fB\-l\fR" 5 |
| 247 | .IX Item "-l" |
| 248 | Sort by number of calls to the subroutines. This may help identify |
| 249 | candidates for inlining. |
| 250 | .IP "\fB\-O cnt\fR" 5 |
| 251 | .IX Item "-O cnt" |
| 252 | Show only \fIcnt\fR subroutines. The default is 15. |
| 253 | .IP "\fB\-p script\fR" 5 |
| 254 | .IX Item "-p script" |
| 255 | Tells dprofpp that it should profile the given script and then interpret its |
| 256 | profile data. See \fB\-Q\fR. |
| 257 | .IP "\fB\-Q\fR" 5 |
| 258 | .IX Item "-Q" |
| 259 | Used with \fB\-p\fR to tell dprofpp to quit after profiling the script, without |
| 260 | interpreting the data. |
| 261 | .IP "\fB\-q\fR" 5 |
| 262 | .IX Item "-q" |
| 263 | Do not display column headers. |
| 264 | .IP "\fB\-r\fR" 5 |
| 265 | .IX Item "-r" |
| 266 | Display elapsed real times rather than user+system times. |
| 267 | .IP "\fB\-s\fR" 5 |
| 268 | .IX Item "-s" |
| 269 | Display system times rather than user+system times. |
| 270 | .IP "\fB\-T\fR" 5 |
| 271 | .IX Item "-T" |
| 272 | Display subroutine call tree to stdout. Subroutine statistics are |
| 273 | not displayed. |
| 274 | .IP "\fB\-t\fR" 5 |
| 275 | .IX Item "-t" |
| 276 | Display subroutine call tree to stdout. Subroutine statistics are not |
| 277 | displayed. When a function is called multiple consecutive times at the same |
| 278 | calling level then it is displayed once with a repeat count. |
| 279 | .IP "\fB\-S\fR" 5 |
| 280 | .IX Item "-S" |
| 281 | Display \fImerged\fR subroutine call tree to stdout. Statistics is |
| 282 | displayed for each branch of the tree. |
| 283 | .Sp |
| 284 | When a function is called multiple (\fInot necessarily consecutive\fR) |
| 285 | times in the same branch then all these calls go into one branch of |
| 286 | the next level. A repeat count is output together with combined |
| 287 | inclusive, exclusive and kids time. |
| 288 | .Sp |
| 289 | Branches are sorted w.r.t. inclusive time. |
| 290 | .IP "\fB\-U\fR" 5 |
| 291 | .IX Item "-U" |
| 292 | Do not sort. Display in the order found in the raw profile. |
| 293 | .IP "\fB\-u\fR" 5 |
| 294 | .IX Item "-u" |
| 295 | Display user times rather than user+system times. |
| 296 | .IP "\fB\-V\fR" 5 |
| 297 | .IX Item "-V" |
| 298 | Print dprofpp's version number and exit. If a raw profile is found then its |
| 299 | \&\s-1XS_VERSION\s0 variable will be displayed, too. |
| 300 | .IP "\fB\-v\fR" 5 |
| 301 | .IX Item "-v" |
| 302 | Sort by average time spent in subroutines during each call. This may help |
| 303 | identify candidates for inlining. |
| 304 | .IP "\fB\-z\fR" 5 |
| 305 | .IX Item "-z" |
| 306 | (default) Sort by amount of user+system time used. The first few lines |
| 307 | should show you which subroutines are using the most time. |
| 308 | .ie n .IP "\fB\-g\fR ""subroutine""" 5 |
| 309 | .el .IP "\fB\-g\fR \f(CWsubroutine\fR" 5 |
| 310 | .IX Item "-g subroutine" |
| 311 | Ignore subroutines except \f(CW\*(C`subroutine\*(C'\fR and whatever is called from it. |
| 312 | .IP "\fB\-G\fR <regexp>" 5 |
| 313 | .IX Item "-G <regexp>" |
| 314 | Aggregate \*(L"Group\*(R" all calls matching the pattern together. |
| 315 | For example this can be used to group all calls of a set of packages |
| 316 | .Sp |
| 317 | .Vb 1 |
| 318 | \& -G "(package1::)|(package2::)|(package3::)" |
| 319 | .Ve |
| 320 | .Sp |
| 321 | or to group subroutines by name: |
| 322 | .Sp |
| 323 | .Vb 1 |
| 324 | \& -G "getNum" |
| 325 | .Ve |
| 326 | .IP "\fB\-P\fR" 5 |
| 327 | .IX Item "-P" |
| 328 | Used with \-G to aggregate \*(L"Pull\*(R" together all calls that did not match \-G. |
| 329 | .IP "\fB\-f\fR <regexp>" 5 |
| 330 | .IX Item "-f <regexp>" |
| 331 | Filter all calls matching the pattern. |
| 332 | .SH "ENVIRONMENT" |
| 333 | .IX Header "ENVIRONMENT" |
| 334 | The environment variable \fB\s-1DPROFPP_OPTS\s0\fR can be set to a string containing |
| 335 | options for dprofpp. You might use this if you prefer \fB\-I\fR over \fB\-E\fR or |
| 336 | if you want \fB\-F\fR on all the time. |
| 337 | .PP |
| 338 | This was added fairly lazily, so there are some undesirable side effects. |
| 339 | Options on the commandline should override options in DPROFPP_OPTS\-\-but |
| 340 | don't count on that in this version. |
| 341 | .SH "BUGS" |
| 342 | .IX Header "BUGS" |
| 343 | Applications which call \fI_exit()\fR or \fIexec()\fR from within a subroutine |
| 344 | will leave an incomplete profile. See the \fB\-F\fR option. |
| 345 | .PP |
| 346 | Any bugs in Devel::DProf, or any profiler generating the profile data, could |
| 347 | be visible here. See \*(L"\s-1BUGS\s0\*(R" in Devel::DProf. |
| 348 | .PP |
| 349 | Mail bug reports and feature requests to the perl5\-porters mailing list at |
| 350 | \&\fI<perl5\-porters@perl.org>\fR. Bug reports should include the |
| 351 | output of the \fB\-V\fR option. |
| 352 | .SH "FILES" |
| 353 | .IX Header "FILES" |
| 354 | .Vb 2 |
| 355 | \& dprofpp - profile processor |
| 356 | \& tmon.out - raw profile |
| 357 | .Ve |
| 358 | .SH "SEE ALSO" |
| 359 | .IX Header "SEE ALSO" |
| 360 | perl, Devel::DProf, \fItimes\fR\|(2) |