← Index
NYTProf Performance Profile   « line view »
For /usr/sbin/pkg_info
  Run on Fri Aug 4 10:15:59 2017
Reported on Fri Aug 4 10:16:18 2017

Filename/usr/sbin/pkg_info
StatementsExecuted 16 statements in 3.13ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1113.46ms12.0smain::::run main::run
1112.52ms2.55msmain::::BEGIN@20 main::BEGIN@20
111538µs706µsmain::::BEGIN@19 main::BEGIN@19
133115µs15µsInternals::::SvREADONLYInternals::SvREADONLY (xsub)
6118µs8µsmro::::method_changed_in mro::method_changed_in (xsub)
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
02100µsProfile 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
116µ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
192315µs2718µs
# spent 706µs (538+168) within main::BEGIN@19 which was called: # once (538µs+168µs) by main::NULL at line 19
use strict;
# spent 706µs making 1 call to main::BEGIN@19 # spent 12µs making 1 call to strict::import
2022.53ms22.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
use warnings;
# spent 2.55ms making 1 call to main::BEGIN@20 # spent 26µs making 1 call to warnings::import
21
22sub 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
{
2411µs my ($cmd, $m) = @_;
2512µs my $module = "OpenBSD::$m";
26127µs eval "require $module";
# spent 111µs executing statements in string eval
2711µs if ($@) {
28 die $@;
29 }
301109µs112.0s exit($module->parse_and_run($cmd));
# spent 12.0s making 1 call to OpenBSD::PkgInfo::parse_and_run
31}
32
3315µsmy $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
4312µsmy @l = qw(add check create delete info sign);
44
45120µswhile (my ($cmd, $module) = each %$choices) {
464114µs912.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
52run($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
sub Internals::SvREADONLY; # xsub
# 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
sub mro::method_changed_in; # xsub