Filename | /usr/local/lib/perl5/5.24/mach/lib.pm |
Statements | Executed 62 statements in 1.70ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
2 | 2 | 2 | 416µs | 602µs | import | lib::
2 | 1 | 1 | 65µs | 65µs | CORE:ftis (opcode) | lib::
7 | 4 | 1 | 58µs | 58µs | CORE:ftdir (opcode) | lib::
2 | 1 | 1 | 51µs | 51µs | _get_dirs | lib::
1 | 1 | 1 | 46µs | 97µs | BEGIN@6 | lib::
1 | 1 | 1 | 22µs | 34µs | BEGIN@8 | lib::
2 | 1 | 1 | 12µs | 12µs | CORE:match (opcode) | lib::
0 | 0 | 0 | 0s | 0s | unimport | lib::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package lib; | ||||
2 | |||||
3 | # THIS FILE IS AUTOMATICALLY GENERATED FROM lib_pm.PL. | ||||
4 | # ANY CHANGES TO THIS FILE WILL BE OVERWRITTEN BY THE NEXT PERL BUILD. | ||||
5 | |||||
6 | 2 | 62µs | 2 | 148µs | # spent 97µs (46+51) within lib::BEGIN@6 which was called:
# once (46µs+51µs) by main::BEGIN@39 at line 6 # spent 97µs making 1 call to lib::BEGIN@6
# spent 51µs making 1 call to Config::import |
7 | |||||
8 | 2 | 949µs | 2 | 47µs | # spent 34µs (22+12) within lib::BEGIN@8 which was called:
# once (22µs+12µs) by main::BEGIN@39 at line 8 # spent 34µs making 1 call to lib::BEGIN@8
# spent 12µs making 1 call to strict::import |
9 | |||||
10 | 1 | 22µs | 1 | 14µs | my $archname = $Config{archname}; # spent 14µs making 1 call to Config::FETCH |
11 | 1 | 10µs | 1 | 8µs | my $version = $Config{version}; # spent 8µs making 1 call to Config::FETCH |
12 | 1 | 16µs | 1 | 8µs | my @inc_version_list = reverse split / /, $Config{inc_version_list}; # spent 8µs making 1 call to Config::FETCH |
13 | |||||
14 | |||||
15 | 1 | 3µs | our @ORIG_INC = @INC; # take a handy copy of 'original' value | ||
16 | 1 | 2µs | our $VERSION = '0.63'; | ||
17 | |||||
18 | # spent 602µs (416+186) within lib::import which was called 2 times, avg 301µs/call:
# once (277µs+109µs) by main::BEGIN@39 at line 39 of /usr/local/bin/sa-learn
# once (139µs+77µs) by Razor2::Client::Agent::BEGIN@13 at line 13 of Razor2/Client/Agent.pm | ||||
19 | 2 | 4µs | shift; | ||
20 | |||||
21 | 2 | 5µs | my %names; | ||
22 | 2 | 10µs | foreach (reverse @_) { | ||
23 | 2 | 6µs | my $path = $_; # we'll be modifying it, so break the alias | ||
24 | 2 | 5µs | if ($path eq '') { | ||
25 | require Carp; | ||||
26 | Carp::carp("Empty compile time value given to use lib"); | ||||
27 | } | ||||
28 | |||||
29 | 2 | 282µs | 5 | 86µs | if ($path !~ /\.par$/i && -e $path && ! -d _) { # spent 65µs making 2 calls to lib::CORE:ftis, avg 33µs/call
# spent 12µs making 2 calls to lib::CORE:match, avg 6µs/call
# spent 8µs making 1 call to lib::CORE:ftdir |
30 | require Carp; | ||||
31 | Carp::carp("Parameter to use lib must be directory, not file"); | ||||
32 | } | ||||
33 | 2 | 9µs | unshift(@INC, $path); | ||
34 | # Add any previous version directories we found at configure time | ||||
35 | 2 | 9µs | foreach my $incver (@inc_version_list) | ||
36 | { | ||||
37 | my $dir = "$path/$incver"; | ||||
38 | unshift(@INC, $dir) if -d $dir; | ||||
39 | } | ||||
40 | # Put a corresponding archlib directory in front of $path if it | ||||
41 | # looks like $path has an archlib directory below it. | ||||
42 | 2 | 19µs | 2 | 51µs | my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir) # spent 51µs making 2 calls to lib::_get_dirs, avg 25µs/call |
43 | = _get_dirs($path); | ||||
44 | 2 | 38µs | 2 | 23µs | unshift(@INC, $arch_dir) if -d $arch_auto_dir; # spent 23µs making 2 calls to lib::CORE:ftdir, avg 12µs/call |
45 | 2 | 30µs | 2 | 14µs | unshift(@INC, $version_dir) if -d $version_dir; # spent 14µs making 2 calls to lib::CORE:ftdir, avg 7µs/call |
46 | 2 | 32µs | 2 | 13µs | unshift(@INC, $version_arch_dir) if -d $version_arch_dir; # spent 13µs making 2 calls to lib::CORE:ftdir, avg 6µs/call |
47 | } | ||||
48 | |||||
49 | # remove trailing duplicates | ||||
50 | 12 | 85µs | @INC = grep { ++$names{$_} == 1 } @INC; | ||
51 | 2 | 21µs | return; | ||
52 | } | ||||
53 | |||||
54 | |||||
55 | sub unimport { | ||||
56 | shift; | ||||
57 | |||||
58 | my %names; | ||||
59 | foreach my $path (@_) { | ||||
60 | my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir) | ||||
61 | = _get_dirs($path); | ||||
62 | ++$names{$path}; | ||||
63 | ++$names{$arch_dir} if -d $arch_auto_dir; | ||||
64 | ++$names{$version_dir} if -d $version_dir; | ||||
65 | ++$names{$version_arch_dir} if -d $version_arch_dir; | ||||
66 | } | ||||
67 | |||||
68 | # Remove ALL instances of each named directory. | ||||
69 | @INC = grep { !exists $names{$_} } @INC; | ||||
70 | return; | ||||
71 | } | ||||
72 | |||||
73 | # spent 51µs within lib::_get_dirs which was called 2 times, avg 25µs/call:
# 2 times (51µs+0s) by lib::import at line 42, avg 25µs/call | ||||
74 | 2 | 5µs | my($dir) = @_; | ||
75 | 2 | 3µs | my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir); | ||
76 | |||||
77 | 2 | 9µs | $arch_auto_dir = "$dir/$archname/auto"; | ||
78 | 2 | 6µs | $arch_dir = "$dir/$archname"; | ||
79 | 2 | 6µs | $version_dir = "$dir/$version"; | ||
80 | 2 | 7µs | $version_arch_dir = "$dir/$version/$archname"; | ||
81 | |||||
82 | 2 | 19µs | return($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir); | ||
83 | } | ||||
84 | |||||
85 | 1 | 23µs | 1; | ||
86 | __END__ | ||||
sub lib::CORE:ftdir; # opcode | |||||
# spent 65µs within lib::CORE:ftis which was called 2 times, avg 33µs/call:
# 2 times (65µs+0s) by lib::import at line 29, avg 33µs/call | |||||
# spent 12µs within lib::CORE:match which was called 2 times, avg 6µs/call:
# 2 times (12µs+0s) by lib::import at line 29, avg 6µs/call |