| Filename | /root/tor-browser-build/rbm/rbm |
| Statements | Executed 37 statements in 3.58ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 773612 | 12 | 5 | 1.26s | 1.26s | UNIVERSAL::isa (xsub) |
| 1 | 1 | 1 | 9.28ms | 136ms | main::BEGIN@6 |
| 1 | 1 | 1 | 8.13ms | 9.18ms | main::BEGIN@8 |
| 1 | 1 | 1 | 1.91ms | 4.79ms | main::BEGIN@4 |
| 1 | 1 | 1 | 1.37ms | 2.27ms | main::BEGIN@5 |
| 1 | 1 | 1 | 436µs | 476µs | main::BEGIN@3 |
| 32 | 1 | 1 | 113µs | 113µs | PerlIO::get_layers (xsub) |
| 11 | 11 | 5 | 112µs | 112µs | UNIVERSAL::VERSION (xsub) |
| 1 | 1 | 1 | 53µs | 63.0ms | main::set_options |
| 81 | 1 | 1 | 50µs | 50µs | mro::method_changed_in (xsub) |
| 89 | 3 | 1 | 49µs | 49µs | Internals::SvREADONLY (xsub) |
| 1 | 1 | 1 | 35µs | 36µs | Fcntl::O_NOINHERIT |
| 1 | 1 | 1 | 24µs | 2205s | main::build_script |
| 1 | 1 | 1 | 16µs | 2205s | main::__ANON__[rbm/rbm:45] |
| 13 | 1 | 1 | 15µs | 15µs | utf8::encode (xsub) |
| 1 | 1 | 1 | 12µs | 12µs | Fcntl::O_EXLOCK |
| 1 | 1 | 1 | 12µs | 61µs | main::BEGIN@7 |
| 1 | 1 | 1 | 11µs | 12µs | Fcntl::O_TEMPORARY |
| 1 | 1 | 1 | 4µs | 4µs | version::(bool (xsub) |
| 1 | 1 | 1 | 3µs | 3µs | version::(cmp (xsub) |
| 1 | 1 | 1 | 2µs | 2µs | main::__ANON__ (xsub) |
| 1 | 1 | 1 | 700ns | 700ns | main::CORE:subst (opcode) |
| 0 | 0 | 0 | 0s | 0s | main::RUNTIME |
| 0 | 0 | 0 | 0s | 0s | main::__ANON__[rbm/rbm:29] |
| 0 | 0 | 0 | 0s | 0s | main::__ANON__[rbm/rbm:33] |
| 0 | 0 | 0 | 0s | 0s | main::__ANON__[rbm/rbm:37] |
| 0 | 0 | 0 | 0s | 0s | main::__ANON__[rbm/rbm:41] |
| 0 | 0 | 0 | 0s | 0s | main::fetch |
| 0 | 0 | 0 | 0s | 0s | main::pkg |
| 0 | 0 | 0 | 0s | 0s | main::print_projects |
| 0 | 0 | 0 | 0s | 0s | main::publish |
| 0 | 0 | 0 | 0s | 0s | main::rpmspec |
| 0 | 0 | 0 | 0s | 0s | main::show_conf |
| 0 | 0 | 0 | 0s | 0s | main::tar |
| 0 | 0 | 0 | 0s | 0s | main::usage |
| 0 | 0 | 0 | 0s | 0s | main::usageexit |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 0 | 1 | 70µs | Profile data that couldn't be associated with a specific line: # spent 70µs making 1 call to File::Temp::END | ||
| 1 | 1 | 29µs | #!/usr/bin/perl -w | ||
| 2 | |||||
| 3 | 2 | 268µs | 2 | 479µs | # spent 476µs (436+40) within main::BEGIN@3 which was called:
# once (436µs+40µs) by main::NULL at line 3 # spent 476µs making 1 call to main::BEGIN@3
# spent 3µs making 1 call to strict::import |
| 4 | 2 | 131µs | 2 | 4.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 # spent 4.79ms making 1 call to main::BEGIN@4
# spent 33µs making 1 call to Exporter::import |
| 5 | 2 | 952µs | 3 | 2.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 # 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 |
| 6 | 2 | 128µs | 2 | 136ms | # spent 136ms (9.28+127) within main::BEGIN@6 which was called:
# once (9.28ms+127ms) by main::NULL at line 6 # spent 136ms making 1 call to main::BEGIN@6
# spent 2µs making 1 call to main::__ANON__ |
| 7 | 2 | 30µs | 2 | 110µs | # spent 61µs (12+49) within main::BEGIN@7 which was called:
# once (12µs+49µs) by main::NULL at line 7 # spent 61µs making 1 call to main::BEGIN@7
# spent 49µs making 1 call to Exporter::import |
| 8 | 2 | 1.88ms | 2 | 9.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 # 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 | |||||
| 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 | 20µs | 1 | 2205s | # spent 2205s (16µs+2205) within main::__ANON__[rbm/rbm:45] which was called:
# once (16µs+2205s) by main::RUNTIME at line 204 # spent 2205s making 1 call to main::build_script |
| 46 | 1 | 22µ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 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 | ||||
| 92 | 1 | 11µ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 | 2µs | foreach my $k (keys %val) { | ||
| 102 | 1 | 600ns | 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 | 4µs | 1 | 57.1ms | RBM::load_system_config(@_); # spent 57.1ms making 1 call to RBM::load_system_config |
| 111 | 1 | 4µs | 1 | 4.81ms | RBM::load_local_config(@_); # spent 4.81ms making 1 call to RBM::load_local_config |
| 112 | 1 | 17µ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 2205s (24µs+2205) within main::build_script which was called:
# once (24µs+2205s) by main::__ANON__[rbm/rbm:45] at line 45 | ||||
| 172 | 1 | 600ns | my $script_name = shift; | ||
| 173 | 1 | 800ns | usageexit($_[0]) unless @_ >= 2; | ||
| 174 | 1 | 500ns | my $cmd = shift; | ||
| 175 | 1 | 6µs | 1 | 63.0ms | my $args = set_options(@_); # spent 63.0ms making 1 call to main::set_options |
| 176 | 1 | 900ns | usageexit($cmd) unless @$args == 1; | ||
| 177 | 1 | 900ns | $script_name = $RBM::config->{step} if $RBM::config->{step} ne 'rbm_init'; | ||
| 178 | 1 | 19µs | 1 | 2205s | RBM::build_pkg($args->[0], { pkg_type => $script_name }); # spent 2205s 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 | 2µs | usage('usage', $ARGV[0]) if grep { $_ eq '--help' } @ARGV[1..(@ARGV - 1)]; | ||
| 202 | 1 | 19µs | 1 | 55.4ms | RBM::load_config unless $actions{$ARGV[0]}->{no_config}; # spent 55.4ms making 1 call to RBM::load_config |
| 203 | 1 | 7µs | 1 | 57µs | RBM::set_default_env unless $actions{$ARGV[0]}->{no_config}; # spent 57µs making 1 call to RBM::set_default_env |
| 204 | 1 | 6µs | 1 | 2205s | $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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# spent 700ns within main::CORE:subst which was called:
# once (700ns+0s) by main::set_options at line 107 | |||||
# spent 2µs within main::__ANON__ which was called:
# once (2µs+0s) by main::BEGIN@6 at line 6 | |||||
# 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 | |||||
# 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 |