line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::EventFacet::Trace; |
2
|
246
|
|
|
246
|
|
1640
|
use strict; |
|
246
|
|
|
|
|
508
|
|
|
246
|
|
|
|
|
7088
|
|
3
|
246
|
|
|
246
|
|
1243
|
use warnings; |
|
246
|
|
|
|
|
432
|
|
|
246
|
|
|
|
|
14303
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.302180'; |
6
|
|
|
|
|
|
|
|
7
|
246
|
|
|
246
|
|
97481
|
BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) } |
|
246
|
|
|
|
|
10600
|
|
8
|
|
|
|
|
|
|
|
9
|
246
|
|
|
246
|
|
1713
|
use Test2::Util qw/get_tid pkg_to_file gen_uid/; |
|
246
|
|
|
|
|
1945
|
|
|
246
|
|
|
|
|
12597
|
|
10
|
246
|
|
|
246
|
|
1456
|
use Carp qw/confess/; |
|
246
|
|
|
|
|
504
|
|
|
246
|
|
|
|
|
12643
|
|
11
|
|
|
|
|
|
|
|
12
|
246
|
|
|
246
|
|
1609
|
use Test2::Util::HashBase qw{^frame ^pid ^tid ^cid -hid -nested details -buffered -uuid -huuid
|
|
246
|
|
|
|
|
531
|
|
|
246
|
|
|
|
|
1201
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
{ |
15
|
246
|
|
|
246
|
|
2073
|
no warnings 'once'; |
|
246
|
|
|
|
|
757
|
|
|
246
|
|
|
|
|
177558
|
|
16
|
|
|
|
|
|
|
*DETAIL = \&DETAILS; |
17
|
|
|
|
|
|
|
*detail = \&details; |
18
|
|
|
|
|
|
|
*set_detail = \&set_details; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub init { |
22
|
|
|
|
|
|
|
confess "The 'frame' attribute is required" |
23
|
906
|
100
|
|
906
|
0
|
3391
|
unless $_[0]->{+FRAME}; |
24
|
|
|
|
|
|
|
|
25
|
904
|
100
|
|
|
|
3084
|
$_[0]->{+DETAILS} = delete $_[0]->{detail} if $_[0]->{detail}; |
26
|
|
|
|
|
|
|
|
27
|
904
|
50
|
66
|
|
|
6036
|
unless (defined($_[0]->{+PID}) || defined($_[0]->{+TID}) || defined($_[0]->{+CID})) { |
|
|
|
66
|
|
|
|
|
28
|
576
|
50
|
|
|
|
2453
|
$_[0]->{+PID} = $$ unless defined $_[0]->{+PID}; |
29
|
576
|
50
|
|
|
|
2777
|
$_[0]->{+TID} = get_tid() unless defined $_[0]->{+TID}; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub snapshot { |
34
|
1819
|
|
|
1819
|
0
|
4518
|
my ($orig, @override) = @_; |
35
|
1819
|
|
|
|
|
26758
|
bless {%$orig, @override}, __PACKAGE__; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub signature { |
39
|
50
|
|
|
50
|
1
|
88
|
my $self = shift; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# Signature is only valid if all of these fields are defined, there is no |
42
|
|
|
|
|
|
|
# signature if any is missing. '0' is ok, but '' is not. |
43
|
238
|
100
|
66
|
|
|
1099
|
return join ':' => map { (defined($_) && length($_)) ? $_ : return undef } ( |
44
|
|
|
|
|
|
|
$self->{+CID}, |
45
|
|
|
|
|
|
|
$self->{+PID}, |
46
|
|
|
|
|
|
|
$self->{+TID}, |
47
|
|
|
|
|
|
|
$self->{+FRAME}->[1], |
48
|
50
|
|
|
|
|
126
|
$self->{+FRAME}->[2], |
49
|
|
|
|
|
|
|
); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub debug { |
53
|
54
|
|
|
54
|
1
|
136
|
my $self = shift; |
54
|
54
|
100
|
|
|
|
240
|
return $self->{+DETAILS} if $self->{+DETAILS}; |
55
|
52
|
|
|
|
|
171
|
my ($pkg, $file, $line) = $self->call; |
56
|
52
|
|
|
|
|
423
|
return "at $file line $line"; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub alert { |
60
|
6
|
|
|
6
|
1
|
27
|
my $self = shift; |
61
|
6
|
|
|
|
|
19
|
my ($msg) = @_; |
62
|
6
|
|
|
|
|
32
|
warn $msg . ' ' . $self->debug . ".\n"; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub throw { |
66
|
25
|
|
|
25
|
1
|
73
|
my $self = shift; |
67
|
25
|
|
|
|
|
61
|
my ($msg) = @_; |
68
|
25
|
|
|
|
|
97
|
die $msg . ' ' . $self->debug . ".\n"; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
1535
|
|
|
1535
|
1
|
2891
|
sub call { @{$_[0]->{+FRAME}} } |
|
1535
|
|
|
|
|
10349
|
|
72
|
|
|
|
|
|
|
|
73
|
0
|
|
|
0
|
1
|
0
|
sub full_call { @{$_[0]->{+FULL_CALLER}} } |
|
0
|
|
|
|
|
0
|
|
74
|
|
|
|
|
|
|
|
75
|
645
|
|
|
645
|
1
|
2218
|
sub package { $_[0]->{+FRAME}->[0] } |
76
|
10
|
|
|
10
|
1
|
53
|
sub file { $_[0]->{+FRAME}->[1] } |
77
|
22
|
|
|
22
|
1
|
69
|
sub line { $_[0]->{+FRAME}->[2] } |
78
|
2
|
|
|
2
|
1
|
12
|
sub subname { $_[0]->{+FRAME}->[3] } |
79
|
|
|
|
|
|
|
|
80
|
599
|
50
|
|
599
|
1
|
2131
|
sub warning_bits { $_[0]->{+FULL_CALLER} ? $_[0]->{+FULL_CALLER}->[9] : undef } |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
1; |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
__END__ |