← Index
NYTProf Performance Profile   « line view »
For rbm/rbm
  Run on Wed Feb 12 03:38:15 2020
Reported on Wed Feb 12 04:56:35 2020

Filename/root/tor-browser-build/rbm/rbm
StatementsExecuted 37 statements in 3.58ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
7736121251.26s1.26sUNIVERSAL::::isaUNIVERSAL::isa (xsub)
1119.28ms136msmain::::BEGIN@6 main::BEGIN@6
1118.13ms9.18msmain::::BEGIN@8 main::BEGIN@8
1111.91ms4.79msmain::::BEGIN@4 main::BEGIN@4
1111.37ms2.27msmain::::BEGIN@5 main::BEGIN@5
111436µs476µsmain::::BEGIN@3 main::BEGIN@3
3211113µs113µsPerlIO::::get_layers PerlIO::get_layers (xsub)
11115112µs112µsUNIVERSAL::::VERSIONUNIVERSAL::VERSION (xsub)
11153µs63.0msmain::::set_options main::set_options
811150µs50µsmro::::method_changed_in mro::method_changed_in (xsub)
893149µs49µsInternals::::SvREADONLYInternals::SvREADONLY (xsub)
11135µs36µsFcntl::::O_NOINHERIT Fcntl::O_NOINHERIT
11124µs2205smain::::build_script main::build_script
11116µs2205smain::::__ANON__[rbm/rbm:45] main::__ANON__[rbm/rbm:45]
131115µs15µsutf8::::encode utf8::encode (xsub)
11112µs12µsFcntl::::O_EXLOCK Fcntl::O_EXLOCK
11112µs61µsmain::::BEGIN@7 main::BEGIN@7
11111µs12µsFcntl::::O_TEMPORARY Fcntl::O_TEMPORARY
1114µs4µsversion::::(bool version::(bool (xsub)
1113µs3µsversion::::(cmp version::(cmp (xsub)
1112µs2µsmain::::__ANON__ main::__ANON__ (xsub)
111700ns700nsmain::::CORE:subst main::CORE:subst (opcode)
0000s0smain::::RUNTIME main::RUNTIME
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
0170µsProfile data that couldn't be associated with a specific line:
# spent 70µs making 1 call to File::Temp::END
1129µs#!/usr/bin/perl -w
2
32268µs2479µs
# spent 476µs (436+40) within main::BEGIN@3 which was called: # once (436µs+40µs) by main::NULL at line 3
use strict;
# spent 476µs making 1 call to main::BEGIN@3 # spent 3µs making 1 call to strict::import
42131µs24.82ms
# spent 4.79ms (1.91+2.88) within main::BEGIN@4 which was called: # once (1.91ms+2.88ms) by main::NULL at line 4
use File::Basename;
# spent 4.79ms making 1 call to main::BEGIN@4 # spent 33µs making 1 call to Exporter::import
52952µs32.38ms
# spent 2.27ms (1.37+900µs) within main::BEGIN@5 which was called: # once (1.37ms+900µs) by main::NULL at line 5
use lib dirname($0) . '/lib';
# spent 2.27ms making 1 call to main::BEGIN@5 # spent 66µs making 1 call to lib::import # spent 40µs making 1 call to File::Basename::dirname
62128µs2136ms
# spent 136ms (9.28+127) within main::BEGIN@6 which was called: # once (9.28ms+127ms) by main::NULL at line 6
use RBM;
# spent 136ms making 1 call to main::BEGIN@6 # spent 2µs making 1 call to main::__ANON__
7230µs2110µs
# spent 61µs (12+49) within main::BEGIN@7 which was called: # once (12µs+49µs) by main::NULL at line 7
use YAML::XS;
# spent 61µs making 1 call to main::BEGIN@7 # spent 49µs making 1 call to Exporter::import
821.88ms29.32ms
# spent 9.18ms (8.13+1.05) within main::BEGIN@8 which was called: # once (8.13ms+1.05ms) by main::NULL at line 8
use Getopt::Long;
# spent 9.18ms making 1 call to main::BEGIN@8 # spent 141µ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 => {
45120µs12205s
# spent 2205s (16µs+2205) within main::__ANON__[rbm/rbm:45] which was called: # once (16µs+2205s) by main::RUNTIME at line 204
run => sub { build_script('build', @_) },
# spent 2205s making 1 call to main::build_script
46122µ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 63.0ms (53µs+63.0) within main::set_options which was called: # once (53µs+63.0ms) by main::build_script at line 175
sub set_options {
92111µ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
10112µs foreach my $k (keys %val) {
1021600ns 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 }
11014µs157.1ms RBM::load_system_config(@_);
# spent 57.1ms making 1 call to RBM::load_system_config
11114µs14.81ms RBM::load_local_config(@_);
# spent 4.81ms making 1 call to RBM::load_local_config
112117µ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 2205s (24µs+2205) within main::build_script which was called: # once (24µs+2205s) by main::__ANON__[rbm/rbm:45] at line 45
sub build_script {
1721600ns my $script_name = shift;
1731800ns usageexit($_[0]) unless @_ >= 2;
1741500ns my $cmd = shift;
17516µs163.0ms my $args = set_options(@_);
# spent 63.0ms making 1 call to main::set_options
1761900ns usageexit($cmd) unless @$args == 1;
1771900ns $script_name = $RBM::config->{step} if $RBM::config->{step} ne 'rbm_init';
178119µs12205s RBM::build_pkg($args->[0], { pkg_type => $script_name });
# spent 2205s 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}
20112µsusage('usage', $ARGV[0]) if grep { $_ eq '--help' } @ARGV[1..(@ARGV - 1)];
202119µs155.4msRBM::load_config unless $actions{$ARGV[0]}->{no_config};
# spent 55.4ms making 1 call to RBM::load_config
20317µs157µsRBM::set_default_env unless $actions{$ARGV[0]}->{no_config};
# spent 57µs making 1 call to RBM::set_default_env
20416µs12205s$actions{$ARGV[0]}->{run}->(@ARGV);
# spent 2205s making 1 call to main::__ANON__[rbm/rbm:45]
205
206# vim: expandtab sw=4
 
# spent 49µs within Internals::SvREADONLY which was called 89 times, avg 546ns/call: # 87 times (48µs+0s) by constant::import at line 164 of constant.pm, avg 547ns/call # once (700ns+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 113µs within PerlIO::get_layers which was called 32 times, avg 4µs/call: # 32 times (113µs+0s) by Path::Tiny::filehandle at line 1056 of Path/Tiny.pm, avg 4µs/call
sub PerlIO::get_layers; # xsub
# spent 112µs within UNIVERSAL::VERSION which was called 11 times, avg 10µs/call: # once (18µs+0s) by IO::CaptureOutput::_proxy::BEGIN@138 at line 138 of IO/CaptureOutput.pm # once (17µs+0s) by Path::Tiny::_check_UU at line 46 of Path/Tiny.pm # once (16µs+0s) by Encode::BEGIN@15 at line 15 of Encode.pm # once (12µs+0s) by Path::Tiny::BEGIN@13 at line 13 of Path/Tiny.pm # once (10µs+0s) by YAML::XS::BEGIN@21 at line 24 of Scalar/Util.pm # once (8µs+0s) by File::Temp::BEGIN@31 at line 31 of File/Temp.pm # once (8µs+0s) by File::Temp::BEGIN@11 at line 11 of File/Temp.pm # once (6µs+0s) by Path::Tiny::BEGIN@12 at line 12 of Path/Tiny.pm # once (6µs+0s) by File::Temp::BEGIN@13 at line 13 of File/Temp.pm # once (6µs+0s) by File::Temp::BEGIN@43 at line 43 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.26s within UNIVERSAL::isa which was called 773612 times, avg 2µs/call: # 383161 times (1.06s+0s) by Template::Context::template at line 87 of Template/Context.pm, avg 3µs/call # 383161 times (186ms+0s) by Template::Context::process at line 339 of Template/Context.pm, avg 486ns/call # 1991 times (2.67ms+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.31ms+0s) by Template::Document::__ANON__[input text:43] at line 17 of /root/tor-browser-build/input text, avg 660ns/call # 1013 times (2.66ms+0s) by Template::Context::process at line 331 of Template/Context.pm, avg 3µs/call # 1013 times (786µs+0s) by Template::Context::process at line 373 of Template/Context.pm, avg 776ns/call # 993 times (1.54ms+0s) by Template::Document::__ANON__[input text:35] at line 15 of /root/tor-browser-build/input text, avg 2µs/call # 273 times (415µs+0s) by Template::Document::__ANON__[input text:35] at line 27 of /root/tor-browser-build/input text, avg 2µs/call # 13 times (23µs+0s) by base::import at line 94 of base.pm, avg 2µs/call # once (11µ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 (900ns+0s) by Getopt::Long::GetOptionsFromArray at line 475 of Getopt/Long.pm
sub UNIVERSAL::isa; # xsub
# spent 700ns within main::CORE:subst which was called: # once (700ns+0s) by main::set_options at line 107
sub main::CORE:subst; # opcode
# spent 2µs within main::__ANON__ which was called: # once (2µs+0s) by main::BEGIN@6 at line 6
sub main::__ANON__; # xsub
# spent 50µs within mro::method_changed_in which was called 81 times, avg 617ns/call: # 81 times (50µs+0s) by constant::import at line 198 of constant.pm, avg 617ns/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