← Index
NYTProf Performance Profile   « block view • line view • sub view »
For C:/lo/libo-master/solenv/bin/make_installer.pl
  Run on Mon Sep 24 00:52:54 2012
Reported on Mon Sep 24 07:34:45 2012

Filename/usr/lib/perl5/5.14/i686-cygwin-threads-64int/DynaLoader.pm
StatementsExecuted 953 statements in 58.1ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1952140.3ms40.3msDynaLoader::::CORE:ftfileDynaLoader::CORE:ftfile (opcode)
51217.99ms7.99msDynaLoader::::CORE:ftdirDynaLoader::CORE:ftdir (opcode)
1117.19ms8.16msDynaLoader::::croakDynaLoader::croak
1112.62ms49.2msDynaLoader::::dl_findfileDynaLoader::dl_findfile
111199µs199µsDynaLoader::::BEGIN@18DynaLoader::BEGIN@18
111193µs59.4msDynaLoader::::bootstrapDynaLoader::bootstrap
33152µs52µsDynaLoader::::CORE:regcompDynaLoader::CORE:regcomp (opcode)
319150µs50µsDynaLoader::::CORE:matchDynaLoader::CORE:match (opcode)
11122µs56µsDynaLoader::::BEGIN@22DynaLoader::BEGIN@22
111119µs19µsDynaLoader::::CORE:substDynaLoader::CORE:subst (opcode)
0000s0sDynaLoader::::bootstrap_inheritDynaLoader::bootstrap_inherit
0000s0sDynaLoader::::dl_expandspecDynaLoader::dl_expandspec
0000s0sDynaLoader::::dl_find_symbol_anywhereDynaLoader::dl_find_symbol_anywhere
0000s0sDynaLoader::::dl_load_flagsDynaLoader::dl_load_flags
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 199µs within DynaLoader::BEGIN@18 which was called: # once (199µs+0s) by installer::BEGIN@32 at line 20
BEGIN {
19120µs $VERSION = '1.13';
20162µs1199µs}
# spent 199µs making 1 call to DynaLoader::BEGIN@18
21
2223.31ms290µs
# spent 56µs (22+34) within DynaLoader::BEGIN@22 which was called: # once (22µs+34µs) by installer::BEGIN@32 at line 22
use Config;
# spent 56µs making 1 call to DynaLoader::BEGIN@22 # spent 34µs making 1 call to Config::import
23
24# enable debug/trace messages from DynaLoader perl code
2515µ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
38sub dl_load_flags { 0x00 }
39
40140µs324µs($dl_dlext, $dl_so, $dlsrc) = @Config::Config{qw(dlext so dlsrc)};
# spent 24µs making 3 calls to Config::FETCH, avg 8µs/call
41
42
431500ns$do_expand = 0;
44
4512µs@dl_require_symbols = (); # names of symbols we need
461500ns@dl_resolve_using = (); # names of files to link with
471600ns@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
60114µs15µspush(@dl_library_path, split(' ', $Config::Config{libpth}));
# spent 5µs making 1 call to Config::FETCH
61
62
6318µs15µsmy $ldlibpthname = $Config::Config{ldlibpthname};
# spent 5µs making 1 call to Config::FETCH
6418µs14µsmy $ldlibpthname_defined = defined $Config::Config{ldlibpthname};
# spent 4µs making 1 call to Config::FETCH
6517µs14µsmy $pthsep = $Config::Config{path_sep};
# spent 4µ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
7013µsif ($ldlibpthname_defined &&
71 exists $ENV{$ldlibpthname}) {
72151µs116µs push(@dl_library_path, split(/$pthsep/, $ENV{$ldlibpthname}));
# spent 16µs making 1 call to DynaLoader::CORE:regcomp
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
8613µ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
951107µs1; # End of main code
96
97
9823.18ms1495µs
# spent 8.16ms (7.19+971µs) within DynaLoader::croak which was called: # once (7.19ms+971µs) by DynaLoader::bootstrap at line 160
sub croak { require Carp; Carp::croak(@_) }
# spent 495µs making 1 call to Carp::croak
99
100sub bootstrap_inherit {
10112µs my $module = $_[0];
102127µs local *isa = *{"$module\::ISA"};
103142µs local @isa = (@isa, 'DynaLoader');
104 # Cannot goto due to delocalization. Will report errors on a wrong line?
10516µs159.4ms bootstrap(@_);
# spent 59.4ms making 1 call to DynaLoader::bootstrap
106}
107
108
# spent 59.4ms (193µs+59.2) within DynaLoader::bootstrap which was called: # once (193µs+59.2ms) by installer::BEGIN@32 at line 105
sub bootstrap {
109 # use local vars to enable $module.bs script to edit values
11013µs local(@args) = @_;
11111µs local($module) = $args[0];
11211µs local(@dirs, $file);
113
1141500ns 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.
12112µ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
- -
12815µs my @modparts = split(/::/,$module);
12912µ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.
1341600ns $modfname = &mod2fname(\@modparts) if defined &mod2fname;
135
136
137
13814µs my $modpname = join('/',@modparts);
139
1401500ns print STDERR "DynaLoader::bootstrap for $module ",
141 "(auto/$modpname/$modfname.$dl_dlext)\n"
142 if $dl_debug;
143
144115µs foreach (@INC) {
145
1461118µs my $dir = "$_/auto/$modpname";
147
148111.93ms111.85ms next unless -d $dir; # skip over uninteresting directories
# spent 1.85ms making 11 calls to DynaLoader::CORE:ftdir, avg 168µs/call
149
150 # check for common cases to avoid autoload of dl_findfile
151 my $try = "$dir/$modfname.$dl_dlext";
152 last if $file = ($do_expand) ? dl_expandspec($try) : ((-f $try) && $try);
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
158132µs149.2ms $file = dl_findfile(map("-L$_",@dirs,@INC), $modfname) unless $file;
# spent 49.2ms making 1 call to DynaLoader::dl_findfile
159
160118µs18.16ms croak("Can't locate loadable object for module $module in \@INC (\@INC contains: @INC)")
# spent 8.16ms making 1 call to DynaLoader::croak
161 unless $file; # wording similar to error from 'require'
162
163
164 my $bootname = "boot_$module";
165 $bootname =~ s/\W/_/g;
166 @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.
171 my $bs = $file;
172 $bs =~ s/(\.\w+)?(;\d*)?$/\.bs/; # look for .bs 'beside' the library
173 if (-s $bs) { # only read file if it's not empty
174 print STDERR "BS: $bs ($^O, $dlsrc)\n" if $dl_debug;
175 eval { do $bs; };
176 warn "$bs: $@\n" if $@;
177 }
178
179 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
190 my $libref = dl_load_file($file, $module->dl_load_flags) or
191 croak("Can't load '$file' for module $module: ".dl_error());
192
193 push(@dl_librefs,$libref); # record loaded object
194
195 my @unresolved = dl_undef_symbols();
196 if (@unresolved) {
197 require Carp;
198 Carp::carp("Undefined symbols present after loading $file: @unresolved\n");
199 }
200
201 $boot_symbol_ref = dl_find_symbol($libref, $bootname) or
202 croak("Can't find '$bootname' symbol in $file\n");
203
204 push(@dl_modules, $module); # record loaded module
205
206 boot:
207 my $xs = dl_install_xsub("${module}::bootstrap", $boot_symbol_ref, $file);
208
209 # See comment block above
210
211 push(@dl_shared_objects, $file); # record files loaded
212
213 &$xs(@args);
214}
215
216
# spent 49.2ms (2.62+46.5) within DynaLoader::dl_findfile which was called: # once (2.62ms+46.5ms) by DynaLoader::bootstrap at line 158
sub 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.
22019µs my (@args) = @_;
22111µs my (@dirs, $dir); # which directories to search
2221500ns my (@found); # full paths to real files we have found
223 #my $dl_ext= 'dll'; # $Config::Config{'dlext'} suffix for perl extensions
224 #my $dl_so = 'dll'; # $Config::Config{'so'} suffix for shared libraries
225
2261500ns print STDERR "dl_findfile(@args)\n" if $dl_debug;
227
228 # accumulate directories but process files as they appear
22919µs arg: foreach(@args) {
230 # Special fast case: full filepath requires no search
231
232
233122.47ms222.38ms if (m:/: && -f $_) {
# spent 2.36ms making 10 calls to DynaLoader::CORE:ftfile, avg 236µs/call # spent 16µs making 12 calls to DynaLoader::CORE:match, avg 1µs/call
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)
24245151µs2347µs if (m:^-L:) { s/^-L//; push(@dirs, $_); next; }
# spent 28µs making 12 calls to DynaLoader::CORE:match, avg 2µs/call # spent 19µs making 11 calls to DynaLoader::CORE:subst, avg 2µs/call
243
244 # Otherwise we try to try to spot directories by a heuristic
245 # (this is a more complicated issue than it first appears)
24616µs1600ns if (m:/: && -d $_) { push(@dirs, $_); next; }
# spent 600ns making 1 call to DynaLoader::CORE:match
247
248
249
250 # Only files should get this far...
25111µs my(@names, $name); # what filenames to look for
25216µs11µs if (m:-l: ) { # convert -lname to appropriate library name
# spent 1µs making 1 call to DynaLoader::CORE:match
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
258138µs227µs push(@names,"$_.$dl_dlext") unless m/\.$dl_dlext$/o;
# spent 26µs making 1 call to DynaLoader::CORE:regcomp # spent 500ns making 1 call to DynaLoader::CORE:match
259118µs210µs push(@names,"$_.$dl_so") unless m/\.$dl_so$/o;
# spent 9µs making 1 call to DynaLoader::CORE:regcomp # spent 500ns making 1 call to DynaLoader::CORE:match
260
26118µs11µs push(@names,"cyg$_.$dl_so") unless m:/:;
# spent 1µs making 1 call to DynaLoader::CORE:match
262
26317µs11µs push(@names,"lib$_.$dl_so") unless m:/:;
# spent 1µs making 1 call to DynaLoader::CORE:match
26416µs11µs push(@names,"$_.a") if !m/\.a$/ and $dlsrc eq "dl_dld.xs";
# spent 1µs making 1 call to DynaLoader::CORE:match
26513µs push(@names, $_);
266 }
26711µs my $dirsep = '/';
268
269111µs foreach $dir (@dirs, @dl_library_path) {
270406.39ms406.14ms next unless -d $dir;
# spent 6.14ms making 40 calls to DynaLoader::CORE:ftdir, avg 154µs/call
271
27237207µs foreach $name (@names) {
273185306µs my($file) = "$dir$dirsep$name";
27418576µs print STDERR " checking in $dir for $name\n" if $dl_debug;
27518539.0ms18537.9ms $file = ($do_expand) ? dl_expandspec($file) : (-f $file && $file);
# spent 37.9ms making 185 calls to DynaLoader::CORE:ftfile, avg 205µs/call
276 #$file = _check_file($file);
277185449µs if ($file) {
278 push(@found, $file);
279 next arg; # no need to look any further
280 }
281 }
282 }
283 }
2841500ns if ($dl_debug) {
285 foreach(@dirs) {
286 print STDERR " dl_findfile ignored non-existent directory: $_\n" unless -d $_;
287 }
288 print STDERR "dl_findfile found: @found\n";
289 }
290129µs return $found[0] unless wantarray;
291 @found;
292}
293
- -
296sub dl_expandspec {
297 my($spec) = @_;
298 # Optional function invoked if DynaLoader.pm sets $do_expand.
299 # Most systems do not require or use this function.
300 # Some systems may implement it in the dl_*.xs file in which case
301 # this Perl version should be excluded at build time.
302
303 # This function is designed to deal with systems which treat some
304 # 'filenames' in a special way. For example VMS 'Logical Names'
305 # (something like unix environment variables - but different).
306 # This function should recognise such names and expand them into
307 # full file paths.
308 # Must return undef if $spec is invalid or file does not exist.
309
310 my $file = $spec; # default output to input
311
312 return undef unless -f $file;
313 print STDERR "dl_expandspec($spec) => $file\n" if $dl_debug;
314 $file;
315}
316
317sub dl_find_symbol_anywhere
318{
319 my $sym = shift;
320 my $libref;
321 foreach $libref (@dl_librefs) {
322 my $symref = dl_find_symbol($libref,$sym);
323 return $symref if $symref;
324 }
325 return undef;
326}
327
328__END__
 
# spent 7.99ms within DynaLoader::CORE:ftdir which was called 51 times, avg 157µs/call: # 40 times (6.14ms+0s) by DynaLoader::dl_findfile at line 270, avg 154µs/call # 11 times (1.85ms+0s) by DynaLoader::bootstrap at line 148, avg 168µs/call
sub DynaLoader::CORE:ftdir; # opcode
# spent 40.3ms within DynaLoader::CORE:ftfile which was called 195 times, avg 207µs/call: # 185 times (37.9ms+0s) by DynaLoader::dl_findfile at line 275, avg 205µs/call # 10 times (2.36ms+0s) by DynaLoader::dl_findfile at line 233, avg 236µs/call
sub DynaLoader::CORE:ftfile; # opcode
# spent 50µs within DynaLoader::CORE:match which was called 31 times, avg 2µs/call: # 12 times (28µs+0s) by DynaLoader::dl_findfile at line 242, avg 2µs/call # 12 times (16µs+0s) by DynaLoader::dl_findfile at line 233, avg 1µs/call # once (1µs+0s) by DynaLoader::dl_findfile at line 263 # once (1µs+0s) by DynaLoader::dl_findfile at line 264 # once (1µs+0s) by DynaLoader::dl_findfile at line 252 # once (1µs+0s) by DynaLoader::dl_findfile at line 261 # once (600ns+0s) by DynaLoader::dl_findfile at line 246 # once (500ns+0s) by DynaLoader::dl_findfile at line 259 # once (500ns+0s) by DynaLoader::dl_findfile at line 258
sub DynaLoader::CORE:match; # opcode
# spent 52µs within DynaLoader::CORE:regcomp which was called 3 times, avg 17µs/call: # once (26µs+0s) by DynaLoader::dl_findfile at line 258 # once (16µs+0s) by installer::BEGIN@32 at line 72 # once (9µs+0s) by DynaLoader::dl_findfile at line 259
sub DynaLoader::CORE:regcomp; # opcode
# spent 19µs within DynaLoader::CORE:subst which was called 11 times, avg 2µs/call: # 11 times (19µs+0s) by DynaLoader::dl_findfile at line 242, avg 2µs/call
sub DynaLoader::CORE:subst; # opcode