← Index
NYTProf Performance Profile   « line view »
For webmerge/scripts/webmerge.pl
  Run on Mon Oct 7 02:42:42 2013
Reported on Mon Oct 7 03:03:18 2013

Filename/usr/lib64/perl5/5.16.0/x86_64-linux/DynaLoader.pm
StatementsExecuted 145 statements in 157ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
311138ms138msDynaLoader::::dl_load_fileDynaLoader::dl_load_file (xsub)
1113.70ms4.45msDynaLoader::::BEGIN@22DynaLoader::BEGIN@22
3331.55ms149msDynaLoader::::bootstrapDynaLoader::bootstrap
621430µs430µsDynaLoader::::CORE:substDynaLoader::CORE:subst (opcode)
1511338µs338µsDynaLoader::::CORE:ftdirDynaLoader::CORE:ftdir (opcode)
311142µs142µsDynaLoader::::dl_install_xsubDynaLoader::dl_install_xsub (xsub)
31172µs72µsDynaLoader::::CORE:ftsizeDynaLoader::CORE:ftsize (opcode)
11156µs56µsDynaLoader::::BEGIN@18DynaLoader::BEGIN@18
31142µs42µsDynaLoader::::dl_find_symbolDynaLoader::dl_find_symbol (xsub)
31136µs36µsDynaLoader::::dl_load_flagsDynaLoader::dl_load_flags
31134µs34µsDynaLoader::::dl_undef_symbolsDynaLoader::dl_undef_symbols (xsub)
31133µs33µsDynaLoader::::CORE:ftfileDynaLoader::CORE:ftfile (opcode)
0000s0sDynaLoader::::bootstrap_inheritDynaLoader::bootstrap_inherit
0000s0sDynaLoader::::croakDynaLoader::croak
0000s0sDynaLoader::::dl_expandspecDynaLoader::dl_expandspec
0000s0sDynaLoader::::dl_find_symbol_anywhereDynaLoader::dl_find_symbol_anywhere
0000s0sDynaLoader::::dl_findfileDynaLoader::dl_findfile
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1
2# Generated from DynaLoader_pm.PL
3
4package DynaLoader;
5
6# And Gandalf said: 'Many folk like to know beforehand what is to
7# be set on the table; but those who have laboured to prepare the
8# feast like to keep their secret; for wonder makes the words of
9# praise louder.'
10
11# (Quote from Tolkien suggested by Anno Siegel.)
12#
13# See pod text at end of file for documentation.
14# See also ext/DynaLoader/README in source tree for other information.
15#
16# Tim.Bunce@ig.co.uk, August 1994
17
18
# spent 56µs within DynaLoader::BEGIN@18 which was called: # once (56µs+0s) by List::MoreUtils::BEGIN@6 at line 20
BEGIN {
19152µs $VERSION = '1.14';
201130µs156µs}
# spent 56µs making 1 call to DynaLoader::BEGIN@18
21
2228.47ms24.52ms
# spent 4.45ms (3.70+752µs) within DynaLoader::BEGIN@22 which was called: # once (3.70ms+752µs) by List::MoreUtils::BEGIN@6 at line 22
use Config;
# spent 4.45ms making 1 call to DynaLoader::BEGIN@22 # spent 67µs making 1 call to Config::import
23
24# enable debug/trace messages from DynaLoader perl code
2518µs$dl_debug = $ENV{PERL_DL_DEBUG} || 0 unless defined $dl_debug;
26
27#
28# Flags to alter dl_load_file behaviour. Assigned bits:
29# 0x01 make symbols available for linking later dl_load_file's.
30# (only known to work on Solaris 2 using dlopen(RTLD_GLOBAL))
31# (ignored under VMS; effect is built-in to image linking)
32#
33# This is called as a class method $module->dl_load_flags. The
34# definition here will be inherited and result on "default" loading
35# behaviour unless a sub-class of DynaLoader defines its own version.
36#
37
38353µs
# spent 36µs within DynaLoader::dl_load_flags which was called 3 times, avg 12µs/call: # 3 times (36µs+0s) by DynaLoader::bootstrap at line 190, avg 12µs/call
sub dl_load_flags { 0x00 }
39
40186µs361µs($dl_dlext, $dl_so, $dlsrc) = @Config::Config{qw(dlext so dlsrc)};
# spent 61µs making 3 calls to Config::FETCH, avg 20µs/call
41
42
4312µs$do_expand = 0;
44
4514µs@dl_require_symbols = (); # names of symbols we need
4611µs@dl_resolve_using = (); # names of files to link with
4711µs@dl_library_path = (); # path to look for files
48
49#XSLoader.pm may have added elements before we were required
50#@dl_shared_objects = (); # shared objects for symbols we have
51#@dl_librefs = (); # things we have loaded
52#@dl_modules = (); # Modules we have loaded
53
54# This is a fix to support DLD's unfortunate desire to relink -lc
5512µs@dl_resolve_using = dl_findfile('-lc') if $dlsrc eq "dl_dld.xs";
56
57# Initialise @dl_library_path with the 'standard' library path
58# for this platform as determined by Configure.
59
60131µs114µspush(@dl_library_path, split(' ', $Config::Config{libpth}));
# spent 14µs making 1 call to Config::FETCH
61
62
63125µs114µsmy $ldlibpthname = $Config::Config{ldlibpthname};
# spent 14µs making 1 call to Config::FETCH
64124µs113µsmy $ldlibpthname_defined = defined $Config::Config{ldlibpthname};
# spent 13µs making 1 call to Config::FETCH
65123µs113µsmy $pthsep = $Config::Config{path_sep};
# spent 13µs making 1 call to Config::FETCH
66
67# Add to @dl_library_path any extra directories we can gather from environment
68# during runtime.
69
7012µsif ($ldlibpthname_defined &&
71 exists $ENV{$ldlibpthname}) {
72 push(@dl_library_path, split(/$pthsep/, $ENV{$ldlibpthname}));
73}
74
75# E.g. HP-UX supports both its native SHLIB_PATH *and* LD_LIBRARY_PATH.
76
7712µsif ($ldlibpthname_defined &&
78 $ldlibpthname ne 'LD_LIBRARY_PATH' &&
79 exists $ENV{LD_LIBRARY_PATH}) {
80 push(@dl_library_path, split(/$pthsep/, $ENV{LD_LIBRARY_PATH}));
81}
82
83
84# No prizes for guessing why we don't say 'bootstrap DynaLoader;' here.
85# NOTE: All dl_*.xs (including dl_none.xs) define a dl_error() XSUB
8614µsboot_DynaLoader('DynaLoader') if defined(&boot_DynaLoader) &&
87 !defined(&dl_error);
88
891500nsif ($dl_debug) {
90 print STDERR "DynaLoader.pm loaded (@INC, @dl_library_path)\n";
91 print STDERR "DynaLoader not linked into this perl\n"
92 unless defined(&boot_DynaLoader);
93}
94
95178µs1; # End of main code
96
97
98sub croak { require Carp; Carp::croak(@_) }
99
100sub bootstrap_inherit {
101 my $module = $_[0];
102 local *isa = *{"$module\::ISA"};
103 local @isa = (@isa, 'DynaLoader');
104 # Cannot goto due to delocalization. Will report errors on a wrong line?
105 bootstrap(@_);
106}
107
108
# spent 149ms (1.55+147) within DynaLoader::bootstrap which was called 3 times, avg 49.5ms/call: # once (476µs+109ms) by OCBNET::Spritesets::Block::new at line 67 of Graphics/Magick.pm # once (467µs+26.5ms) by XML::LibXML::BEGIN@29 at line 148 of XML/LibXML.pm # once (605µs+11.8ms) by List::MoreUtils::BEGIN@9 at line 36 of List/MoreUtils.pm
sub bootstrap {
109 # use local vars to enable $module.bs script to edit values
110328µs local(@args) = @_;
111313µs local($module) = $args[0];
112318µs local(@dirs, $file);
113
11434µs unless ($module) {
115 require Carp;
116 Carp::confess("Usage: DynaLoader::bootstrap(module)");
117 }
118
119 # A common error on platforms which don't support dynamic loading.
120 # Since it's fatal and potentially confusing we give a detailed message.
121313µs croak("Can't load module $module, dynamic loading not available in this perl.\n".
122 " (You may need to build a new perl executable which either supports\n".
123 " dynamic loading or has the $module module statically linked into it.)\n")
124 unless defined(&dl_load_file);
125
- -
128341µs my @modparts = split(/::/,$module);
12939µs my $modfname = $modparts[-1];
130
131 # Some systems have restrictions on files names for DLL's etc.
132 # mod2fname returns appropriate file base name (typically truncated)
133 # It may also edit @modparts if required.
13436µs $modfname = &mod2fname(\@modparts) if defined &mod2fname;
135
136
137
138318µs my $modpname = join('/',@modparts);
139
14035µs print STDERR "DynaLoader::bootstrap for $module ",
141 "(auto/$modpname/$modfname.$dl_dlext)\n"
142 if $dl_debug;
143
144331µs foreach (@INC) {
145
1461555µs my $dir = "$_/auto/$modpname";
147
14815574µs15338µs next unless -d $dir; # skip over uninteresting directories
# spent 338µs making 15 calls to DynaLoader::CORE:ftdir, avg 23µs/call
149
150 # check for common cases to avoid autoload of dl_findfile
151320µs my $try = "$dir/$modfname.$dl_dlext";
1523113µs333µs last if $file = ($do_expand) ? dl_expandspec($try) : ((-f $try) && $try);
# spent 33µs making 3 calls to DynaLoader::CORE:ftfile, avg 11µs/call
153
154 # no luck here, save dir for possible later dl_findfile search
155 push @dirs, $dir;
156 }
157 # last resort, let dl_findfile have a go in all known locations
15835µs $file = dl_findfile(map("-L$_",@dirs,@INC), $modfname) unless $file;
159
16032µs croak("Can't locate loadable object for module $module in \@INC (\@INC contains: @INC)")
161 unless $file; # wording similar to error from 'require'
162
163
164311µs my $bootname = "boot_$module";
1653111µs353µs $bootname =~ s/\W/_/g;
# spent 53µs making 3 calls to DynaLoader::CORE:subst, avg 18µs/call
166322µs @dl_require_symbols = ($bootname);
167
168 # Execute optional '.bootstrap' perl script for this module.
169 # The .bs file can be used to configure @dl_resolve_using etc to
170 # match the needs of the individual module on this architecture.
17137µs my $bs = $file;
1723437µs3376µs $bs =~ s/(\.\w+)?(;\d*)?$/\.bs/; # look for .bs 'beside' the library
# spent 376µs making 3 calls to DynaLoader::CORE:subst, avg 125µs/call
1733125µs372µs if (-s $bs) { # only read file if it's not empty
# spent 72µs making 3 calls to DynaLoader::CORE:ftsize, avg 24µs/call
174 print STDERR "BS: $bs ($^O, $dlsrc)\n" if $dl_debug;
175 eval { do $bs; };
176 warn "$bs: $@\n" if $@;
177 }
178
17934µs my $boot_symbol_ref;
180
181
182
183 # Many dynamic extension loading problems will appear to come from
184 # this section of code: XYZ failed at line 123 of DynaLoader.pm.
185 # Often these errors are actually occurring in the initialisation
186 # C code of the extension XS file. Perl reports the error as being
187 # in this perl code simply because this was the last perl code
188 # it executed.
189
1903139ms6138ms my $libref = dl_load_file($file, $module->dl_load_flags) or
# spent 138ms making 3 calls to DynaLoader::dl_load_file, avg 46.1ms/call # spent 36µs making 3 calls to DynaLoader::dl_load_flags, avg 12µs/call
191 croak("Can't load '$file' for module $module: ".dl_error());
192
193315µs push(@dl_librefs,$libref); # record loaded object
194
1953109µs334µs my @unresolved = dl_undef_symbols();
# spent 34µs making 3 calls to DynaLoader::dl_undef_symbols, avg 11µs/call
19636µs if (@unresolved) {
197 require Carp;
198 Carp::carp("Undefined symbols present after loading $file: @unresolved\n");
199 }
200
2013101µs342µs $boot_symbol_ref = dl_find_symbol($libref, $bootname) or
# spent 42µs making 3 calls to DynaLoader::dl_find_symbol, avg 14µs/call
202 croak("Can't find '$bootname' symbol in $file\n");
203
204315µs push(@dl_modules, $module); # record loaded module
205
2063222µs3142µs boot:
# spent 142µs making 3 calls to DynaLoader::dl_install_xsub, avg 47µs/call
207 my $xs = dl_install_xsub("${module}::bootstrap", $boot_symbol_ref, $file);
208
209 # See comment block above
210
211312µs push(@dl_shared_objects, $file); # record files loaded
212
21337.82ms37.57ms &$xs(@args);
# spent 4.06ms making 1 call to XML::LibXML::bootstrap # spent 3.10ms making 1 call to Graphics::Magick::bootstrap # spent 417µs making 1 call to List::MoreUtils::bootstrap
214}
215
216sub dl_findfile {
217 # Read ext/DynaLoader/DynaLoader.doc for detailed information.
218 # This function does not automatically consider the architecture
219 # or the perl library auto directories.
220 my (@args) = @_;
221 my (@dirs, $dir); # which directories to search
222 my (@found); # full paths to real files we have found
223 #my $dl_ext= 'so'; # $Config::Config{'dlext'} suffix for perl extensions
224 #my $dl_so = 'so'; # $Config::Config{'so'} suffix for shared libraries
225
226 print STDERR "dl_findfile(@args)\n" if $dl_debug;
227
228 # accumulate directories but process files as they appear
229 arg: foreach(@args) {
230 # Special fast case: full filepath requires no search
231
232
233 if (m:/: && -f $_) {
234 push(@found,$_);
235 last arg unless wantarray;
236 next;
237 }
238
239
240 # Deal with directories first:
241 # Using a -L prefix is the preferred option (faster and more robust)
242 if (m:^-L:) { s/^-L//; push(@dirs, $_); next; }
243
244 # Otherwise we try to try to spot directories by a heuristic
245 # (this is a more complicated issue than it first appears)
246 if (m:/: && -d $_) { push(@dirs, $_); next; }
247
248
249
250 # Only files should get this far...
251 my(@names, $name); # what filenames to look for
252 if (m:-l: ) { # convert -lname to appropriate library name
253 s/-l//;
254 push(@names,"lib$_.$dl_so");
255 push(@names,"lib$_.a");
256 } else { # Umm, a bare name. Try various alternatives:
257 # these should be ordered with the most likely first
258 push(@names,"$_.$dl_dlext") unless m/\.$dl_dlext$/o;
259 push(@names,"$_.$dl_so") unless m/\.$dl_so$/o;
260
261 push(@names,"lib$_.$dl_so") unless m:/:;
262 push(@names,"$_.a") if !m/\.a$/ and $dlsrc eq "dl_dld.xs";
263 push(@names, $_);
264 }
265 my $dirsep = '/';
266
267 foreach $dir (@dirs, @dl_library_path) {
268 next unless -d $dir;
269
270 foreach $name (@names) {
271 my($file) = "$dir$dirsep$name";
272 print STDERR " checking in $dir for $name\n" if $dl_debug;
273 $file = ($do_expand) ? dl_expandspec($file) : (-f $file && $file);
274 #$file = _check_file($file);
275 if ($file) {
276 push(@found, $file);
277 next arg; # no need to look any further
278 }
279 }
280 }
281 }
282 if ($dl_debug) {
283 foreach(@dirs) {
284 print STDERR " dl_findfile ignored non-existent directory: $_\n" unless -d $_;
285 }
286 print STDERR "dl_findfile found: @found\n";
287 }
288 return $found[0] unless wantarray;
289 @found;
290}
291
- -
294sub dl_expandspec {
295 my($spec) = @_;
296 # Optional function invoked if DynaLoader.pm sets $do_expand.
297 # Most systems do not require or use this function.
298 # Some systems may implement it in the dl_*.xs file in which case
299 # this Perl version should be excluded at build time.
300
301 # This function is designed to deal with systems which treat some
302 # 'filenames' in a special way. For example VMS 'Logical Names'
303 # (something like unix environment variables - but different).
304 # This function should recognise such names and expand them into
305 # full file paths.
306 # Must return undef if $spec is invalid or file does not exist.
307
308 my $file = $spec; # default output to input
309
310 return undef unless -f $file;
311 print STDERR "dl_expandspec($spec) => $file\n" if $dl_debug;
312 $file;
313}
314
315sub dl_find_symbol_anywhere
316{
317 my $sym = shift;
318 my $libref;
319 foreach $libref (@dl_librefs) {
320 my $symref = dl_find_symbol($libref,$sym);
321 return $symref if $symref;
322 }
323 return undef;
324}
325
326__END__
 
# spent 338µs within DynaLoader::CORE:ftdir which was called 15 times, avg 23µs/call: # 15 times (338µs+0s) by DynaLoader::bootstrap at line 148, avg 23µs/call
sub DynaLoader::CORE:ftdir; # opcode
# spent 33µs within DynaLoader::CORE:ftfile which was called 3 times, avg 11µs/call: # 3 times (33µs+0s) by DynaLoader::bootstrap at line 152, avg 11µs/call
sub DynaLoader::CORE:ftfile; # opcode
# spent 72µs within DynaLoader::CORE:ftsize which was called 3 times, avg 24µs/call: # 3 times (72µs+0s) by DynaLoader::bootstrap at line 173, avg 24µs/call
sub DynaLoader::CORE:ftsize; # opcode
# spent 430µs within DynaLoader::CORE:subst which was called 6 times, avg 72µs/call: # 3 times (376µs+0s) by DynaLoader::bootstrap at line 172, avg 125µs/call # 3 times (53µs+0s) by DynaLoader::bootstrap at line 165, avg 18µs/call
sub DynaLoader::CORE:subst; # opcode
# spent 42µs within DynaLoader::dl_find_symbol which was called 3 times, avg 14µs/call: # 3 times (42µs+0s) by DynaLoader::bootstrap at line 201, avg 14µs/call
sub DynaLoader::dl_find_symbol; # xsub
# spent 142µs within DynaLoader::dl_install_xsub which was called 3 times, avg 47µs/call: # 3 times (142µs+0s) by DynaLoader::bootstrap at line 206, avg 47µs/call
sub DynaLoader::dl_install_xsub; # xsub
# spent 138ms within DynaLoader::dl_load_file which was called 3 times, avg 46.1ms/call: # 3 times (138ms+0s) by DynaLoader::bootstrap at line 190, avg 46.1ms/call
sub DynaLoader::dl_load_file; # xsub
# spent 34µs within DynaLoader::dl_undef_symbols which was called 3 times, avg 11µs/call: # 3 times (34µs+0s) by DynaLoader::bootstrap at line 195, avg 11µs/call
sub DynaLoader::dl_undef_symbols; # xsub