Filename | /root/tor-browser-build/rbm/rbm |
Statements | Executed 37 statements in 2.86ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
758064 | 12 | 5 | 1.21s | 1.21s | isa (xsub) | UNIVERSAL::
1 | 1 | 1 | 10.2ms | 111ms | BEGIN@6 | main::
1 | 1 | 1 | 8.51ms | 9.67ms | BEGIN@8 | main::
1 | 1 | 1 | 1.92ms | 4.71ms | BEGIN@4 | main::
1 | 1 | 1 | 508µs | 1.32ms | BEGIN@5 | main::
1 | 1 | 1 | 441µs | 478µs | BEGIN@3 | main::
11 | 11 | 5 | 129µs | 129µs | VERSION (xsub) | UNIVERSAL::
32 | 1 | 1 | 121µs | 121µs | get_layers (xsub) | PerlIO::
1 | 1 | 1 | 53µs | 58.4ms | set_options | main::
81 | 1 | 1 | 53µs | 53µs | method_changed_in (xsub) | mro::
89 | 3 | 1 | 50µs | 50µs | SvREADONLY (xsub) | Internals::
1 | 1 | 1 | 32µs | 33µs | O_NOINHERIT | Fcntl::
1 | 1 | 1 | 27µs | 1692s | build_script | main::
1 | 1 | 1 | 15µs | 1692s | __ANON__[rbm/rbm:45] | main::
13 | 1 | 1 | 15µs | 15µs | encode (xsub) | utf8::
1 | 1 | 1 | 12µs | 13µs | O_EXLOCK | Fcntl::
1 | 1 | 1 | 12µs | 12µs | O_TEMPORARY | Fcntl::
1 | 1 | 1 | 11µs | 67µs | BEGIN@7 | main::
1 | 1 | 1 | 4µs | 4µs | (bool (xsub) | version::
1 | 1 | 1 | 3µs | 3µs | (cmp (xsub) | version::
0 | 0 | 0 | 0s | 0s | __ANON__[rbm/rbm:29] | main::
0 | 0 | 0 | 0s | 0s | __ANON__[rbm/rbm:33] | main::
0 | 0 | 0 | 0s | 0s | __ANON__[rbm/rbm:37] | main::
0 | 0 | 0 | 0s | 0s | __ANON__[rbm/rbm:41] | main::
0 | 0 | 0 | 0s | 0s | fetch | main::
0 | 0 | 0 | 0s | 0s | pkg | main::
0 | 0 | 0 | 0s | 0s | print_projects | main::
0 | 0 | 0 | 0s | 0s | publish | main::
0 | 0 | 0 | 0s | 0s | rpmspec | main::
0 | 0 | 0 | 0s | 0s | show_conf | main::
0 | 0 | 0 | 0s | 0s | tar | main::
0 | 0 | 0 | 0s | 0s | usage | main::
0 | 0 | 0 | 0s | 0s | usageexit | main::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
0 | 1 | 69µs | Profile data that couldn't be associated with a specific line: # spent 69µs making 1 call to File::Temp::END | ||
1 | 1 | 29µs | #!/usr/bin/perl -w | ||
2 | |||||
3 | 2 | 259µs | 2 | 481µs | # spent 478µs (441+37) within main::BEGIN@3 which was called:
# once (441µs+37µs) by main::NULL at line 3 # spent 478µs making 1 call to main::BEGIN@3
# spent 3µs making 1 call to strict::import |
4 | 2 | 133µs | 2 | 4.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 # spent 4.71ms making 1 call to main::BEGIN@4
# spent 33µs making 1 call to Exporter::import |
5 | 2 | 97µs | 3 | 1.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 # 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 |
6 | 2 | 175µs | 2 | 111ms | # spent 111ms (10.2+101) within main::BEGIN@6 which was called:
# once (10.2ms+101ms) by main::NULL at line 6 # spent 111ms making 1 call to main::BEGIN@6
# spent 2µs making 1 call to main::__ANON__ |
7 | 2 | 28µs | 2 | 123µs | # spent 67µs (11+56) within main::BEGIN@7 which was called:
# once (11µs+56µs) by main::NULL at line 7 # spent 67µs making 1 call to main::BEGIN@7
# spent 56µs making 1 call to Exporter::import |
8 | 2 | 1.86ms | 2 | 9.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 # 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 | |||||
11 | my %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 => { | ||||
45 | 1 | 141µs | 1 | 1692s | # spent 1692s (15µs+1692) within main::__ANON__[rbm/rbm:45] which was called:
# once (15µs+1692s) by main::RUNTIME at line 204 # spent 1692s making 1 call to main::build_script |
46 | 1 | 20µ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 | |||||
71 | sub 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 | } | ||||
84 | sub 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 | ||||
92 | 1 | 12µ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); | ||||
99 | 1 | 300ns | my %val; | ||
100 | 1 | 7µs | 1 | 1.00ms | Getopt::Long::GetOptionsFromArray(\@_, \%val, @options) || exit 1; # spent 1.00ms making 1 call to Getopt::Long::GetOptionsFromArray |
101 | 1 | 1µs | foreach my $k (keys %val) { | ||
102 | 1 | 300ns | if ($k eq 'step') { | ||
103 | $RBM::config->{step} = $val{$k}; | ||||
104 | next; | ||||
105 | } | ||||
106 | 1 | 500ns | my $l = $k; | ||
107 | 1 | 6µs | 1 | 700ns | $l =~ s/-/_/g; # spent 700ns making 1 call to main::CORE:subst |
108 | 1 | 2µs | $RBM::config->{run}{$l} = $val{$k}; | ||
109 | } | ||||
110 | 1 | 5µs | 1 | 52.0ms | RBM::load_system_config(@_); # spent 52.0ms making 1 call to RBM::load_system_config |
111 | 1 | 4µs | 1 | 5.36ms | RBM::load_local_config(@_); # spent 5.36ms making 1 call to RBM::load_local_config |
112 | 1 | 15µs | return $RBM::config->{run}{args} = \@_; | ||
113 | } | ||||
114 | |||||
115 | sub 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 | |||||
131 | sub 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 | |||||
150 | sub 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 | |||||
158 | sub 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 | |||||
166 | sub 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 | ||||
172 | 1 | 1µs | my $script_name = shift; | ||
173 | 1 | 800ns | usageexit($_[0]) unless @_ >= 2; | ||
174 | 1 | 400ns | my $cmd = shift; | ||
175 | 1 | 7µs | 1 | 58.4ms | my $args = set_options(@_); # spent 58.4ms making 1 call to main::set_options |
176 | 1 | 2µs | usageexit($cmd) unless @$args == 1; | ||
177 | 1 | 2µs | $script_name = $RBM::config->{step} if $RBM::config->{step} ne 'rbm_init'; | ||
178 | 1 | 20µs | 1 | 1692s | RBM::build_pkg($args->[0], { pkg_type => $script_name }); # spent 1692s making 1 call to RBM::build_pkg |
179 | } | ||||
180 | |||||
181 | sub 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 | |||||
189 | sub 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 | |||||
197 | 1 | 1µs | if (@ARGV == 0 || !$actions{$ARGV[0]}) { | ||
198 | usage(); | ||||
199 | exit 1; | ||||
200 | } | ||||
201 | 1 | 3µs | usage('usage', $ARGV[0]) if grep { $_ eq '--help' } @ARGV[1..(@ARGV - 1)]; | ||
202 | 1 | 17µs | 1 | 20.9ms | RBM::load_config unless $actions{$ARGV[0]}->{no_config}; # spent 20.9ms making 1 call to RBM::load_config |
203 | 1 | 7µs | 1 | 51µs | RBM::set_default_env unless $actions{$ARGV[0]}->{no_config}; # spent 51µs making 1 call to RBM::set_default_env |
204 | 1 | 6µs | 1 | 1692s | $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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# spent 4µs within version::(bool which was called:
# once (4µs+0s) by lib::BEGIN@6 at line 59 of Config.pm | |||||
# spent 3µs within version::(cmp which was called:
# once (3µs+0s) by lib::BEGIN@6 at line 62 of Config.pm |