| Filename | /home/lbr/.plenv/versions/5.20.2/lib/perl5/5.20.2/x86_64-linux/lib.pm |
| Statements | Executed 31 statements in 412µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 493µs | 3.16ms | lib::BEGIN@6 |
| 1 | 1 | 1 | 29µs | 41µs | lib::import |
| 1 | 1 | 1 | 5µs | 14µs | lib::BEGIN@8 |
| 1 | 1 | 1 | 4µs | 4µs | lib::_get_dirs |
| 1 | 1 | 1 | 4µs | 4µs | lib::CORE:ftis (opcode) |
| 4 | 4 | 1 | 4µs | 4µs | lib::CORE:ftdir (opcode) |
| 1 | 1 | 1 | 300ns | 300ns | lib::CORE:match (opcode) |
| 0 | 0 | 0 | 0s | 0s | lib::unimport |
| 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 | 64µs | 2 | 3.17ms | # spent 3.16ms (493µs+2.67) within lib::BEGIN@6 which was called:
# once (493µs+2.67ms) by main::BEGIN@1 at line 6 # spent 3.16ms making 1 call to lib::BEGIN@6
# spent 8µs making 1 call to Config::import |
| 7 | |||||
| 8 | 2 | 287µs | 2 | 24µs | # spent 14µs (5+10) within lib::BEGIN@8 which was called:
# once (5µs+10µs) by main::BEGIN@1 at line 8 # spent 14µs making 1 call to lib::BEGIN@8
# spent 10µs making 1 call to strict::import |
| 9 | |||||
| 10 | 1 | 6µs | 1 | 3µs | my $archname = $Config{archname}; # spent 3µs making 1 call to Config::FETCH |
| 11 | 1 | 2µs | 1 | 1µs | my $version = $Config{version}; # spent 1µs making 1 call to Config::FETCH |
| 12 | 1 | 3µs | 1 | 1µs | my @inc_version_list = reverse split / /, $Config{inc_version_list}; # spent 1µs making 1 call to Config::FETCH |
| 13 | |||||
| 14 | |||||
| 15 | 1 | 900ns | our @ORIG_INC = @INC; # take a handy copy of 'original' value | ||
| 16 | 1 | 200ns | our $VERSION = '0.63'; | ||
| 17 | |||||
| 18 | # spent 41µs (29+12) within lib::import which was called:
# once (29µs+12µs) by main::BEGIN@1 at line 1 of opt.pl | ||||
| 19 | 1 | 200ns | shift; | ||
| 20 | |||||
| 21 | 1 | 200ns | my %names; | ||
| 22 | 1 | 900ns | foreach (reverse @_) { | ||
| 23 | 1 | 300ns | my $path = $_; # we'll be modifying it, so break the alias | ||
| 24 | 1 | 300ns | if ($path eq '') { | ||
| 25 | require Carp; | ||||
| 26 | Carp::carp("Empty compile time value given to use lib"); | ||||
| 27 | } | ||||
| 28 | |||||
| 29 | 1 | 13µs | 3 | 5µs | if ($path !~ /\.par$/i && -e $path && ! -d _) { # spent 4µs making 1 call to lib::CORE:ftis
# spent 700ns making 1 call to lib::CORE:ftdir
# spent 300ns making 1 call to lib::CORE:match |
| 30 | require Carp; | ||||
| 31 | Carp::carp("Parameter to use lib must be directory, not file"); | ||||
| 32 | } | ||||
| 33 | 1 | 800ns | unshift(@INC, $path); | ||
| 34 | # Add any previous version directories we found at configure time | ||||
| 35 | 1 | 600ns | 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 | 1 | 2µs | 1 | 4µs | my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir) # spent 4µs making 1 call to lib::_get_dirs |
| 43 | = _get_dirs($path); | ||||
| 44 | 1 | 4µs | 1 | 2µs | unshift(@INC, $arch_dir) if -d $arch_auto_dir; # spent 2µs making 1 call to lib::CORE:ftdir |
| 45 | 1 | 2µs | 1 | 500ns | unshift(@INC, $version_dir) if -d $version_dir; # spent 500ns making 1 call to lib::CORE:ftdir |
| 46 | 1 | 6µs | 1 | 400ns | unshift(@INC, $version_arch_dir) if -d $version_arch_dir; # spent 400ns making 1 call to lib::CORE:ftdir |
| 47 | } | ||||
| 48 | |||||
| 49 | # remove trailing duplicates | ||||
| 50 | 1 | 5µs | @INC = grep { ++$names{$_} == 1 } @INC; | ||
| 51 | 1 | 5µ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 4µs within lib::_get_dirs which was called:
# once (4µs+0s) by lib::import at line 42 | ||||
| 74 | 1 | 300ns | my($dir) = @_; | ||
| 75 | 1 | 200ns | my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir); | ||
| 76 | |||||
| 77 | 1 | 800ns | $arch_auto_dir = "$dir/$archname/auto"; | ||
| 78 | 1 | 600ns | $arch_dir = "$dir/$archname"; | ||
| 79 | 1 | 400ns | $version_dir = "$dir/$version"; | ||
| 80 | 1 | 700ns | $version_arch_dir = "$dir/$version/$archname"; | ||
| 81 | |||||
| 82 | 1 | 2µs | return($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir); | ||
| 83 | } | ||||
| 84 | |||||
| 85 | 1 | 5µs | 1; | ||
| 86 | __END__ | ||||
sub lib::CORE:ftdir; # opcode | |||||
# spent 4µs within lib::CORE:ftis which was called:
# once (4µs+0s) by lib::import at line 29 | |||||
# spent 300ns within lib::CORE:match which was called:
# once (300ns+0s) by lib::import at line 29 |