← 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:42 2009

File/usr/lib/perl/5.8/XSLoader.pm
Statements Executed0
Total Time0 seconds

Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1110.006440.00644XSLoader::load
00000XSLoader::bootstrap_inherit

LineStmts.Exclusive
Time
Avg.Code
1# Generated from XSLoader.pm.PL (resolved %Config::Config value)
2
3package XSLoader;
4
5$VERSION = "0.06";
6
7#use strict;
8
9# enable debug/trace messages from DynaLoader perl code
10# $dl_debug = $ENV{PERL_DL_DEBUG} || 0 unless defined $dl_debug;
11
12 my $dl_dlext = 'so';
13
14package DynaLoader;
15
16# No prizes for guessing why we don't say 'bootstrap DynaLoader;' here.
17# NOTE: All dl_*.xs (including dl_none.xs) define a dl_error() XSUB
18boot_DynaLoader('DynaLoader') if defined(&boot_DynaLoader) &&
19 !defined(&dl_error);
20package XSLoader;
21
22
# spent 6.44ms within XSLoader::load which was called # once (6.44ms+0) at line 227 of /usr/lib/perl/5.8/Socket.pm
sub load {
23 package DynaLoader;
24
25 die q{XSLoader::load('Your::Module', $Your::Module::VERSION)} unless @_;
26
27 my($module) = $_[0];
28
29 # work with static linking too
30 my $b = "$module\::bootstrap";
31 goto &$b if defined &$b;
32
33 goto retry unless $module and defined &dl_load_file;
34
35 my @modparts = split(/::/,$module);
36 my $modfname = $modparts[-1];
37
38 my $modpname = join('/',@modparts);
39 my $modlibname = (caller())[1];
40 my $c = @modparts;
41 $modlibname =~ s,[\\/][^\\/]+$,, while $c--; # Q&D basename
42 my $file = "$modlibname/auto/$modpname/$modfname.$dl_dlext";
43
44# print STDERR "XSLoader::load for $module ($file)\n" if $dl_debug;
45
46 my $bs = $file;
47 $bs =~ s/(\.\w+)?(;\d*)?$/\.bs/; # look for .bs 'beside' the library
48
49 goto retry if not -f $file or -s $bs;
50
51 my $bootname = "boot_$module";
52 $bootname =~ s/\W/_/g;
53 @DynaLoader::dl_require_symbols = ($bootname);
54
55 my $boot_symbol_ref;
56
57 if ($^O eq 'darwin') {
58 if ($boot_symbol_ref = dl_find_symbol(0, $bootname)) {
59 goto boot; #extension library has already been loaded, e.g. darwin
60 }
61 }
62
63 # Many dynamic extension loading problems will appear to come from
64 # this section of code: XYZ failed at line 123 of DynaLoader.pm.
65 # Often these errors are actually occurring in the initialisation
66 # C code of the extension XS file. Perl reports the error as being
67 # in this perl code simply because this was the last perl code
68 # it executed.
69
70 my $libref = dl_load_file($file, 0) or do {
71 require Carp;
72 Carp::croak("Can't load '$file' for module $module: " . dl_error());
73 };
74 push(@DynaLoader::dl_librefs,$libref); # record loaded object
75
76 my @unresolved = dl_undef_symbols();
77 if (@unresolved) {
78 require Carp;
79 Carp::carp("Undefined symbols present after loading $file: @unresolved\n");
80 }
81
82 $boot_symbol_ref = dl_find_symbol($libref, $bootname) or do {
83 require Carp;
84 Carp::croak("Can't find '$bootname' symbol in $file\n");
85 };
86
87 push(@DynaLoader::dl_modules, $module); # record loaded module
88
89 boot:
90 my $xs = dl_install_xsub("${module}::bootstrap", $boot_symbol_ref, $file);
91
92 # See comment block above
93 return &$xs(@_);
94
95 retry:
96 my $bootstrap_inherit = DynaLoader->can('bootstrap_inherit') ||
97 XSLoader->can('bootstrap_inherit');
98 goto &$bootstrap_inherit;
99}
100
101# Versions of DynaLoader prior to 5.6.0 don't have this function.
102sub bootstrap_inherit {
103 package DynaLoader;
104
105 my $module = $_[0];
106 local *DynaLoader::isa = *{"$module\::ISA"};
107 local @DynaLoader::isa = (@DynaLoader::isa, 'DynaLoader');
108 # Cannot goto due to delocalization. Will report errors on a wrong line?
109 require DynaLoader;
110 DynaLoader::bootstrap(@_);
111}
112
1131;
114
115__END__
116