Filename | /home/micha/.plenv/versions/5.38.2/lib/perl5/site_perl/5.38.2/Test2/EventFacet/Trace.pm |
Statements | Executed 38 statements in 584µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 187µs | 1.51ms | BEGIN@7 | Test2::EventFacet::Trace::
1 | 1 | 1 | 10µs | 11µs | BEGIN@2 | Test2::EventFacet::Trace::
3 | 1 | 1 | 9µs | 9µs | init | Test2::EventFacet::Trace::
1 | 1 | 1 | 7µs | 24µs | BEGIN@3 | Test2::EventFacet::Trace::
1 | 1 | 1 | 5µs | 117µs | BEGIN@13 | Test2::EventFacet::Trace::
1 | 1 | 1 | 4µs | 16µs | BEGIN@16 | Test2::EventFacet::Trace::
1 | 1 | 1 | 4µs | 24µs | BEGIN@9 | Test2::EventFacet::Trace::
1 | 1 | 1 | 4µs | 44µs | BEGIN@10 | Test2::EventFacet::Trace::
1 | 1 | 1 | 4µs | 17µs | BEGIN@11 | Test2::EventFacet::Trace::
1 | 1 | 1 | 3µs | 3µs | snapshot | Test2::EventFacet::Trace::
1 | 1 | 1 | 2µs | 2µs | call | Test2::EventFacet::Trace::
0 | 0 | 0 | 0s | 0s | alert | Test2::EventFacet::Trace::
0 | 0 | 0 | 0s | 0s | debug | Test2::EventFacet::Trace::
0 | 0 | 0 | 0s | 0s | file | Test2::EventFacet::Trace::
0 | 0 | 0 | 0s | 0s | full_call | Test2::EventFacet::Trace::
0 | 0 | 0 | 0s | 0s | line | Test2::EventFacet::Trace::
0 | 0 | 0 | 0s | 0s | package | Test2::EventFacet::Trace::
0 | 0 | 0 | 0s | 0s | signature | Test2::EventFacet::Trace::
0 | 0 | 0 | 0s | 0s | subname | Test2::EventFacet::Trace::
0 | 0 | 0 | 0s | 0s | throw | Test2::EventFacet::Trace::
0 | 0 | 0 | 0s | 0s | warning_bits | Test2::EventFacet::Trace::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Test2::EventFacet::Trace; | ||||
2 | 2 | 18µs | 2 | 13µs | # spent 11µs (10+2) within Test2::EventFacet::Trace::BEGIN@2 which was called:
# once (10µs+2µs) by Test2::API::Instance::BEGIN@13 at line 2 # spent 11µs making 1 call to Test2::EventFacet::Trace::BEGIN@2
# spent 2µs making 1 call to strict::import |
3 | 2 | 33µs | 2 | 40µs | # spent 24µs (7+17) within Test2::EventFacet::Trace::BEGIN@3 which was called:
# once (7µs+17µs) by Test2::API::Instance::BEGIN@13 at line 3 # spent 24µs making 1 call to Test2::EventFacet::Trace::BEGIN@3
# spent 17µs making 1 call to warnings::import |
4 | |||||
5 | 1 | 400ns | our $VERSION = '1.302198'; | ||
6 | |||||
7 | 2 | 79µs | 1 | 1.51ms | # spent 1.51ms (187µs+1.32) within Test2::EventFacet::Trace::BEGIN@7 which was called:
# once (187µs+1.32ms) by Test2::API::Instance::BEGIN@13 at line 7 # spent 1.51ms making 1 call to Test2::EventFacet::Trace::BEGIN@7 |
8 | |||||
9 | 2 | 17µs | 2 | 44µs | # spent 24µs (4+20) within Test2::EventFacet::Trace::BEGIN@9 which was called:
# once (4µs+20µs) by Test2::API::Instance::BEGIN@13 at line 9 # spent 24µs making 1 call to Test2::EventFacet::Trace::BEGIN@9
# spent 20µs making 1 call to Exporter::import |
10 | 2 | 18µs | 2 | 85µs | # spent 44µs (4+40) within Test2::EventFacet::Trace::BEGIN@10 which was called:
# once (4µs+40µs) by Test2::API::Instance::BEGIN@13 at line 10 # spent 44µs making 1 call to Test2::EventFacet::Trace::BEGIN@10
# spent 40µs making 1 call to Time::HiRes::import |
11 | 2 | 18µs | 2 | 30µs | # spent 17µs (4+13) within Test2::EventFacet::Trace::BEGIN@11 which was called:
# once (4µs+13µs) by Test2::API::Instance::BEGIN@13 at line 11 # spent 17µs making 1 call to Test2::EventFacet::Trace::BEGIN@11
# spent 13µs making 1 call to Exporter::import |
12 | |||||
13 | 2 | 23µs | 2 | 229µs | # spent 117µs (5+112) within Test2::EventFacet::Trace::BEGIN@13 which was called:
# once (5µs+112µs) by Test2::API::Instance::BEGIN@13 at line 13 # spent 117µs making 1 call to Test2::EventFacet::Trace::BEGIN@13
# spent 112µs making 1 call to Test2::Util::HashBase::import |
14 | |||||
15 | { | ||||
16 | 3 | 356µs | 2 | 29µs | # spent 16µs (4+12) within Test2::EventFacet::Trace::BEGIN@16 which was called:
# once (4µs+12µs) by Test2::API::Instance::BEGIN@13 at line 16 # spent 16µs making 1 call to Test2::EventFacet::Trace::BEGIN@16
# spent 12µs making 1 call to warnings::unimport |
17 | 1 | 900ns | *DETAIL = \&DETAILS; | ||
18 | 1 | 200ns | *detail = \&details; | ||
19 | 1 | 300ns | *set_detail = \&set_details; | ||
20 | } | ||||
21 | |||||
22 | # spent 9µs within Test2::EventFacet::Trace::init which was called 3 times, avg 3µs/call:
# 3 times (9µs+0s) by Test2::Util::HashBase::_new at line 155 of Test2/Util/HashBase.pm, avg 3µs/call | ||||
23 | confess "The 'frame' attribute is required" | ||||
24 | 3 | 700ns | unless $_[0]->{+FRAME}; | ||
25 | |||||
26 | 3 | 2µs | $_[0]->{+DETAILS} = delete $_[0]->{detail} if $_[0]->{detail}; | ||
27 | |||||
28 | 3 | 5µs | unless (defined($_[0]->{+PID}) || defined($_[0]->{+TID}) || defined($_[0]->{+CID})) { | ||
29 | 2 | 2µs | $_[0]->{+PID} = $$ unless defined $_[0]->{+PID}; | ||
30 | 2 | 900ns | $_[0]->{+TID} = get_tid() unless defined $_[0]->{+TID}; | ||
31 | } | ||||
32 | } | ||||
33 | |||||
34 | # spent 3µs within Test2::EventFacet::Trace::snapshot which was called:
# once (3µs+0s) by Test2::API::Context::send_ev2 at line 223 of Test2/API/Context.pm | ||||
35 | 1 | 400ns | my ($orig, @override) = @_; | ||
36 | 1 | 3µs | bless {%$orig, @override}, __PACKAGE__; | ||
37 | } | ||||
38 | |||||
39 | sub signature { | ||||
40 | my $self = shift; | ||||
41 | |||||
42 | # Signature is only valid if all of these fields are defined, there is no | ||||
43 | # signature if any is missing. '0' is ok, but '' is not. | ||||
44 | return join ':' => map { (defined($_) && length($_)) ? $_ : return undef } ( | ||||
45 | $self->{+CID}, | ||||
46 | $self->{+PID}, | ||||
47 | $self->{+TID}, | ||||
48 | $self->{+FRAME}->[1], | ||||
49 | $self->{+FRAME}->[2], | ||||
50 | ); | ||||
51 | } | ||||
52 | |||||
53 | sub debug { | ||||
54 | my $self = shift; | ||||
55 | return $self->{+DETAILS} if $self->{+DETAILS}; | ||||
56 | my ($pkg, $file, $line) = $self->call; | ||||
57 | return "at $file line $line"; | ||||
58 | } | ||||
59 | |||||
60 | sub alert { | ||||
61 | my $self = shift; | ||||
62 | my ($msg) = @_; | ||||
63 | warn $msg . ' ' . $self->debug . ".\n"; | ||||
64 | } | ||||
65 | |||||
66 | sub throw { | ||||
67 | my $self = shift; | ||||
68 | my ($msg) = @_; | ||||
69 | die $msg . ' ' . $self->debug . ".\n"; | ||||
70 | } | ||||
71 | |||||
72 | 1 | 3µs | # spent 2µs within Test2::EventFacet::Trace::call which was called:
# once (2µs+0s) by Test::Builder::done_testing at line 595 of Test/Builder.pm | ||
73 | |||||
74 | sub full_call { @{$_[0]->{+FULL_CALLER}} } | ||||
75 | |||||
76 | sub package { $_[0]->{+FRAME}->[0] } | ||||
77 | sub file { $_[0]->{+FRAME}->[1] } | ||||
78 | sub line { $_[0]->{+FRAME}->[2] } | ||||
79 | sub subname { $_[0]->{+FRAME}->[3] } | ||||
80 | |||||
81 | sub warning_bits { $_[0]->{+FULL_CALLER} ? $_[0]->{+FULL_CALLER}->[9] : undef } | ||||
82 | |||||
83 | 1 | 3µs | 1; | ||
84 | |||||
85 | __END__ |