← Index
NYTProf Performance Profile   « block view • line view • sub view »
For /usr/local/src/github.com/foswiki/core/bin/view
  Run on Sun Dec 4 17:17:59 2011
Reported on Sun Dec 4 17:27:26 2011

Filename/usr/share/perl/5.14/XSLoader.pm
StatementsExecuted 0 statements in 0s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1010103.25ms3.25msXSLoader::::loadXSLoader::load
0000s0sXSLoader::::bootstrap_inheritXSLoader::bootstrap_inherit
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1# Generated from XSLoader.pm.PL (resolved %Config::Config value)
2
3package XSLoader;
4
5$VERSION = "0.13";
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
12package DynaLoader;
13
14# No prizes for guessing why we don't say 'bootstrap DynaLoader;' here.
15# NOTE: All dl_*.xs (including dl_none.xs) define a dl_error() XSUB
16boot_DynaLoader('DynaLoader') if defined(&boot_DynaLoader) &&
17 !defined(&dl_error);
18package XSLoader;
19
20
# spent 3.25ms within XSLoader::load which was called 10 times, avg 325µs/call: # once (908µs+0s) by B::BEGIN@17 at line 27 of B.pm # once (419µs+0s) by Safe::BEGIN@46 at line 31 of Opcode.pm # once (287µs+0s) by IO::Handle::BEGIN@9 at line 11 of IO.pm # once (277µs+0s) by Error::BEGIN@46 at line 27 of List/Util.pm # once (274µs+0s) by IO::Seekable::BEGIN@12 at line 11 of Fcntl.pm # once (236µs+0s) by CGI::Session::Serialize::default::BEGIN@7 at line 36 of Data/Dumper.pm # once (231µs+0s) by File::Basename::BEGIN@42 at line 85 of re.pm # once (223µs+0s) by Foswiki::Users::HtPasswdUser::BEGIN@2 at line 14 of MIME/Base64.pm # once (218µs+0s) by Foswiki::BEGIN@50 at line 24 of Digest/MD5.pm # once (178µs+0s) by Foswiki::BEGIN@28 at line 248 of Cwd.pm
sub load {
21 package DynaLoader;
22
23 my ($module, $modlibname) = caller();
24
25 if (@_) {
26 $module = $_[0];
27 } else {
28 $_[0] = $module;
29 }
30
31 # work with static linking too
32 my $boots = "$module\::bootstrap";
33 goto &$boots if defined &$boots;
34
35 goto \&XSLoader::bootstrap_inherit unless $module and defined &dl_load_file;
36
37 my @modparts = split(/::/,$module);
38 my $modfname = $modparts[-1];
39
40 my $modpname = join('/',@modparts);
41 my $c = @modparts;
42 $modlibname =~ s,[\\/][^\\/]+$,, while $c--; # Q&D basename
43 my $file = "$modlibname/auto/$modpname/$modfname.so";
44
45# print STDERR "XSLoader::load for $module ($file)\n" if $dl_debug;
46
47 my $bs = $file;
48 $bs =~ s/(\.\w+)?(;\d*)?$/\.bs/; # look for .bs 'beside' the library
49
50 if (-s $bs) { # only read file if it's not empty
51# print STDERR "BS: $bs ($^O, $dlsrc)\n" if $dl_debug;
52 eval { do $bs; };
53 warn "$bs: $@\n" if $@;
54 }
55
56 goto \&XSLoader::bootstrap_inherit if not -f $file or -s $bs;
57
58 my $bootname = "boot_$module";
59 $bootname =~ s/\W/_/g;
60 @DynaLoader::dl_require_symbols = ($bootname);
61
62 my $boot_symbol_ref;
63
64 # Many dynamic extension loading problems will appear to come from
65 # this section of code: XYZ failed at line 123 of DynaLoader.pm.
66 # Often these errors are actually occurring in the initialisation
67 # C code of the extension XS file. Perl reports the error as being
68 # in this perl code simply because this was the last perl code
69 # it executed.
70
71 my $libref = dl_load_file($file, 0) or do {
72 require Carp;
73 Carp::croak("Can't load '$file' for module $module: " . dl_error());
74 };
75 push(@DynaLoader::dl_librefs,$libref); # record loaded object
76
77 my @unresolved = dl_undef_symbols();
78 if (@unresolved) {
79 require Carp;
80 Carp::carp("Undefined symbols present after loading $file: @unresolved\n");
81 }
82
83 $boot_symbol_ref = dl_find_symbol($libref, $bootname) or do {
84 require Carp;
85 Carp::croak("Can't find '$bootname' symbol in $file\n");
86 };
87
88 push(@DynaLoader::dl_modules, $module); # record loaded module
89
90 boot:
91 my $xs = dl_install_xsub($boots, $boot_symbol_ref, $file);
92
93 # See comment block above
94 push(@DynaLoader::dl_shared_objects, $file); # record files loaded
95 return &$xs(@_);
96}
97
98sub bootstrap_inherit {
99 require DynaLoader;
100 goto \&DynaLoader::bootstrap_inherit;
101}
102
1031;
104
105__END__
106