← Index
Performance Profile   « block view • line view • sub view »
For opac/opac-main.pl
  Run on Mon Aug 24 11:28:47 2009
Reported on Mon Aug 24 11:29:14 2009

File /usr/lib/perl/5.10/DynaLoader.pm
Statements Executed 595
Total Time 0.0090002 seconds
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
14123.18ms3.18msDynaLoader::::dl_load_fileDynaLoader::dl_load_file(xsub)
1414141.60ms7.73msDynaLoader::::bootstrapDynaLoader::bootstrap
1412160µs160µsDynaLoader::::dl_install_xsubDynaLoader::dl_install_xsub(xsub)
141285µs85µsDynaLoader::::dl_find_symbolDynaLoader::dl_find_symbol(xsub)
141185µs85µsDynaLoader::::dl_load_flagsDynaLoader::dl_load_flags
141256µs56µsDynaLoader::::dl_undef_symbolsDynaLoader::dl_undef_symbols(xsub)
0000s0sDynaLoader::::BEGINDynaLoader::BEGIN
0000s0sDynaLoader::::bootstrap_inheritDynaLoader::bootstrap_inherit
0000s0sDynaLoader::::croakDynaLoader::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
17BEGIN {
1811µs1µs $VERSION = '1.08';
19142µs42µs}
20
21195µs95µsrequire AutoLoader;
2212µs2µs*AUTOLOAD = \&AutoLoader::AUTOLOAD;
23
2431.15ms382µsuse Config;
# spent 20µs making 1 call to Config::import
25
26# enable debug/trace messages from DynaLoader perl code
2712µs2µs$dl_debug = $ENV{PERL_DL_DEBUG} || 0 unless defined $dl_debug;
28
29#
30# Flags to alter dl_load_file behaviour. Assigned bits:
31# 0x01 make symbols available for linking later dl_load_file's.
32# (only known to work on Solaris 2 using dlopen(RTLD_GLOBAL))
33# (ignored under VMS; effect is built-in to image linking)
34#
35# This is called as a class method $module->dl_load_flags. The
36# definition here will be inherited and result on "default" loading
37# behaviour unless a sub-class of DynaLoader defines its own version.
38#
39
401422µs2µs
# spent 85µs within DynaLoader::dl_load_flags which was called 14 times, avg 6µs/call: # 14 times (85µs+0s) by DynaLoader::bootstrap at line 196, avg 6µs/call
sub dl_load_flags { 0x00 }
41
42# ($dl_dlext, $dlsrc)
43# = @Config::Config{'dlext', 'dlsrc'};
4412µs2µs ($dl_dlext, $dlsrc) = ('so', 'dl_dlopen.xs')
45;
46
471300ns300ns$do_expand = 0;
48
4911µs1µs@dl_require_symbols = (); # names of symbols we need
501500ns500ns@dl_resolve_using = (); # names of files to link with
511400ns400ns@dl_library_path = (); # path to look for files
52
53#XSLoader.pm may have added elements before we were required
54#@dl_shared_objects = (); # shared objects for symbols we have
55#@dl_librefs = (); # things we have loaded
56#@dl_modules = (); # Modules we have loaded
57
58# This is a fix to support DLD's unfortunate desire to relink -lc
591600ns600ns@dl_resolve_using = dl_findfile('-lc') if $dlsrc eq "dl_dld.xs";
60
61# Initialise @dl_library_path with the 'standard' library path
62# for this platform as determined by Configure.
63
64123µs23µspush(@dl_library_path, split(' ', $Config::Config{libpth}));
# spent 10µs making 1 call to Config::FETCH
65
6618µs8µsmy $ldlibpthname = $Config::Config{ldlibpthname};
# spent 7µs making 1 call to Config::FETCH
6718µs8µsmy $ldlibpthname_defined = defined $Config::Config{ldlibpthname};
# spent 6µs making 1 call to Config::FETCH
6817µs7µsmy $pthsep = $Config::Config{path_sep};
# spent 6µs making 1 call to Config::FETCH
69
70# Add to @dl_library_path any extra directories we can gather from environment
71# during runtime.
72
731800ns800nsif ($ldlibpthname_defined &&
74 exists $ENV{$ldlibpthname}) {
75 push(@dl_library_path, split(/$pthsep/, $ENV{$ldlibpthname}));
76}
77
78# E.g. HP-UX supports both its native SHLIB_PATH *and* LD_LIBRARY_PATH.
79
801600ns600nsif ($ldlibpthname_defined &&
81 $ldlibpthname ne 'LD_LIBRARY_PATH' &&
82 exists $ENV{LD_LIBRARY_PATH}) {
83 push(@dl_library_path, split(/$pthsep/, $ENV{LD_LIBRARY_PATH}));
84}
85
86# No prizes for guessing why we don't say 'bootstrap DynaLoader;' here.
87# NOTE: All dl_*.xs (including dl_none.xs) define a dl_error() XSUB
8811µs1µsboot_DynaLoader('DynaLoader') if defined(&boot_DynaLoader) &&
89 !defined(&dl_error);
90
911400ns400nsif ($dl_debug) {
92 print STDERR "DynaLoader.pm loaded (@INC, @dl_library_path)\n";
93 print STDERR "DynaLoader not linked into this perl\n"
94 unless defined(&boot_DynaLoader);
95}
96
97127µs27µs1; # End of main code
98
99sub croak { require Carp; Carp::croak(@_) }
100
101sub bootstrap_inherit {
102 my $module = $_[0];
103 local *isa = *{"$module\::ISA"};
104 local @isa = (@isa, 'DynaLoader');
105 # Cannot goto due to delocalization. Will report errors on a wrong line?
106 bootstrap(@_);
107}
108
109# The bootstrap function cannot be autoloaded (without complications)
110# so we define it here:
111
112
# spent 7.73ms (1.60+6.13) within DynaLoader::bootstrap which was called 14 times, avg 552µs/call: # once (102µs+1.37ms) by XML::LibXML::BEGIN at line 124 of /usr/local/lib/perl/5.10.0/XML/LibXML.pm # once (128µs+972µs) at line 14 of /usr/lib/perl5/DBD/mysql.pm # once (140µs+819µs) at line 42 of /usr/lib/perl/5.10/Unicode/Normalize.pm # once (96µs+484µs) at line 256 of /usr/lib/perl5/DBI.pm # once (109µs+391µs) at line 24 of /usr/lib/perl5/XML/LibXSLT.pm # once (109µs+339µs) at line 104 of /usr/lib/perl5/Date/Calc.pm # once (133µs+293µs) at line 14 of /usr/lib/perl5/HTML/Template/Pro.pm # once (116µs+281µs) at line 24 of /usr/lib/perl5/List/MoreUtils.pm # once (116µs+228µs) at line 67 of /usr/lib/perl/5.10/Storable.pm # once (117µs+220µs) at line 19 of /usr/lib/perl5/XML/LibXML/Common.pm # once (106µs+221µs) at line 21 of /usr/lib/perl5/Text/Iconv.pm # once (111µs+214µs) at line 65 of /usr/lib/perl/5.10/Time/HiRes.pm # once (127µs+190µs) at line 34 of /usr/lib/perl/5.10/Hash/Util.pm # once (85µs+104µs) at line 17 of /usr/lib/perl5/String/CRC32.pm
sub bootstrap {
113 # use local vars to enable $module.bs script to edit values
1141440µs3µs local(@args) = @_;
1151416µs1µs local($module) = $args[0];
1161412µs836ns local(@dirs, $file);
117
118144µs314ns unless ($module) {
119 require Carp;
120 Carp::confess("Usage: DynaLoader::bootstrap(module)");
121 }
122
123 # A common error on platforms which don't support dynamic loading.
124 # Since it's fatal and potentially confusing we give a detailed message.
1251419µs1µs croak("Can't load module $module, dynamic loading not available in this perl.\n".
126 " (You may need to build a new perl executable which either supports\n".
127 " dynamic loading or has the $module module statically linked into it.)\n")
128 unless defined(&dl_load_file);
129
130
1311456µs4µs my @modparts = split(/::/,$module);
1321417µs1µs my $modfname = $modparts[-1];
133
134 # Some systems have restrictions on files names for DLL's etc.
135 # mod2fname returns appropriate file base name (typically truncated)
136 # It may also edit @modparts if required.
1371410µs679ns $modfname = &mod2fname(\@modparts) if defined &mod2fname;
138
139
140
1411422µs2µs my $modpname = join('/',@modparts);
142
143149µs614ns print STDERR "DynaLoader::bootstrap for $module ",
144 "(auto/$modpname/$modfname.so)\n"
145 if $dl_debug;
146
1471428µs2µs foreach (@INC) {
148
149
1506243µs692ns my $dir = "$_/auto/$modpname";
151
152
15362325µs5µs next unless -d $dir; # skip over uninteresting directories
154
155 # check for common cases to avoid autoload of dl_findfile
1561416µs1µs my $try = "$dir/$modfname.so";
1571475µs5µs last if $file = (-f $try) && $try;
158
159
160 # no luck here, save dir for possible later dl_findfile search
161 push @dirs, $dir;
162 }
163 # last resort, let dl_findfile have a go in all known locations
164145µs371ns $file = dl_findfile(map("-L$_",@dirs,@INC), $modfname) unless $file;
165
166145µs371ns croak("Can't locate loadable object for module $module in \@INC (\@INC contains: @INC)")
167 unless $file; # wording similar to error from 'require'
168
169
1701412µs864ns my $bootname = "boot_$module";
1711454µs4µs $bootname =~ s/\W/_/g;
1721422µs2µs @dl_require_symbols = ($bootname);
173
174 # Execute optional '.bootstrap' perl script for this module.
175 # The .bs file can be used to configure @dl_resolve_using etc to
176 # match the needs of the individual module on this architecture.
177147µs507ns my $bs = $file;
17814347µs25µs $bs =~ s/(\.\w+)?(;\d*)?$/\.bs/; # look for .bs 'beside' the library
1791466µs5µs if (-s $bs) { # only read file if it's not empty
180 print STDERR "BS: $bs ($^O, $dlsrc)\n" if $dl_debug;
181 eval { do $bs; };
182 warn "$bs: $@\n" if $@;
183 }
184
185145µs350ns my $boot_symbol_ref;
186
187
188
189 # Many dynamic extension loading problems will appear to come from
190 # this section of code: XYZ failed at line 123 of DynaLoader.pm.
191 # Often these errors are actually occurring in the initialisation
192 # C code of the extension XS file. Perl reports the error as being
193 # in this perl code simply because this was the last perl code
194 # it executed.
195
196143.35ms239µs my $libref = dl_load_file($file, $module->dl_load_flags) or
# spent 3.18ms making 14 calls to DynaLoader::dl_load_file, avg 227µs/call # spent 85µs making 14 calls to DynaLoader::dl_load_flags, avg 6µs/call
197 croak("Can't load '$file' for module $module: ".dl_error());
198
1991421µs1µs push(@dl_librefs,$libref); # record loaded object
200
2011476µs5µs my @unresolved = dl_undef_symbols();
# spent 56µs making 14 calls to DynaLoader::dl_undef_symbols, avg 4µs/call
202148µs536ns if (@unresolved) {
203 require Carp;
204 Carp::carp("Undefined symbols present after loading $file: @unresolved\n");
205 }
206
20714101µs7µs $boot_symbol_ref = dl_find_symbol($libref, $bootname) or
# spent 85µs making 14 calls to DynaLoader::dl_find_symbol, avg 6µs/call
208 croak("Can't find '$bootname' symbol in $file\n");
209
2101417µs1µs push(@dl_modules, $module); # record loaded module
211
21214189µs13µs boot:
# spent 160µs making 14 calls to DynaLoader::dl_install_xsub, avg 11µs/call
213 my $xs = dl_install_xsub("${module}::bootstrap", $boot_symbol_ref, $file);
214
215 # See comment block above
216
2171418µs1µs push(@dl_shared_objects, $file); # record files loaded
218
219142.62ms187µs &$xs(@args);
# spent 1.06ms making 1 call to XML::LibXML::bootstrap # spent 326µs making 1 call to DBI::bootstrap # spent 188µs making 1 call to XML::LibXSLT::bootstrap # spent 167µs making 1 call to Date::Calc::bootstrap # spent 156µs making 1 call to DBD::mysql::bootstrap # spent 112µs making 1 call to List::MoreUtils::bootstrap # spent 111µs making 1 call to Unicode::Normalize::bootstrap # spent 99µs making 1 call to Time::HiRes::bootstrap # spent 92µs making 1 call to Storable::bootstrap # spent 72µs making 1 call to XML::LibXML::Common::bootstrap # spent 70µs making 1 call to Text::Iconv::bootstrap # spent 53µs making 1 call to Hash::Util::bootstrap # spent 41µs making 1 call to HTML::Template::Pro::bootstrap # spent 21µs making 1 call to String::CRC32::bootstrap
220}
221
222#sub _check_file { # private utility to handle dl_expandspec vs -f tests
223# my($file) = @_;
224# return $file if (!$do_expand && -f $file); # the common case
225# return $file if ( $do_expand && ($file=dl_expandspec($file)));
226# return undef;
227#}
228
229# Let autosplit and the autoloader deal with these functions:
# spent 85µs within DynaLoader::dl_find_symbol which was called 14 times, avg 6µs/call: # 14 times (85µs+0s) by DynaLoader::bootstrap at line 207 of /usr/lib/perl/5.10/DynaLoader.pm, avg 6µs/call
sub DynaLoader::dl_find_symbol; # xsub
# spent 160µs within DynaLoader::dl_install_xsub which was called 14 times, avg 11µs/call: # 14 times (160µs+0s) by DynaLoader::bootstrap at line 212 of /usr/lib/perl/5.10/DynaLoader.pm, avg 11µs/call
sub DynaLoader::dl_install_xsub; # xsub
# spent 3.18ms within DynaLoader::dl_load_file which was called 14 times, avg 227µs/call: # 14 times (3.18ms+0s) by DynaLoader::bootstrap at line 196 of /usr/lib/perl/5.10/DynaLoader.pm, avg 227µs/call
sub DynaLoader::dl_load_file; # xsub
# spent 56µs within DynaLoader::dl_undef_symbols which was called 14 times, avg 4µs/call: # 14 times (56µs+0s) by DynaLoader::bootstrap at line 201 of /usr/lib/perl/5.10/DynaLoader.pm, avg 4µs/call
sub DynaLoader::dl_undef_symbols; # xsub