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

Filename/cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/profiles.pm
StatementsExecuted 12238 statements in 104ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
81183.1ms83.5msinstaller::profiles::::add_profile_into_filelistinstaller::profiles::add_profile_into_filelist
11112.6ms397msinstaller::profiles::::create_profilesinstaller::profiles::create_profiles
8112.56ms2.56msinstaller::profiles::::CORE:ftdirinstaller::profiles::CORE:ftdir (opcode)
8112.11ms4.02msinstaller::profiles::::sorting_profileinstaller::profiles::sorting_profile
76231764µs764µsinstaller::profiles::::CORE:matchinstaller::profiles::CORE:match (opcode)
811421µs717µsinstaller::profiles::::include_windows_lineendsinstaller::profiles::include_windows_lineends
111369µs372µsinstaller::profiles::::BEGIN@30installer::profiles::BEGIN@30
7411297µs297µsinstaller::profiles::::CORE:substinstaller::profiles::CORE:subst (opcode)
11116µs17µsinstaller::profiles::::BEGIN@36installer::profiles::BEGIN@36
11115µs18µsinstaller::profiles::::BEGIN@31installer::profiles::BEGIN@31
11115µs18µsinstaller::profiles::::BEGIN@33installer::profiles::BEGIN@33
11115µs66µsinstaller::profiles::::BEGIN@34installer::profiles::BEGIN@34
11114µs16µsinstaller::profiles::::BEGIN@35installer::profiles::BEGIN@35
11114µs17µsinstaller::profiles::::BEGIN@32installer::profiles::BEGIN@32
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org. If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27
28package installer::profiles;
29
30261µs2376µs
# spent 372µs (369+4) within installer::profiles::BEGIN@30 which was called: # once (369µs+4µs) by installer::BEGIN@52 at line 30
use installer::converter;
# spent 372µs making 1 call to installer::profiles::BEGIN@30 # spent 4µs making 1 call to UNIVERSAL::import
31256µs220µs
# spent 18µs (15+3) within installer::profiles::BEGIN@31 which was called: # once (15µs+3µs) by installer::BEGIN@52 at line 31
use installer::exiter;
# spent 18µs making 1 call to installer::profiles::BEGIN@31 # spent 3µs making 1 call to UNIVERSAL::import
32253µs220µs
# spent 17µs (14+3) within installer::profiles::BEGIN@32 which was called: # once (14µs+3µs) by installer::BEGIN@52 at line 32
use installer::files;
# spent 17µs making 1 call to installer::profiles::BEGIN@32 # spent 3µs making 1 call to UNIVERSAL::import
33253µs220µs
# spent 18µs (15+3) within installer::profiles::BEGIN@33 which was called: # once (15µs+3µs) by installer::BEGIN@52 at line 33
use installer::globals;
# spent 18µs making 1 call to installer::profiles::BEGIN@33 # spent 3µs making 1 call to UNIVERSAL::import
34254µs2117µs
# spent 66µs (15+51) within installer::profiles::BEGIN@34 which was called: # once (15µs+51µs) by installer::BEGIN@52 at line 34
use installer::logger;
# spent 66µs making 1 call to installer::profiles::BEGIN@34 # spent 51µs making 1 call to Exporter::import
35254µs218µs
# spent 16µs (14+2) within installer::profiles::BEGIN@35 which was called: # once (14µs+2µs) by installer::BEGIN@52 at line 35
use installer::remover;
# spent 16µs making 1 call to installer::profiles::BEGIN@35 # spent 2µs making 1 call to UNIVERSAL::import
3621.78ms218µs
# spent 17µs (16+1) within installer::profiles::BEGIN@36 which was called: # once (16µs+1µs) by installer::BEGIN@52 at line 36
use installer::systemactions;
# spent 17µs making 1 call to installer::profiles::BEGIN@36 # spent 2µs making 1 call to UNIVERSAL::import
37
38#############################
39# Profiles
40#############################
41
42#######################################################
43# Sorting the content of a profile
44#######################################################
45
46sub sorting_profile
47
# spent 4.02ms (2.11+1.91) within installer::profiles::sorting_profile which was called 8 times, avg 502µs/call: # 8 times (2.11ms+1.91ms) by installer::profiles::create_profiles at line 208, avg 502µs/call
{
4810162.15ms my ($profilesref) = @_;
49
50 my @profile = ();
51 my @definedsections = ();
52
53 for ( my $i = 0; $i <= $#{$profilesref}; $i++ )
54 {
55 my $line = ${$profilesref}[$i];
56
57130258µs if ( $line =~ /^\s*(\[.*\])\s*$/ ) # this is a section (every second line)
# spent 258µs making 130 calls to installer::profiles::CORE:match, avg 2µs/call
58 {
59 my $section = $1;
60
61 if (! grep {$_ eq $section} @definedsections)
62 {
63 my $sectionline = $section . "\n";
64 push(@definedsections, $section);
65 push(@profile, $sectionline);
66
67 for ( my $j = 0; $j <= $#{$profilesref}; $j++ )
68 {
69 my $oneline = ${$profilesref}[$j];
701401.65ms installer::remover::remove_leading_and_ending_whitespaces(\$oneline);
# spent 1.65ms making 140 calls to installer::remover::remove_leading_and_ending_whitespaces, avg 12µs/call
71
72 if ( $oneline eq $section )
73 {
74 my $nextline = ${$profilesref}[$j+1];
75 push(@profile, $nextline);
76 }
77 }
78 }
79 }
80 }
81
82 return \@profile;
83}
84
85#####################################################################
86# Adding the newly created profile into the file list
87#####################################################################
88
89sub add_profile_into_filelist
90
# spent 83.5ms (83.1+352µs) within installer::profiles::add_profile_into_filelist which was called 8 times, avg 10.4ms/call: # 8 times (83.1ms+352µs) by installer::profiles::create_profiles at line 222, avg 10.4ms/call
{
9114483.1ms my ($filesarrayref, $oneprofile, $completeprofilename, $allvariables) = @_;
92
93 my %profile = ();
94
95 # Taking the base data from the "gid_File_Lib_Vcl"
96
97 my $vclgid = "gid_File_Lib_Vcl";
98 if ( $allvariables->{'GLOBALFILEGID'} ) { $vclgid = $allvariables->{'GLOBALFILEGID'}; }
99 my ($vclfile) = grep {$_->{gid} eq $vclgid} @{$filesarrayref};
100 if (! defined $vclfile) {
101 installer::exiter::exit_program("ERROR: Could not find file $vclgid in list of files!", "add_profile_into_filelist");
102 }
103
104 # copying all base data
1058352µs installer::converter::copy_item_object($vclfile, \%profile);
# spent 352µs making 8 calls to installer::converter::copy_item_object, avg 44µs/call
106
107 # and overriding all new values
108
109 $profile{'ismultilingual'} = 0;
110 $profile{'sourcepath'} = $completeprofilename;
111 $profile{'Name'} = $oneprofile->{'Name'};
112 $profile{'UnixRights'} = "644";
113 $profile{'gid'} = $oneprofile->{'gid'};
114 $profile{'Dir'} = $oneprofile->{'Dir'};
115 $profile{'destination'} = $oneprofile->{'destination'};
116 $profile{'Styles'} = "";
117 if ( $oneprofile->{'Styles'} ) { $profile{'Styles'} = $oneprofile->{'Styles'}; }
118 $profile{'modules'} = $oneprofile->{'ModuleID'}; # Profiles can only be added completely to a module
119
120 push(@{$filesarrayref}, \%profile);
121}
122
123###################################################
124# Including Windows line ends in ini files
125# Profiles on Windows shall have \r\n line ends
126###################################################
127
128sub include_windows_lineends
129
# spent 717µs (421+297) within installer::profiles::include_windows_lineends which was called 8 times, avg 90µs/call: # 8 times (421µs+297µs) by installer::profiles::create_profiles at line 210, avg 90µs/call
{
13090728µs my ($onefile) = @_;
131
132 for ( my $i = 0; $i <= $#{$onefile}; $i++ )
133 {
13474297µs ${$onefile}[$i] =~ s/\r?\n$/\r\n/;
# spent 297µs making 74 calls to installer::profiles::CORE:subst, avg 4µs/call
135 }
136}
137
138####################################
139# Create profiles
140####################################
141
142sub create_profiles
143
# spent 397ms (12.6+385) within installer::profiles::create_profiles which was called: # once (12.6ms+385ms) by installer::run at line 830 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm
{
1441097315.6ms my ($profilesref, $profileitemsref, $filesarrayref, $languagestringref, $allvariables) = @_;
145
146 my $infoline;
147
1481280ms my $profilesdir = installer::systemactions::create_directories("profiles", $languagestringref);
# spent 280ms making 1 call to installer::systemactions::create_directories
149
1501149µs installer::logger::include_header_into_logfile("Creating profiles:");
# spent 149µs making 1 call to installer::logger::include_header_into_logfile
151
152 # Attention: The module dependencies from ProfileItems have to be ignored, because
153 # the Profile has to be installed completely with all of its content and the correct name.
154 # Only complete profiles can belong to a specified module, but not ProfileItems!
155
156 # iterating over all files
157
158 for ( my $i = 0; $i <= $#{$profilesref}; $i++ )
159 {
160 my $oneprofile = ${$profilesref}[$i];
161 my $dir = $oneprofile->{'Dir'};
162 if ( $dir eq "PREDEFINED_CONFIGDIR" ) { next; } # ignoring the profile sversion file
163
164 my $profilegid = $oneprofile->{'gid'};
165 my $profilename = $oneprofile->{'Name'};
166
167 my $localprofilesdir = $profilesdir . $installer::globals::separator . $profilegid; # uniqueness guaranteed by gid
168169.27ms if ( ! -d $localprofilesdir ) { installer::systemactions::create_directory($localprofilesdir); }
# spent 6.71ms making 8 calls to installer::systemactions::create_directory, avg 839µs/call # spent 2.56ms making 8 calls to installer::profiles::CORE:ftdir, avg 319µs/call
169
170 my @onefile = ();
171 my $profileempty = 1;
172
173 for ( my $j = 0; $j <= $#{$profileitemsref}; $j++ )
174 {
175 my $oneprofileitem = ${$profileitemsref}[$j];
176
177 my $styles = "";
178 if ( $oneprofileitem->{'Styles'} ) { $styles = $oneprofileitem->{'Styles'}; }
179624466µs if ( $styles =~ /\bINIFILETABLE\b/ ) { next; } # these values are written during installation, not during packing
# spent 466µs making 624 calls to installer::profiles::CORE:match, avg 747ns/call
180
181 my $profileid = $oneprofileitem->{'ProfileID'};
182
183 if ( $profileid eq $profilegid )
184 {
185 my $section = $oneprofileitem->{'Section'};
186 my $key = $oneprofileitem->{'Key'};
187 my $value = $oneprofileitem->{'Value'};
188 for (my $pk = 1; $pk <= 50; $pk++)
189 {
190 my $key = "ValueList" . $pk;
191 if ( $oneprofileitem->{$key} )
192 { $value = $value . " " . $oneprofileitem->{$key} }
193 }
194 my $order = $oneprofileitem->{'Order'}; # ignoring order at the moment
195
196 my $line = "[" . $section . "]" . "\n";
197 push(@onefile, $line);
198 $line = $key . "=" . $value . "\n";
199 push(@onefile, $line);
200
201 $profileempty = 0;
202 }
203 }
204
205 if ( $profileempty ) { next; } # ignoring empty profiles
206
207 # Sorting the array @onefile
20884.02ms my $onefileref = sorting_profile(\@onefile);
# spent 4.02ms making 8 calls to installer::profiles::sorting_profile, avg 502µs/call
209
21016756µs if ( $installer::globals::iswin && $^O =~ /cygwin/i) # Windows line ends only for Cygwin
# spent 717µs making 8 calls to installer::profiles::include_windows_lineends, avg 90µs/call # spent 39µs making 8 calls to installer::profiles::CORE:match, avg 5µs/call
211 {
212 include_windows_lineends($onefileref);
213 }
214
215 # Saving the profile as a file
216 $completeprofilename = $localprofilesdir . $installer::globals::separator . $profilename;
217
21886.29ms installer::files::save_file($completeprofilename, $onefileref);
# spent 6.29ms making 8 calls to installer::files::save_file, avg 786µs/call
219
220 # Adding the file to the filearray
221 # Some data are set now, others are taken from the file "soffice.exe" ("soffice.bin")
222883.5ms add_profile_into_filelist($filesarrayref, $oneprofile, $completeprofilename, $allvariables);
# spent 83.5ms making 8 calls to installer::profiles::add_profile_into_filelist, avg 10.4ms/call
223
224 $infoline = "Created Profile: $completeprofilename\n";
225 push( @installer::globals::logfileinfo, $infoline);
226 }
227
228 $infoline = "\n";
229 push( @installer::globals::logfileinfo, $infoline);
230}
231
232
23317µs1;
 
# spent 2.56ms within installer::profiles::CORE:ftdir which was called 8 times, avg 319µs/call: # 8 times (2.56ms+0s) by installer::profiles::create_profiles at line 168, avg 319µs/call
sub installer::profiles::CORE:ftdir; # opcode
# spent 764µs within installer::profiles::CORE:match which was called 762 times, avg 1µs/call: # 624 times (466µs+0s) by installer::profiles::create_profiles at line 179, avg 747ns/call # 130 times (258µs+0s) by installer::profiles::sorting_profile at line 57, avg 2µs/call # 8 times (39µs+0s) by installer::profiles::create_profiles at line 210, avg 5µs/call
sub installer::profiles::CORE:match; # opcode
# spent 297µs within installer::profiles::CORE:subst which was called 74 times, avg 4µs/call: # 74 times (297µs+0s) by installer::profiles::include_windows_lineends at line 134, avg 4µs/call
sub installer::profiles::CORE:subst; # opcode