← 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:32 2012

Filename/usr/lib/perl5/5.14/File/stat.pm
StatementsExecuted 66 statements in 7.48ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1115.77ms6.72msFile::stat::::BEGIN@173File::stat::BEGIN@173
111342µs342µsFile::stat::::BEGIN@2File::stat::BEGIN@2
111167µs263µsFile::stat::::BEGIN@32File::stat::BEGIN@32
11132µs32µsFile::stat::::BEGIN@16File::stat::BEGIN@16
11124µs83µsFile::stat::::BEGIN@147File::stat::BEGIN@147
11120µs30µsFile::stat::::BEGIN@4File::stat::BEGIN@4
11120µs103µsFile::stat::::BEGIN@7File::stat::BEGIN@7
11117µs96µsFile::stat::::BEGIN@143File::stat::BEGIN@143
11117µs39µsFile::stat::::BEGIN@5File::stat::BEGIN@5
11116µs330µsFile::stat::::BEGIN@28File::stat::BEGIN@28
11116µs234µsFile::stat::::BEGIN@6File::stat::BEGIN@6
11116µs73µsFile::stat::::BEGIN@30File::stat::BEGIN@30
11113µs37µsFile::stat::::BEGIN@35File::stat::BEGIN@35
11113µs34µsFile::stat::::BEGIN@200File::stat::BEGIN@200
11111µs11µsFile::stat::::BEGIN@9File::stat::BEGIN@9
1119µs9µsFile::stat::::BEGIN@17File::stat::BEGIN@17
1117µs7µsFile::stat::::importFile::stat::import
0000s0sFile::stat::::__ANON__[:105]File::stat::__ANON__[:105]
0000s0sFile::stat::::__ANON__[:112]File::stat::__ANON__[:112]
0000s0sFile::stat::::__ANON__[:113]File::stat::__ANON__[:113]
0000s0sFile::stat::::__ANON__[:114]File::stat::__ANON__[:114]
0000s0sFile::stat::::__ANON__[:115]File::stat::__ANON__[:115]
0000s0sFile::stat::::__ANON__[:117]File::stat::__ANON__[:117]
0000s0sFile::stat::::__ANON__[:118]File::stat::__ANON__[:118]
0000s0sFile::stat::::__ANON__[:119]File::stat::__ANON__[:119]
0000s0sFile::stat::::__ANON__[:120]File::stat::__ANON__[:120]
0000s0sFile::stat::::__ANON__[:122]File::stat::__ANON__[:122]
0000s0sFile::stat::::__ANON__[:123]File::stat::__ANON__[:123]
0000s0sFile::stat::::__ANON__[:124]File::stat::__ANON__[:124]
0000s0sFile::stat::::__ANON__[:126]File::stat::__ANON__[:126]
0000s0sFile::stat::::__ANON__[:127]File::stat::__ANON__[:127]
0000s0sFile::stat::::__ANON__[:128]File::stat::__ANON__[:128]
0000s0sFile::stat::::__ANON__[:129]File::stat::__ANON__[:129]
0000s0sFile::stat::::__ANON__[:130]File::stat::__ANON__[:130]
0000s0sFile::stat::::__ANON__[:131]File::stat::__ANON__[:131]
0000s0sFile::stat::::__ANON__[:132]File::stat::__ANON__[:132]
0000s0sFile::stat::::__ANON__[:134]File::stat::__ANON__[:134]
0000s0sFile::stat::::__ANON__[:135]File::stat::__ANON__[:135]
0000s0sFile::stat::::__ANON__[:136]File::stat::__ANON__[:136]
0000s0sFile::stat::::__ANON__[:138]File::stat::__ANON__[:138]
0000s0sFile::stat::::__ANON__[:139]File::stat::__ANON__[:139]
0000s0sFile::stat::::__ANON__[:140]File::stat::__ANON__[:140]
0000s0sFile::stat::::__ANON__[:168]File::stat::__ANON__[:168]
0000s0sFile::stat::::__ANON__[:38]File::stat::__ANON__[:38]
0000s0sFile::stat::::__ANON__[:42]File::stat::__ANON__[:42]
0000s0sFile::stat::::__ANON__[:78]File::stat::__ANON__[:78]
0000s0sFile::stat::::_ingroupFile::stat::_ingroup
0000s0sFile::stat::::lstatFile::stat::lstat
0000s0sFile::stat::::populateFile::stat::populate
0000s0sFile::stat::::statFile::stat::stat
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package File::stat;
22230µs1342µs
# spent 342µs within File::stat::BEGIN@2 which was called: # once (342µs+0s) by installer::worker::BEGIN@32 at line 2
use 5.006;
# spent 342µs making 1 call to File::stat::BEGIN@2
3
4258µs239µs
# spent 30µs (20+10) within File::stat::BEGIN@4 which was called: # once (20µs+10µs) by installer::worker::BEGIN@32 at line 4
use strict;
# spent 30µs making 1 call to File::stat::BEGIN@4 # spent 10µs making 1 call to strict::import
5254µs262µs
# spent 39µs (17+23) within File::stat::BEGIN@5 which was called: # once (17µs+23µs) by installer::worker::BEGIN@32 at line 5
use warnings;
# spent 39µs making 1 call to File::stat::BEGIN@5 # spent 23µs making 1 call to warnings::import
6258µs2451µs
# spent 234µs (16+218) within File::stat::BEGIN@6 which was called: # once (16µs+218µs) by installer::worker::BEGIN@32 at line 6
use warnings::register;
# spent 234µs making 1 call to File::stat::BEGIN@6 # spent 218µs making 1 call to warnings::register::import
7276µs2187µs
# spent 103µs (20+84) within File::stat::BEGIN@7 which was called: # once (20µs+84µs) by installer::worker::BEGIN@32 at line 7
use Carp;
# spent 103µs making 1 call to File::stat::BEGIN@7 # spent 84µs making 1 call to Exporter::import
8
91121µs111µs
# spent 11µs within File::stat::BEGIN@9 which was called: # once (11µs+0s) by installer::worker::BEGIN@32 at line 9
BEGIN { *warnif = \&warnings::warnif }
# spent 11µs making 1 call to File::stat::BEGIN@9
10
1111µsour(@EXPORT, @EXPORT_OK, %EXPORT_TAGS);
12
1312µsour $VERSION = '1.05';
14
151500nsmy @fields;
16
# spent 32µs within File::stat::BEGIN@16 which was called: # once (32µs+0s) by installer::worker::BEGIN@32 at line 27
BEGIN {
172125µs19µs
# spent 9µs within File::stat::BEGIN@17 which was called: # once (9µs+0s) by installer::worker::BEGIN@32 at line 17
use Exporter ();
# spent 9µs making 1 call to File::stat::BEGIN@17
18432µs @EXPORT = qw(stat lstat);
19 @fields = qw( $st_dev $st_ino $st_mode
20 $st_nlink $st_uid $st_gid
21 $st_rdev $st_size
22 $st_atime $st_mtime $st_ctime
23 $st_blksize $st_blocks
24 );
25 @EXPORT_OK = ( @fields, "stat_cando" );
26 %EXPORT_TAGS = ( FIELDS => [ @fields, @EXPORT ] );
27167µs132µs}
# spent 32µs making 1 call to File::stat::BEGIN@16
28266µs2644µs
# spent 330µs (16+314) within File::stat::BEGIN@28 which was called: # once (16µs+314µs) by installer::worker::BEGIN@32 at line 28
use vars @fields;
# spent 330µs making 1 call to File::stat::BEGIN@28 # spent 314µs making 1 call to vars::import
29
30270µs2130µs
# spent 73µs (16+57) within File::stat::BEGIN@30 which was called: # once (16µs+57µs) by installer::worker::BEGIN@32 at line 30
use Fcntl qw(S_IRUSR S_IWUSR S_IXUSR);
# spent 73µs making 1 call to File::stat::BEGIN@30 # spent 57µs making 1 call to Exporter::import
31
32
# spent 263µs (167+96) within File::stat::BEGIN@32 which was called: # once (167µs+96µs) by installer::worker::BEGIN@32 at line 44
BEGIN {
33 # These constants will croak on use if the platform doesn't define
34 # them. It's important to avoid inflicting that on the user.
352298µs260µs
# spent 37µs (13+23) within File::stat::BEGIN@35 which was called: # once (13µs+23µs) by installer::worker::BEGIN@32 at line 35
no strict 'refs';
# spent 37µs making 1 call to File::stat::BEGIN@35 # spent 23µs making 1 call to strict::unimport
3625263µs for (qw(suid sgid svtx)) {
37331µs my $val = eval { &{"Fcntl::S_I\U$_"} };
# spent 12µs making 1 call to Fcntl::S_ISUID # spent 9µs making 1 call to Fcntl::S_ISGID # spent 9µs making 1 call to Fcntl::S_ISVTX
38 *{"_$_"} = defined $val ? sub { $_[0] & $val ? 1 : "" } : sub { "" };
39 }
40 for (qw(SOCK CHR BLK REG DIR FIFO LNK)) {
41765µs *{"S_IS$_"} = defined eval { &{"Fcntl::S_IF$_"} }
# spent 23µs making 1 call to Fcntl::S_IFFIFO # spent 8µs making 1 call to Fcntl::S_IFSOCK # spent 7µs making 1 call to Fcntl::S_IFCHR # spent 7µs making 1 call to Fcntl::S_IFLNK # spent 7µs making 1 call to Fcntl::S_IFBLK # spent 7µs making 1 call to Fcntl::S_IFREG # spent 7µs making 1 call to Fcntl::S_IFDIR
42 ? \&{"Fcntl::S_IS$_"} : sub { "" };
43 }
4411.65ms1263µs}
# spent 263µs making 1 call to File::stat::BEGIN@32
45
46# from doio.c
47sub _ingroup {
48 my ($gid, $eff) = @_;
49
50 # I am assuming that since VMS doesn't have getgroups(2), $) will
51 # always only contain a single entry.
52 $^O eq "VMS" and return $_[0] == $);
53
54 my ($egid, @supp) = split " ", $);
55 my ($rgid) = split " ", $(;
56
57 $gid == ($eff ? $egid : $rgid) and return 1;
58 grep $gid == $_, @supp and return 1;
59
60 return "";
61}
62
63# VMS uses the Unix version of the routine, even though this is very
64# suboptimal. VMS has a permissions structure that doesn't really fit
65# into struct stat, and unlike on Win32 the normal -X operators respect
66# that, but unfortunately by the time we get here we've already lost the
67# information we need. It looks to me as though if we were to preserve
68# the st_devnam entry of vmsish.h's fake struct stat (which actually
69# holds the filename) it might be possible to do this right, but both
70# getting that value out of the struct (perl's stat doesn't return it)
71# and interpreting it later would require this module to have an XS
72# component (at which point we might as well just call Perl_cando and
73# have done with it).
74
7514µsif (grep $^O eq $_, qw/os2 MSWin32 dos/) {
76
77 # from doio.c
78 *cando = sub { ($_[0][2] & $_[1]) ? 1 : "" };
79}
80else {
81
82 # from doio.c
83 *cando = sub {
84 my ($s, $mode, $eff) = @_;
85 my $uid = $eff ? $> : $<;
86
87 # If we're root on unix and we are not testing for executable
88 # status, then all file tests are true.
89 $^O ne "VMS" and $uid == 0 and !($mode & 0111) and return 1;
90
91 my ($stmode, $stuid, $stgid) = @$s[2,4,5];
92
93 # This code basically assumes that the rwx bits of the mode are
94 # the 0777 bits, but so does Perl_cando.
95 if ($stuid == $uid) {
96 $stmode & $mode and return 1;
97 }
98 elsif (_ingroup($stgid, $eff)) {
99 $stmode & ($mode >> 3) and return 1;
100 }
101 else {
102 $stmode & ($mode >> 6) and return 1;
103 }
104 return "";
10518µs };
106}
107
108# alias for those who don't like objects
10912µs*stat_cando = \&cando;
110
111my %op = (
112 r => sub { cando($_[0], S_IRUSR, 1) },
113 w => sub { cando($_[0], S_IWUSR, 1) },
114 x => sub { cando($_[0], S_IXUSR, 1) },
115 o => sub { $_[0][4] == $> },
116
117 R => sub { cando($_[0], S_IRUSR, 0) },
118 W => sub { cando($_[0], S_IWUSR, 0) },
119 X => sub { cando($_[0], S_IXUSR, 0) },
120 O => sub { $_[0][4] == $< },
121
122 e => sub { 1 },
123 z => sub { $_[0][7] == 0 },
124 s => sub { $_[0][7] },
125
126 f => sub { S_ISREG ($_[0][2]) },
127 d => sub { S_ISDIR ($_[0][2]) },
128 l => sub { S_ISLNK ($_[0][2]) },
129 p => sub { S_ISFIFO($_[0][2]) },
130 S => sub { S_ISSOCK($_[0][2]) },
131 b => sub { S_ISBLK ($_[0][2]) },
132 c => sub { S_ISCHR ($_[0][2]) },
133
134 u => sub { _suid($_[0][2]) },
135 g => sub { _sgid($_[0][2]) },
136 k => sub { _svtx($_[0][2]) },
137
138 M => sub { ($^T - $_[0][9] ) / 86400 },
139 C => sub { ($^T - $_[0][10]) / 86400 },
140 A => sub { ($^T - $_[0][8] ) / 86400 },
1411108µs);
142
1432258µs2174µs
# spent 96µs (17+78) within File::stat::BEGIN@143 which was called: # once (17µs+78µs) by installer::worker::BEGIN@32 at line 143
use constant HINT_FILETEST_ACCESS => 0x00400000;
# spent 96µs making 1 call to File::stat::BEGIN@143 # spent 78µs making 1 call to constant::import
144
145# we need fallback=>1 or stringifying breaks
146use overload
147
# spent 83µs (24+59) within File::stat::BEGIN@147 which was called: # once (24µs+59µs) by installer::worker::BEGIN@32 at line 168
fallback => 1,
148 -X => sub {
149 my ($s, $op) = @_;
150
151 if (index "rwxRWX", $op) {
152 (caller 0)[8] & HINT_FILETEST_ACCESS
153 and warnif("File::stat ignores use filetest 'access'");
154
155 $^O eq "VMS" and warnif("File::stat ignores VMS ACLs");
156
157 # It would be nice to have a warning about using -l on a
158 # non-lstat, but that would require an extra member in the
159 # object.
160 }
161
162 if ($op{$op}) {
163 return $op{$op}->($_[0]);
164 }
165 else {
166 croak "-$op is not implemented on a File::stat object";
167 }
168298µs2141µs };
# spent 83µs making 1 call to File::stat::BEGIN@147 # spent 59µs making 1 call to overload::import
169
170# Class::Struct forbids use of @ISA
171112µs156µs
# spent 7µs within File::stat::import which was called: # once (7µs+0s) by installer::worker::BEGIN@32 at line 32 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/worker.pm
sub import { goto &Exporter::import }
# spent 56µs making 1 call to Exporter::import
172
17323.47ms26.97ms
# spent 6.72ms (5.77+950µs) within File::stat::BEGIN@173 which was called: # once (5.77ms+950µs) by installer::worker::BEGIN@32 at line 173
use Class::Struct qw(struct);
# spent 6.72ms making 1 call to File::stat::BEGIN@173 # spent 248µs making 1 call to Class::Struct::import
174struct 'File::stat' => [
175147µs11.77ms map { $_ => '$' } qw{
# spent 1.77ms making 1 call to Class::Struct::struct
176 dev ino mode nlink uid gid rdev size
177 atime mtime ctime blksize blocks
178 }
179];
180
181sub populate (@) {
182 return unless @_;
183 my $stob = new();
184 @$stob = (
185 $st_dev, $st_ino, $st_mode, $st_nlink, $st_uid, $st_gid, $st_rdev,
186 $st_size, $st_atime, $st_mtime, $st_ctime, $st_blksize, $st_blocks )
187 = @_;
188 return $stob;
189}
190
191sub lstat ($) { populate(CORE::lstat(shift)) }
192
193sub stat ($) {
194 my $arg = shift;
195 my $st = populate(CORE::stat $arg);
196 return $st if defined $st;
197 my $fh;
198 {
199 local $!;
2002209µs254µs
# spent 34µs (13+21) within File::stat::BEGIN@200 which was called: # once (13µs+21µs) by installer::worker::BEGIN@32 at line 200
no strict 'refs';
# spent 34µs making 1 call to File::stat::BEGIN@200 # spent 21µs making 1 call to strict::unimport
201 require Symbol;
202 $fh = \*{ Symbol::qualify( $arg, caller() )};
203 return unless defined fileno $fh;
204 }
205 return populate(CORE::stat $fh);
206}
207
208192µs1;
209__END__