← Index
NYTProf Performance Profile   « line view »
For rbm/rbm
  Run on Wed Feb 12 20:36:06 2020
Reported on Wed Feb 12 21:42:25 2020

Filename/root/tor-browser-build/rbm/rbm
StatementsExecuted 37 statements in 2.86ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
7580641251.21s1.21sUNIVERSAL::::isaUNIVERSAL::isa (xsub)
11110.2ms111msmain::::BEGIN@6 main::BEGIN@6
1118.51ms9.67msmain::::BEGIN@8 main::BEGIN@8
1111.92ms4.71msmain::::BEGIN@4 main::BEGIN@4
111508µs1.32msmain::::BEGIN@5 main::BEGIN@5
111441µs478µsmain::::BEGIN@3 main::BEGIN@3
11115129µs129µsUNIVERSAL::::VERSIONUNIVERSAL::VERSION (xsub)
3211121µs121µsPerlIO::::get_layers PerlIO::get_layers (xsub)
11153µs58.4msmain::::set_options main::set_options
811153µs53µsmro::::method_changed_in mro::method_changed_in (xsub)
893150µs50µsInternals::::SvREADONLYInternals::SvREADONLY (xsub)
11132µs33µsFcntl::::O_NOINHERIT Fcntl::O_NOINHERIT
11127µs1692smain::::build_script main::build_script
11115µs1692smain::::__ANON__[rbm/rbm:45] main::__ANON__[rbm/rbm:45]
131115µs15µsutf8::::encode utf8::encode (xsub)
11112µs13µsFcntl::::O_EXLOCK Fcntl::O_EXLOCK
11112µs12µsFcntl::::O_TEMPORARY Fcntl::O_TEMPORARY
11111µs67µsmain::::BEGIN@7 main::BEGIN@7
1114µs4µsversion::::(bool version::(bool (xsub)
1113µs3µsversion::::(cmp version::(cmp (xsub)
0000s0smain::::__ANON__[rbm/rbm:29] main::__ANON__[rbm/rbm:29]
0000s0smain::::__ANON__[rbm/rbm:33] main::__ANON__[rbm/rbm:33]
0000s0smain::::__ANON__[rbm/rbm:37] main::__ANON__[rbm/rbm:37]
0000s0smain::::__ANON__[rbm/rbm:41] main::__ANON__[rbm/rbm:41]
0000s0smain::::fetch main::fetch
0000s0smain::::pkg main::pkg
0000s0smain::::print_projects main::print_projects
0000s0smain::::publish main::publish
0000s0smain::::rpmspec main::rpmspec
0000s0smain::::show_conf main::show_conf
0000s0smain::::tar main::tar
0000s0smain::::usage main::usage
0000s0smain::::usageexit main::usageexit
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
0169µsProfile data that couldn't be associated with a specific line:
# spent 69µs making 1 call to File::Temp::END
1129µs#!/usr/bin/perl -w
2
32259µs2481µs
# spent 478µs (441+37) within main::BEGIN@3 which was called: # once (441µs+37µs) by main::NULL at line 3
use strict;
# spent 478µs making 1 call to main::BEGIN@3 # spent 3µs making 1 call to strict::import
42133µs24.75ms
# spent 4.71ms (1.92+2.79) within main::BEGIN@4 which was called: # once (1.92ms+2.79ms) by main::NULL at line 4
use File::Basename;
# spent 4.71ms making 1 call to main::BEGIN@4 # spent 33µs making 1 call to Exporter::import
5297µs31.41ms
# spent 1.32ms (508µs+814µs) within main::BEGIN@5 which was called: # once (508µs+814µs) by main::NULL at line 5
use lib dirname($0) . '/lib';
# spent 1.32ms making 1 call to main::BEGIN@5 # spent 50µs making 1 call to lib::import # spent 34µs making 1 call to File::Basename::dirname
62175µs2111ms
# spent 111ms (10.2+101) within main::BEGIN@6 which was called: # once (10.2ms+101ms) by main::NULL at line 6
use RBM;
# spent 111ms making 1 call to main::BEGIN@6 # spent 2µs making 1 call to main::__ANON__
7228µs2123µs
# spent 67µs (11+56) within main::BEGIN@7 which was called: # once (11µs+56µs) by main::NULL at line 7
use YAML::XS;
# spent 67µs making 1 call to main::BEGIN@7 # spent 56µs making 1 call to Exporter::import
821.86ms29.86ms
# spent 9.67ms (8.51+1.16) within main::BEGIN@8 which was called: # once (8.51ms+1.16ms) by main::NULL at line 8
use Getopt::Long;
# spent 9.67ms making 1 call to main::BEGIN@8 # spent 188µs making 1 call to Getopt::Long::import
9#use Data::Dump qw/dd/;
10
11my %actions = (
12 projects => {
13 run => \&print_projects,
14 descr => 'Print projects list',
15 },
16 fetch => {
17 run => \&fetch,
18 descr => 'Fetch commits from remote git repository',
19 },
20 tar => {
21 run => \&tar,
22 descr => 'Create source tarball',
23 },
24 rpmspec => {
25 run => \&rpmspec,
26 descr => 'Create rpm spec file',
27 },
28 rpm => {
29 run => sub { build_script('rpm', @_) },
30 descr => 'Build an rpm package',
31 },
32 srpm => {
33 run => sub { build_script('srpm', @_) },
34 descr => 'Create source rpm file',
35 },
36 'deb-src' => {
37 run => sub { build_script('deb_src', @_) },
38 descr => 'Create debian source package',
39 },
40 'deb' => {
41 run => sub { build_script('deb', @_) },
42 descr => 'Create debian package',
43 },
44 build => {
451141µs11692s
# spent 1692s (15µs+1692) within main::__ANON__[rbm/rbm:45] which was called: # once (15µs+1692s) by main::RUNTIME at line 204
run => sub { build_script('build', @_) },
# spent 1692s making 1 call to main::build_script
46120µs descr => 'Build project with a custom build script',
47 },
48 pkg => {
49 run => \&pkg,
50 descr => 'Build a package',
51 },
52 publish => {
53 run => \&publish,
54 descr => 'Publish a package',
55 },
56 showconf => {
57 run => \&show_conf,
58 descr => 'Show configuration',
59 },
60 usage => {
61 run => \&usage,
62 descr => 'Show usage information for an action',
63 no_config => 1,
64 },
65 '--help' => {
66 run => \&usage,
67 no_config => 1,
68 },
69);
70
71sub usage {
72 if ($_[1] && $actions{$_[1]} && $actions{$_[1]}->{descr}) {
73 system('man', "rbm-$_[1]");
74 } else {
75 print STDERR "$0 <action> [options]\n";
76 print STDERR "$0 usage [action]\n\n";
77 print STDERR "Available actions:\n";
78 my @actions = grep { $actions{$_}->{descr} } keys %actions;
79 print STDERR map { " - $_ : $actions{$_}->{descr}\n" } @actions;
80 print STDERR "\nSee '$0 usage <action>' for usage informations\n";
81 }
82 exit 0;
83}
84sub usageexit {
85 my $cmd = shift;
86 print STDERR "Incorrect argument(s).\n";
87 print STDERR "See '$0 usage $cmd' for usage informations\n";
88 exit 1;
89}
90
91
# spent 58.4ms (53µs+58.3) within main::set_options which was called: # once (53µs+58.3ms) by main::build_script at line 175
sub set_options {
92112µs my @options = qw(distribution=s version=s tag-gpg-id=s@ commit-gpg-id=s@
93 projects-dir=s git-clone-dir=s git-hash=s output-dir=s
94 compress_tar=s pkg-rel=s timestamp=i fetch!
95 gpg-keyring=s gpg-keyring-dir=s gpg-args=s gpg-bin=s
96 sysconf-file=s debsign-keyid=s use-pbuilder!
97 step=s target=s@ publish-src-dir=s debug! hg-clone-dir=s
98 hg-hash=s localconf-file=s build-log=s);
991300ns my %val;
10017µs11.00ms Getopt::Long::GetOptionsFromArray(\@_, \%val, @options) || exit 1;
# spent 1.00ms making 1 call to Getopt::Long::GetOptionsFromArray
10111µs foreach my $k (keys %val) {
1021300ns if ($k eq 'step') {
103 $RBM::config->{step} = $val{$k};
104 next;
105 }
1061500ns my $l = $k;
10716µs1700ns $l =~ s/-/_/g;
# spent 700ns making 1 call to main::CORE:subst
10812µs $RBM::config->{run}{$l} = $val{$k};
109 }
11015µs152.0ms RBM::load_system_config(@_);
# spent 52.0ms making 1 call to RBM::load_system_config
11114µs15.36ms RBM::load_local_config(@_);
# spent 5.36ms making 1 call to RBM::load_local_config
112115µs return $RBM::config->{run}{args} = \@_;
113}
114
115sub show_conf {
116 shift;
117 my $args = set_options(@_);
118 if (@$args == 0) {
119 print YAML::XS::Dump($RBM::config);
120 return;
121 }
122 my $project = shift @$args;
123 RBM::valid_project($project);
124 my $r = @$args ? RBM::project_config($project,
125 @$args == 1 ? $args->[0] : \@$args)
126 : $RBM::config->{projects}{$project};
127 RBM::exit_error "Undefined" unless defined $r;
128 print ref $r ? YAML::XS::Dump($r) : "$r\n";
129}
130
131sub fetch {
132 shift;
133 $RBM::config->{run}{fetch} = 1;
134 my $args = set_options(@_);
135 my @l = @$args ? @$args : (RBM::projectslist());
136 foreach my $project (@l) {
137 RBM::valid_project($project);
138 if (RBM::project_config($project, 'git_url')) {
139 print "Fetching commits for $project\n";
140 RBM::git_clone_fetch_chdir($project);
141 } elsif (RBM::project_config($project, 'hg_url')) {
142 print "Fetching commits for $project\n";
143 RBM::hg_clone_fetch_chdir($project);
144 } else {
145 print "Skipping $project\n";
146 }
147 }
148}
149
150sub tar {
151 usageexit($_[0]) unless @_ >= 2;
152 shift;
153 my $args = set_options(@_);
154 usageexit('tar') unless @$args == 1;
155 RBM::maketar($args->[0]);
156}
157
158sub rpmspec {
159 usageexit($_[0]) unless @_ >= 2;
160 shift;
161 my $args = set_options(@_);
162 usageexit('rpmspec') unless @$args == 1;
163 RBM::rpmspec($args->[0]);
164}
165
166sub print_projects {
167 usageexit($_[0]) unless @_ == 1;
168 print join("\n", RBM::projectslist()), "\n";
169}
170
171
# spent 1692s (27µs+1692) within main::build_script which was called: # once (27µs+1692s) by main::__ANON__[rbm/rbm:45] at line 45
sub build_script {
17211µs my $script_name = shift;
1731800ns usageexit($_[0]) unless @_ >= 2;
1741400ns my $cmd = shift;
17517µs158.4ms my $args = set_options(@_);
# spent 58.4ms making 1 call to main::set_options
17612µs usageexit($cmd) unless @$args == 1;
17712µs $script_name = $RBM::config->{step} if $RBM::config->{step} ne 'rbm_init';
178120µs11692s RBM::build_pkg($args->[0], { pkg_type => $script_name });
# spent 1692s making 1 call to RBM::build_pkg
179}
180
181sub pkg {
182 usageexit($_[0]) unless @_ >= 2;
183 my $cmd = shift;
184 my $args = set_options(@_);
185 usageexit($cmd) unless @$args == 1;
186 RBM::build_pkg($args->[0]);
187}
188
189sub publish {
190 usageexit($_[0]) unless @_ >= 2;
191 my $cmd = shift;
192 my $args = set_options(@_);
193 usageexit($cmd) unless @$args == 1;
194 RBM::publish($args->[0]);
195}
196
19711µsif (@ARGV == 0 || !$actions{$ARGV[0]}) {
198 usage();
199 exit 1;
200}
20113µsusage('usage', $ARGV[0]) if grep { $_ eq '--help' } @ARGV[1..(@ARGV - 1)];
202117µs120.9msRBM::load_config unless $actions{$ARGV[0]}->{no_config};
# spent 20.9ms making 1 call to RBM::load_config
20317µs151µsRBM::set_default_env unless $actions{$ARGV[0]}->{no_config};
# spent 51µs making 1 call to RBM::set_default_env
20416µs11692s$actions{$ARGV[0]}->{run}->(@ARGV);
# spent 1692s making 1 call to main::__ANON__[rbm/rbm:45]
205
206# vim: expandtab sw=4
 
# spent 50µs within Internals::SvREADONLY which was called 89 times, avg 558ns/call: # 87 times (49µs+0s) by constant::import at line 164 of constant.pm, avg 559ns/call # once (800ns+0s) by constant::BEGIN@24 at line 33 of constant.pm # once (300ns+0s) by constant::BEGIN@24 at line 34 of constant.pm
sub Internals::SvREADONLY; # xsub
# spent 121µs within PerlIO::get_layers which was called 32 times, avg 4µs/call: # 32 times (121µs+0s) by Path::Tiny::filehandle at line 1056 of Path/Tiny.pm, avg 4µs/call
sub PerlIO::get_layers; # xsub
# spent 129µs within UNIVERSAL::VERSION which was called 11 times, avg 12µs/call: # once (37µs+0s) by Encode::BEGIN@15 at line 15 of Encode.pm # once (18µs+0s) by IO::CaptureOutput::_proxy::BEGIN@138 at line 138 of IO/CaptureOutput.pm # once (15µs+0s) by Path::Tiny::_check_UU at line 46 of Path/Tiny.pm # once (13µs+0s) by Path::Tiny::BEGIN@13 at line 13 of Path/Tiny.pm # once (9µs+0s) by File::Temp::BEGIN@31 at line 31 of File/Temp.pm # once (8µs+0s) by YAML::XS::BEGIN@21 at line 24 of Scalar/Util.pm # once (7µs+0s) by File::Temp::BEGIN@11 at line 11 of File/Temp.pm # once (6µs+0s) by File::Temp::BEGIN@43 at line 43 of File/Temp.pm # once (6µs+0s) by Path::Tiny::BEGIN@12 at line 12 of Path/Tiny.pm # once (5µs+0s) by File::Temp::BEGIN@13 at line 13 of File/Temp.pm # once (5µs+0s) by File::Temp::BEGIN@14 at line 14 of File/Temp.pm
sub UNIVERSAL::VERSION; # xsub
# spent 1.21s within UNIVERSAL::isa which was called 758064 times, avg 2µs/call: # 375387 times (1.02s+0s) by Template::Context::template at line 87 of Template/Context.pm, avg 3µs/call # 375387 times (177ms+0s) by Template::Context::process at line 339 of Template/Context.pm, avg 472ns/call # 1991 times (2.07ms+0s) by Template::Document::__ANON__[input text:22] at line 10 of /root/tor-browser-build/input text, avg 1µs/call # 1991 times (1.73ms+0s) by Template::Document::__ANON__[input text:43] at line 17 of /root/tor-browser-build/input text, avg 868ns/call # 1013 times (3.00ms+0s) by Template::Context::process at line 331 of Template/Context.pm, avg 3µs/call # 1013 times (864µs+0s) by Template::Context::process at line 373 of Template/Context.pm, avg 853ns/call # 993 times (1.16ms+0s) by Template::Document::__ANON__[input text:35] at line 15 of /root/tor-browser-build/input text, avg 1µs/call # 273 times (369µs+0s) by Template::Document::__ANON__[input text:35] at line 27 of /root/tor-browser-build/input text, avg 1µs/call # 13 times (21µs+0s) by base::import at line 94 of base.pm, avg 2µs/call # once (16µs+0s) by File::Path::rmtree at line 281 of File/Path.pm # once (2µs+0s) by Getopt::Long::GetOptionsFromArray at line 333 of Getopt/Long.pm # once (700ns+0s) by Getopt::Long::GetOptionsFromArray at line 475 of Getopt/Long.pm
sub UNIVERSAL::isa; # xsub
# spent 53µs within mro::method_changed_in which was called 81 times, avg 656ns/call: # 81 times (53µs+0s) by constant::import at line 198 of constant.pm, avg 656ns/call
sub mro::method_changed_in; # xsub
# spent 15µs within utf8::encode which was called 13 times, avg 1µs/call: # 13 times (15µs+0s) by base::__ANON__[/usr/share/perl/5.28/base.pm:75] at line 73 of base.pm, avg 1µs/call
sub utf8::encode; # xsub
# spent 4µs within version::(bool which was called: # once (4µs+0s) by lib::BEGIN@6 at line 59 of Config.pm
sub version::(bool; # xsub
# spent 3µs within version::(cmp which was called: # once (3µs+0s) by lib::BEGIN@6 at line 62 of Config.pm
sub version::(cmp; # xsub