| Filename | /usr/sbin/pkg_info |
| Statements | Executed 16 statements in 3.13ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 3.46ms | 12.0s | main::run |
| 1 | 1 | 1 | 2.52ms | 2.55ms | main::BEGIN@20 |
| 1 | 1 | 1 | 538µs | 706µs | main::BEGIN@19 |
| 13 | 3 | 1 | 15µs | 15µs | Internals::SvREADONLY (xsub) |
| 6 | 1 | 1 | 8µs | 8µs | mro::method_changed_in (xsub) |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 0 | 2 | 100µs | Profile data that couldn't be associated with a specific line: # spent 73µs making 1 call to OpenBSD::PackageRepository::END
# spent 26µs making 1 call to OpenBSD::Temp::END | ||
| 1 | 1 | 6µs | #! /usr/bin/perl | ||
| 2 | # ex:ts=8 sw=4: | ||||
| 3 | # $OpenBSD: pkg_add,v 1.483 2014/12/27 23:59:44 espie Exp $ | ||||
| 4 | # | ||||
| 5 | # Copyright (c) 2010 Marc Espie <espie@openbsd.org> | ||||
| 6 | # | ||||
| 7 | # Permission to use, copy, modify, and distribute this software for any | ||||
| 8 | # purpose with or without fee is hereby granted, provided that the above | ||||
| 9 | # copyright notice and this permission notice appear in all copies. | ||||
| 10 | # | ||||
| 11 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||||
| 12 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||||
| 13 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||||
| 14 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||||
| 15 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||||
| 16 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||||
| 17 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||||
| 18 | |||||
| 19 | 2 | 315µs | 2 | 718µs | # spent 706µs (538+168) within main::BEGIN@19 which was called:
# once (538µs+168µs) by main::NULL at line 19 # spent 706µs making 1 call to main::BEGIN@19
# spent 12µs making 1 call to strict::import |
| 20 | 2 | 2.53ms | 2 | 2.57ms | # spent 2.55ms (2.52+30µs) within main::BEGIN@20 which was called:
# once (2.52ms+30µs) by main::NULL at line 20 # spent 2.55ms making 1 call to main::BEGIN@20
# spent 26µs making 1 call to warnings::import |
| 21 | |||||
| 22 | sub run | ||||
| 23 | # spent 12.0s (3.46ms+12.0) within main::run which was called:
# once (3.46ms+12.0s) by main::RUNTIME at line 46 | ||||
| 24 | 1 | 1µs | my ($cmd, $m) = @_; | ||
| 25 | 1 | 2µs | my $module = "OpenBSD::$m"; | ||
| 26 | 1 | 27µs | eval "require $module"; # spent 111µs executing statements in string eval | ||
| 27 | 1 | 1µs | if ($@) { | ||
| 28 | die $@; | ||||
| 29 | } | ||||
| 30 | 1 | 109µs | 1 | 12.0s | exit($module->parse_and_run($cmd)); # spent 12.0s making 1 call to OpenBSD::PkgInfo::parse_and_run |
| 31 | } | ||||
| 32 | |||||
| 33 | 1 | 5µs | my $choices = { | ||
| 34 | pkg_add => 'PkgAdd', | ||||
| 35 | pkg_check => 'PkgCheck', | ||||
| 36 | pkg_create => 'PkgCreate', | ||||
| 37 | pkg_delete => 'PkgDelete', | ||||
| 38 | pkg_info => 'PkgInfo', | ||||
| 39 | pkg_sign => 'PkgSign', | ||||
| 40 | fw_update => 'FwUpdate', | ||||
| 41 | }; | ||||
| 42 | |||||
| 43 | 1 | 2µs | my @l = qw(add check create delete info sign); | ||
| 44 | |||||
| 45 | 1 | 20µs | while (my ($cmd, $module) = each %$choices) { | ||
| 46 | 4 | 114µs | 9 | 12.0s | if ($0 =~ m/\/?\Q$cmd\E$/) { # spent 12.0s making 1 call to main::run
# spent 47µs making 4 calls to main::CORE:regcomp, avg 12µs/call
# spent 14µs making 4 calls to main::CORE:match, avg 3µs/call |
| 47 | run($cmd, $module); | ||||
| 48 | } | ||||
| 49 | } | ||||
| 50 | |||||
| 51 | # defaults to pkg_info personality but keeps the command name | ||||
| 52 | run($0, 'PkgInfo'); | ||||
# spent 15µs within Internals::SvREADONLY which was called 13 times, avg 1µs/call:
# 11 times (13µs+0s) by constant::import at line 164 of constant.pm, avg 1µs/call
# once (2µs+0s) by constant::BEGIN@24 at line 33 of constant.pm
# once (900ns+0s) by constant::BEGIN@24 at line 34 of constant.pm | |||||
# spent 8µs within mro::method_changed_in which was called 6 times, avg 1µs/call:
# 6 times (8µs+0s) by constant::import at line 198 of constant.pm, avg 1µs/call |