← Index
NYTProf Performance Profile   « line view »
For /usr/sbin/pkg_info
  Run on Fri Aug 4 10:12:01 2017
Reported on Fri Aug 4 10:12:17 2017

Filename/usr/sbin/pkg_info
StatementsExecuted 14 statements in 6.57ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1115.61ms5.70msmain::::BEGIN@20 main::BEGIN@20
1113.98ms2.14smain::::run main::run
1111.04ms1.33msmain::::BEGIN@19 main::BEGIN@19
11131176µs176µsInternals::::SvREADONLYInternals::SvREADONLY (xsub)
14146147µs147µsUNIVERSAL::::VERSIONUNIVERSAL::VERSION (xsub)
8311130µs130µsmro::::method_changed_in mro::method_changed_in (xsub)
4118µs8µsUNIVERSAL::::isaUNIVERSAL::isa (xsub)
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
02196µsProfile data that couldn't be associated with a specific line:
# spent 175µs making 1 call to OpenBSD::PackageRepository::END # spent 21µs making 1 call to OpenBSD::Temp::END
114µ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
192628µs21.35ms
# spent 1.33ms (1.04+286µs) within main::BEGIN@19 which was called: # once (1.04ms+286µs) by main::NULL at line 19
use strict;
# spent 1.33ms making 1 call to main::BEGIN@19 # spent 22µs making 1 call to strict::import
2025.56ms25.78ms
# spent 5.70ms (5.61+89µs) within main::BEGIN@20 which was called: # once (5.61ms+89µs) by main::NULL at line 20
use warnings;
# spent 5.70ms making 1 call to main::BEGIN@20 # spent 76µs making 1 call to warnings::import
21
22sub run
23
# spent 2.14s (3.98ms+2.13) within main::run which was called: # once (3.98ms+2.13s) by main::RUNTIME at line 46
{
2412µs my ($cmd, $m) = @_;
2513µs my $module = "OpenBSD::$m";
26148µs eval "require $module";
# spent 295µs executing statements in string eval
271800ns if ($@) {
28 die $@;
29 }
301128µs12.09s exit($module->parse_and_run($cmd));
# spent 2.09s making 1 call to OpenBSD::PkgInfo::parse_and_run
31}
32
3319µ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
4314µsmy @l = qw(add check create delete info sign);
44
45124µswhile (my ($cmd, $module) = each %$choices) {
462168µs52.14s if ($0 =~ m/\/?\Q$cmd\E$/) {
# spent 2.14s making 1 call to main::run # spent 66µs making 2 calls to main::CORE:regcomp, avg 33µs/call # spent 23µs making 2 calls to main::CORE:match, avg 12µs/call
47 run($cmd, $module);
48 }
49}
50
51# defaults to pkg_info personality but keeps the command name
52run($0, 'PkgInfo');
 
# spent 176µs within Internals::SvREADONLY which was called 111 times, avg 2µs/call: # 109 times (172µs+0s) by constant::import at line 164 of constant.pm, avg 2µs/call # once (3µs+0s) by constant::BEGIN@24 at line 33 of constant.pm # once (1µs+0s) by constant::BEGIN@24 at line 34 of constant.pm
sub Internals::SvREADONLY; # xsub
# spent 147µs within UNIVERSAL::VERSION which was called 14 times, avg 11µs/call: # once (26µs+0s) by IO::Uncompress::RawInflate::BEGIN@8 at line 8 of IO/Uncompress/RawInflate.pm # once (15µs+0s) by IO::Compress::Base::Common::BEGIN@8 at line 23 of Scalar/Util.pm # once (12µs+0s) by IO::Uncompress::RawInflate::BEGIN@9 at line 9 of IO/Uncompress/RawInflate.pm # once (11µs+0s) by IO::Compress::Zlib::Extra::BEGIN@13 at line 13 of IO/Compress/Zlib/Extra.pm # once (10µs+0s) by IO::Uncompress::Base::BEGIN@17 at line 17 of IO/Uncompress/Base.pm # once (10µs+0s) by IO::Uncompress::RawInflate::BEGIN@11 at line 11 of IO/Uncompress/RawInflate.pm # once (9µs+0s) by IO::Uncompress::RawInflate::BEGIN@12 at line 12 of IO/Uncompress/RawInflate.pm # once (9µs+0s) by IO::Uncompress::Adapter::Inflate::BEGIN@7 at line 7 of IO/Uncompress/Adapter/Inflate.pm # once (9µs+0s) by IO::Uncompress::Gunzip::BEGIN@16 at line 16 of IO/Uncompress/Gunzip.pm # once (8µs+0s) by IO::Uncompress::Adapter::Inflate::BEGIN@8 at line 8 of IO/Uncompress/Adapter/Inflate.pm # once (8µs+0s) by IO::Uncompress::Gunzip::BEGIN@12 at line 12 of IO/Uncompress/Gunzip.pm # once (8µs+0s) by IO::Uncompress::Gunzip::BEGIN@17 at line 17 of IO/Uncompress/Gunzip.pm # once (7µs+0s) by IO::Uncompress::Gunzip::BEGIN@14 at line 14 of IO/Uncompress/Gunzip.pm # once (6µs+0s) by IO::Uncompress::Gunzip::BEGIN@15 at line 15 of IO/Uncompress/Gunzip.pm
sub UNIVERSAL::VERSION; # xsub
# spent 8µs within UNIVERSAL::isa which was called 4 times, avg 2µs/call: # 4 times (8µs+0s) by IO::Compress::Base::Common::isaFilehandle at line 115 of IO/Compress/Base/Common.pm, avg 2µs/call
sub UNIVERSAL::isa; # xsub
# spent 130µs within mro::method_changed_in which was called 83 times, avg 2µs/call: # 83 times (130µs+0s) by constant::import at line 198 of constant.pm, avg 2µs/call
sub mro::method_changed_in; # xsub