Filename | /usr/local/perls/perl-5.26.1/lib/5.26.1/CPAN/Debug.pm |
Statements | Executed 4522 statements in 16.0ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
119 | 5 | 4 | 11.9ms | 16.1ms | debug | CPAN::Debug::
952 | 2 | 1 | 4.27ms | 4.27ms | CORE:subst (opcode) | CPAN::Debug::
0 | 0 | 0 | 0s | 0s | BEGIN | CPAN::Debug::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # -*- Mode: cperl; coding: utf-8; cperl-indent-level: 4 -*- | ||||
2 | package CPAN::Debug; | ||||
3 | use strict; | ||||
4 | use vars qw($VERSION); | ||||
5 | |||||
6 | $VERSION = "5.5001"; | ||||
7 | # module is internal to CPAN.pm | ||||
8 | |||||
9 | %CPAN::DEBUG = qw[ | ||||
10 | CPAN 1 | ||||
11 | Index 2 | ||||
12 | InfoObj 4 | ||||
13 | Author 8 | ||||
14 | Distribution 16 | ||||
15 | Bundle 32 | ||||
16 | Module 64 | ||||
17 | CacheMgr 128 | ||||
18 | Complete 256 | ||||
19 | FTP 512 | ||||
20 | Shell 1024 | ||||
21 | Eval 2048 | ||||
22 | HandleConfig 4096 | ||||
23 | Tarzip 8192 | ||||
24 | Version 16384 | ||||
25 | Queue 32768 | ||||
26 | FirstTime 65536 | ||||
27 | ]; | ||||
28 | |||||
29 | $CPAN::DEBUG ||= 0; | ||||
30 | |||||
31 | #-> sub CPAN::Debug::debug ; | ||||
32 | # spent 16.1ms (11.9+4.27) within CPAN::Debug::debug which was called 119 times, avg 136µs/call:
# 114 times (11.5ms+4.12ms) by CPAN::CacheMgr::_clean_cache at line 183 of CPAN/CacheMgr.pm, avg 137µs/call
# 2 times (133µs+34µs) by CPAN::Shell::o at line 370 of CPAN/Shell.pm, avg 84µs/call
# once (92µs+66µs) by CPAN::Distribution::check_integrity at line 458 of CPAN/Distribution.pm
# once (63µs+23µs) by CPAN::Tarzip::TIEHANDLE at line 172 of CPAN/Tarzip.pm
# once (57µs+24µs) by CPAN::Tarzip::TIEHANDLE at line 190 of CPAN/Tarzip.pm | ||||
33 | 119 | 168µs | my($self,$arg) = @_; | ||
34 | |||||
35 | 119 | 66µs | my @caller; | ||
36 | 119 | 67µs | my $i = 0; | ||
37 | 119 | 44µs | while () { | ||
38 | 357 | 3.95ms | my(@c) = (caller($i))[0 .. ($i ? 3 : 2)]; | ||
39 | 357 | 239µs | last unless defined $c[0]; | ||
40 | 357 | 342µs | push @caller, \@c; | ||
41 | 357 | 300µs | for (0,3) { | ||
42 | 714 | 432µs | last if $_ > $#c; | ||
43 | 595 | 5.71ms | 595 | 3.10ms | $c[$_] =~ s/.*:://; # spent 3.10ms making 595 calls to CPAN::Debug::CORE:subst, avg 5µs/call |
44 | } | ||||
45 | 357 | 219µs | for (1) { | ||
46 | 357 | 2.74ms | 357 | 1.17ms | $c[$_] =~ s|.*/||; # spent 1.17ms making 357 calls to CPAN::Debug::CORE:subst, avg 3µs/call |
47 | } | ||||
48 | 357 | 354µs | last if ++$i>=3; | ||
49 | } | ||||
50 | 119 | 263µs | pop @caller; | ||
51 | 119 | 1.12ms | if ($CPAN::DEBUG{$caller[0][0]} & $CPAN::DEBUG) { | ||
52 | if ($arg and ref $arg) { | ||||
53 | eval { require Data::Dumper }; | ||||
54 | if ($@) { | ||||
55 | $CPAN::Frontend->myprint("Debug(\n" . $arg->as_string . ")\n"); | ||||
56 | } else { | ||||
57 | $CPAN::Frontend->myprint("Debug(\n" . Data::Dumper::Dumper($arg) . ")\n"); | ||||
58 | } | ||||
59 | } else { | ||||
60 | my $outer = ""; | ||||
61 | local $" = ","; | ||||
62 | if (@caller>1) { | ||||
63 | $outer = ",[@{$caller[1]}]"; | ||||
64 | } | ||||
65 | $CPAN::Frontend->myprint("Debug(@{$caller[0]}$outer): $arg\n"); | ||||
66 | } | ||||
67 | } | ||||
68 | } | ||||
69 | |||||
70 | 1; | ||||
71 | |||||
72 | __END__ | ||||
sub CPAN::Debug::CORE:subst; # opcode |