← Index
Performance Profile   « block view • line view • sub view »
For ./awstats.pl
  Run on Wed Feb 11 19:11:27 2009
Reported on Thu Feb 12 02:07:44 2009

File/usr/lib/perl/5.8/DynaLoader.pm
Statements Executed74
Total Time0.073827 seconds

Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
2120.060780.06078DynaLoader::dl_load_file (xsub)
1110.000200.06120DynaLoader::bootstrap
2122.1e-52.1e-5DynaLoader::dl_undef_symbols (xsub)
2122.0e-52.0e-5DynaLoader::dl_install_xsub (xsub)
2121.8e-51.8e-5DynaLoader::dl_find_symbol (xsub)
1111.3e-51.3e-5DynaLoader::dl_load_flags
00000DynaLoader::BEGIN
00000DynaLoader::bootstrap_inherit
00000DynaLoader::croak

LineStmts.Exclusive
Time
Avg.Code
1# Generated from DynaLoader.pm.PL
2
3package DynaLoader;
4
5# And Gandalf said: 'Many folk like to know beforehand what is to
6# be set on the table; but those who have laboured to prepare the
7# feast like to keep their secret; for wonder makes the words of
8# praise louder.'
9
10# (Quote from Tolkien suggested by Anno Siegel.)
11#
12# See pod text at end of file for documentation.
13# See also ext/DynaLoader/README in source tree for other information.
14#
15# Tim.Bunce@ig.co.uk, August 1994
16
1739.8e-53.3e-5use vars qw($VERSION *AUTOLOAD);
# spent 77µs making 1 call to vars::import
18
1912.0e-62.0e-6$VERSION = '1.04'; # avoid typo warning
20
2110.010510.01051require AutoLoader;
2214.0e-64.0e-6*AUTOLOAD = \&AutoLoader::AUTOLOAD;
23
2430.001880.00063use Config;
# spent 37µs making 1 call to Config::import
25
26# The following require can't be removed during maintenance
27# releases, sadly, because of the risk of buggy code that does
28# require Carp; Carp::croak "..."; without brackets dying
29# if Carp hasn't been loaded in earlier compile time. :-(
30# We'll let those bugs get found on the development track.
3112.0e-62.0e-6require Carp if $] < 5.00450;
32
33# enable debug/trace messages from DynaLoader perl code
3413.0e-63.0e-6$dl_debug = $ENV{PERL_DL_DEBUG} || 0 unless defined $dl_debug;
35
36#
37# Flags to alter dl_load_file behaviour. Assigned bits:
38# 0x01 make symbols available for linking later dl_load_file's.
39# (only known to work on Solaris 2 using dlopen(RTLD_GLOBAL))
40# (ignored under VMS; effect is built-in to image linking)
41#
42# This is called as a class method $module->dl_load_flags. The
43# definition here will be inherited and result on "default" loading
44# behaviour unless a sub-class of DynaLoader defines its own version.
45#
46
4713.0e-63.0e-6
# spent 13µs within DynaLoader::dl_load_flags which was called # once (13µs+0) by DynaLoader::bootstrap at line 225
sub dl_load_flags { 0x00 }
48
49# ($dl_dlext, $dlsrc)
50# = @Config::Config{'dlext', 'dlsrc'};
5113.0e-63.0e-6 ($dl_dlext, $dlsrc) = ('so','dl_dlopen.xs')
52;
53# Some systems need special handling to expand file specifications
54# (VMS support by Charles Bailey <bailey@HMIVAX.HUMGEN.UPENN.EDU>)
55# See dl_expandspec() for more details. Should be harmless but
56# inefficient to define on systems that don't need it.
5713.0e-63.0e-6$Is_VMS = $^O eq 'VMS';
5811.0e-61.0e-6$do_expand = $Is_VMS;
5912.0e-62.0e-6$Is_MacOS = $^O eq 'MacOS';
60
6111.0e-61.0e-6my $Mac_FS;
6211.0e-61.0e-6$Mac_FS = eval { require Mac::FileSpec::Unixish } if $Is_MacOS;
63
6412.0e-62.0e-6@dl_require_symbols = (); # names of symbols we need
6511.0e-61.0e-6@dl_resolve_using = (); # names of files to link with
6612.0e-62.0e-6@dl_library_path = (); # path to look for files
67
68#XSLoader.pm may have added elements before we were required
69#@dl_librefs = (); # things we have loaded
70#@dl_modules = (); # Modules we have loaded
71
72# This is a fix to support DLD's unfortunate desire to relink -lc
7311.0e-61.0e-6@dl_resolve_using = dl_findfile('-lc') if $dlsrc eq "dl_dld.xs";
74
75# Initialise @dl_library_path with the 'standard' library path
76# for this platform as determined by Configure.
77
7812.7e-52.7e-5push(@dl_library_path, split(' ', $Config::Config{libpth}));
# spent 18µs making 1 call to Config::FETCH
79
8011.5e-51.5e-5my $ldlibpthname = $Config::Config{ldlibpthname};
# spent 13µs making 1 call to Config::FETCH
8111.3e-51.3e-5my $ldlibpthname_defined = defined $Config::Config{ldlibpthname};
# spent 11µs making 1 call to Config::FETCH
8211.4e-51.4e-5my $pthsep = $Config::Config{path_sep};
# spent 12µs making 1 call to Config::FETCH
83
84# Add to @dl_library_path any extra directories we can gather from environment
85# during runtime.
86
8712.0e-62.0e-6if ($ldlibpthname_defined &&
88 exists $ENV{$ldlibpthname}) {
89 push(@dl_library_path, split(/$pthsep/, $ENV{$ldlibpthname}));
90}
91
92# E.g. HP-UX supports both its native SHLIB_PATH *and* LD_LIBRARY_PATH.
93
9411.0e-61.0e-6if ($ldlibpthname_defined &&
95 $ldlibpthname ne 'LD_LIBRARY_PATH' &&
96 exists $ENV{LD_LIBRARY_PATH}) {
97 push(@dl_library_path, split(/$pthsep/, $ENV{LD_LIBRARY_PATH}));
98}
99
100# No prizes for guessing why we don't say 'bootstrap DynaLoader;' here.
101# NOTE: All dl_*.xs (including dl_none.xs) define a dl_error() XSUB
10212.0e-62.0e-6boot_DynaLoader('DynaLoader') if defined(&boot_DynaLoader) &&
103 !defined(&dl_error);
104
10511.0e-61.0e-6if ($dl_debug) {
106 print STDERR "DynaLoader.pm loaded (@INC, @dl_library_path)\n";
107 print STDERR "DynaLoader not linked into this perl\n"
108 unless defined(&boot_DynaLoader);
109}
110
11114.1e-54.1e-51; # End of main code
112
113sub croak { require Carp; Carp::croak(@_) }
114
115sub bootstrap_inherit {
116 my $module = $_[0];
117 local *isa = *{"$module\::ISA"};
118 local @isa = (@isa, 'DynaLoader');
119 # Cannot goto due to delocalization. Will report errors on a wrong line?
120 bootstrap(@_);
121}
122
123# The bootstrap function cannot be autoloaded (without complications)
124# so we define it here:
125
126
# spent 61.2ms (203µs+61.0) within DynaLoader::bootstrap which was called # once (203µs+61.0ms) at line 19 of /usr/local/lib/perl/5.8.8/Geo/IP.pm
sub bootstrap {
127 # use local vars to enable $module.bs script to edit values
128310.061130.00197 local(@args) = @_;
129 local($module) = $args[0];
130 local(@dirs, $file);
131
132 unless ($module) {
133 require Carp;
134 Carp::confess("Usage: DynaLoader::bootstrap(module)");
135 }
136
137 # A common error on platforms which don't support dynamic loading.
138 # Since it's fatal and potentially confusing we give a detailed message.
139 croak("Can't load module $module, dynamic loading not available in this perl.\n".
140 " (You may need to build a new perl executable which either supports\n".
141 " dynamic loading or has the $module module statically linked into it.)\n")
142 unless defined(&dl_load_file);
143
144 my @modparts = split(/::/,$module);
145 my $modfname = $modparts[-1];
146
147 # Some systems have restrictions on files names for DLL's etc.
148 # mod2fname returns appropriate file base name (typically truncated)
149 # It may also edit @modparts if required.
150 $modfname = &mod2fname(\@modparts) if defined &mod2fname;
151
152 # Truncate the module name to 8.3 format for NetWare
153 if (($^O eq 'NetWare') && (length($modfname) > 8)) {
154 $modfname = substr($modfname, 0, 8);
155 }
156
157 my $modpname = join(($Is_MacOS ? ':' : '/'),@modparts);
158
159 print STDERR "DynaLoader::bootstrap for $module ",
160 ($Is_MacOS
161 ? "(:auto:$modpname:$modfname.$dl_dlext)\n" :
162 "(auto/$modpname/$modfname.$dl_dlext)\n")
163 if $dl_debug;
164
165 foreach (@INC) {
166105.0e-55.0e-6 chop($_ = VMS::Filespec::unixpath($_)) if $Is_VMS;
167 my $dir;
16827.0e-63.5e-6 if ($Is_MacOS) {
169 my $path = $_;
170 if ($Mac_FS && ! -d $path) {
171 $path = Mac::FileSpec::Unixish::nativize($path);
172 }
173 $path .= ":" unless /:$/;
174 $dir = "${path}auto:$modpname";
175 } else {
176 $dir = "$_/auto/$modpname";
177 }
178
179 next unless -d $dir; # skip over uninteresting directories
180
181 # check for common cases to avoid autoload of dl_findfile
182 my $try = $Is_MacOS ? "$dir:$modfname.$dl_dlext" : "$dir/$modfname.$dl_dlext";
183 last if $file = ($do_expand) ? dl_expandspec($try) : ((-f $try) && $try);
184
185 # no luck here, save dir for possible later dl_findfile search
186 push @dirs, $dir;
187 }
188 # last resort, let dl_findfile have a go in all known locations
189 $file = dl_findfile(map("-L$_",@dirs,@INC), $modfname) unless $file;
190
191 croak("Can't locate loadable object for module $module in \@INC (\@INC contains: @INC)")
192 unless $file; # wording similar to error from 'require'
193
194 $file = uc($file) if $Is_VMS && $Config::Config{d_vms_case_sensitive_symbols};
195 my $bootname = "boot_$module";
196 $bootname =~ s/\W/_/g;
197 @dl_require_symbols = ($bootname);
198
199 # Execute optional '.bootstrap' perl script for this module.
200 # The .bs file can be used to configure @dl_resolve_using etc to
201 # match the needs of the individual module on this architecture.
202 my $bs = $file;
203 $bs =~ s/(\.\w+)?(;\d*)?$/\.bs/; # look for .bs 'beside' the library
204 if (-s $bs) { # only read file if it's not empty
205 print STDERR "BS: $bs ($^O, $dlsrc)\n" if $dl_debug;
206 eval { do $bs; };
207 warn "$bs: $@\n" if $@;
208 }
209
210 my $boot_symbol_ref;
211
212 if ($^O eq 'darwin') {
213 if ($boot_symbol_ref = dl_find_symbol(0, $bootname)) {
214 goto boot; #extension library has already been loaded, e.g. darwin
215 }
216 }
217
218 # Many dynamic extension loading problems will appear to come from
219 # this section of code: XYZ failed at line 123 of DynaLoader.pm.
220 # Often these errors are actually occurring in the initialisation
221 # C code of the extension XS file. Perl reports the error as being
222 # in this perl code simply because this was the last perl code
223 # it executed.
224
225 my $libref = dl_load_file($file, $module->dl_load_flags) or
# spent 60.8ms making 1 call to DynaLoader::dl_load_file # spent 13µs making 1 call to DynaLoader::dl_load_flags
226 croak("Can't load '$file' for module $module: ".dl_error());
227
228 push(@dl_librefs,$libref); # record loaded object
229
230 my @unresolved = dl_undef_symbols();
# spent 21µs making 1 call to DynaLoader::dl_undef_symbols
231 if (@unresolved) {
232 require Carp;
233 Carp::carp("Undefined symbols present after loading $file: @unresolved\n");
234 }
235
236 $boot_symbol_ref = dl_find_symbol($libref, $bootname) or
# spent 18µs making 1 call to DynaLoader::dl_find_symbol
237 croak("Can't find '$bootname' symbol in $file\n");
238
239 push(@dl_modules, $module); # record loaded module
240
241 boot:
# spent 20µs making 1 call to DynaLoader::dl_install_xsub
242 my $xs = dl_install_xsub("${module}::bootstrap", $boot_symbol_ref, $file);
243
244 # See comment block above
245 &$xs(@args);
# spent 144µs making 1 call to Geo::IP::bootstrap
246}
247
248#sub _check_file { # private utility to handle dl_expandspec vs -f tests
249# my($file) = @_;
250# return $file if (!$do_expand && -f $file); # the common case
251# return $file if ( $do_expand && ($file=dl_expandspec($file)));
252# return undef;
253#}
254
255# Let autosplit and the autoloader deal with these functions:
# spent 18µs within DynaLoader::dl_find_symbol which was called # once (18µs+0) by DynaLoader::bootstrap at line 236 of /usr/lib/perl/5.8/DynaLoader.pm
sub DynaLoader::dl_find_symbol; # xsub
# spent 20µs within DynaLoader::dl_install_xsub which was called # once (20µs+0) by DynaLoader::bootstrap at line 241 of /usr/lib/perl/5.8/DynaLoader.pm
sub DynaLoader::dl_install_xsub; # xsub
# spent 60.8ms within DynaLoader::dl_load_file which was called # once (60.8ms+0) by DynaLoader::bootstrap at line 225 of /usr/lib/perl/5.8/DynaLoader.pm
sub DynaLoader::dl_load_file; # xsub
# spent 21µs within DynaLoader::dl_undef_symbols which was called # once (21µs+0) by DynaLoader::bootstrap at line 230 of /usr/lib/perl/5.8/DynaLoader.pm
sub DynaLoader::dl_undef_symbols; # xsub