← 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:52 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
{
48814µs my ($profilesref) = @_;
49
5086µs my @profile = ();
5186µs my @definedsections = ();
52
538170µs for ( my $i = 0; $i <= $#{$profilesref}; $i++ )
54 {
5513086µs my $line = ${$profilesref}[$i];
56
57130700µs130258µ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 {
596590µs my $section = $1;
60
616584µs if (! grep {$_ eq $section} @definedsections)
62 {
63911µs my $sectionline = $section . "\n";
64910µs push(@definedsections, $section);
65914µs push(@profile, $sectionline);
66
679189µs for ( my $j = 0; $j <= $#{$profilesref}; $j++ )
68 {
6914091µs my $oneline = ${$profilesref}[$j];
70140359µs1401.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
72140111µs if ( $oneline eq $section )
73 {
746578µs my $nextline = ${$profilesref}[$j+1];
756581µs push(@profile, $nextline);
76 }
77 }
78 }
79 }
80 }
81
82857µs 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
{
91819µs my ($filesarrayref, $oneprofile, $completeprofilename, $allvariables) = @_;
92
93812µs my %profile = ();
94
95 # Taking the base data from the "gid_File_Lib_Vcl"
96
9788µs my $vclgid = "gid_File_Lib_Vcl";
98814µs if ( $allvariables->{'GLOBALFILEGID'} ) { $vclgid = $allvariables->{'GLOBALFILEGID'}; }
99882.6ms my ($vclfile) = grep {$_->{gid} eq $vclgid} @{$filesarrayref};
100812µs 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
1058172µs8352µ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
109818µs $profile{'ismultilingual'} = 0;
110816µs $profile{'sourcepath'} = $completeprofilename;
111823µs $profile{'Name'} = $oneprofile->{'Name'};
112810µs $profile{'UnixRights'} = "644";
113816µs $profile{'gid'} = $oneprofile->{'gid'};
114814µs $profile{'Dir'} = $oneprofile->{'Dir'};
115815µs $profile{'destination'} = $oneprofile->{'destination'};
116818µs $profile{'Styles'} = "";
117814µs if ( $oneprofile->{'Styles'} ) { $profile{'Styles'} = $oneprofile->{'Styles'}; }
118812µs $profile{'modules'} = $oneprofile->{'ModuleID'}; # Profiles can only be added completely to a module
119
120875µs 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
{
13089µs my ($onefile) = @_;
131
1328150µs for ( my $i = 0; $i <= $#{$onefile}; $i++ )
133 {
13474568µs74297µ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
{
14412µs my ($profilesref, $profileitemsref, $filesarrayref, $languagestringref, $allvariables) = @_;
145
1461600ns my $infoline;
147
14815µs1280ms my $profilesdir = installer::systemactions::create_directories("profiles", $languagestringref);
# spent 280ms making 1 call to installer::systemactions::create_directories
149
15015µs1149µ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
158134µs for ( my $i = 0; $i <= $#{$profilesref}; $i++ )
159 {
160817µs my $oneprofile = ${$profilesref}[$i];
161817µs my $dir = $oneprofile->{'Dir'};
16289µs if ( $dir eq "PREDEFINED_CONFIGDIR" ) { next; } # ignoring the profile sversion file
163
164810µs my $profilegid = $oneprofile->{'gid'};
165810µs my $profilename = $oneprofile->{'Name'};
166
167820µs my $localprofilesdir = $profilesdir . $installer::globals::separator . $profilegid; # uniqueness guaranteed by gid
16882.67ms169.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
170813µs my @onefile = ();
17187µs my $profileempty = 1;
172
1738694µs for ( my $j = 0; $j <= $#{$profileitemsref}; $j++ )
174 {
175624447µs my $oneprofileitem = ${$profileitemsref}[$j];
176
177624272µs my $styles = "";
178624425µs if ( $oneprofileitem->{'Styles'} ) { $styles = $oneprofileitem->{'Styles'}; }
1796962.31ms624466µ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
181552506µs my $profileid = $oneprofileitem->{'ProfileID'};
182
183552346µs if ( $profileid eq $profilegid )
184 {
1856566µs my $section = $oneprofileitem->{'Section'};
1866561µs my $key = $oneprofileitem->{'Key'};
1876558µs my $value = $oneprofileitem->{'Value'};
188652.99ms for (my $pk = 1; $pk <= 50; $pk++)
189 {
19032502.10ms my $key = "ValueList" . $pk;
19132501.71ms if ( $oneprofileitem->{$key} )
192 { $value = $value . " " . $oneprofileitem->{$key} }
193 }
1946547µs my $order = $oneprofileitem->{'Order'}; # ignoring order at the moment
195
1966559µs my $line = "[" . $section . "]" . "\n";
1976576µs push(@onefile, $line);
1986560µs $line = $key . "=" . $value . "\n";
1996569µs push(@onefile, $line);
200
2016535µs $profileempty = 0;
202 }
203 }
204
20584µs if ( $profileempty ) { next; } # ignoring empty profiles
206
207 # Sorting the array @onefile
208848µs84.02ms my $onefileref = sorting_profile(\@onefile);
# spent 4.02ms making 8 calls to installer::profiles::sorting_profile, avg 502µs/call
209
2108108µs16756µ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
216814µs $completeprofilename = $localprofilesdir . $installer::globals::separator . $profilename;
217
218839µs86.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")
222840µs883.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
224833µs $infoline = "Created Profile: $completeprofilename\n";
2258164µs push( @installer::globals::logfileinfo, $infoline);
226 }
227
2281500ns $infoline = "\n";
229113µs 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