line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: Chunk.pm,v 1.10 2003/12/24 20:38:54 oratrc Exp $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package Oracle::Trace::Chunk; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
18
|
use 5.008001; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
45
|
|
7
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
8
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
32
|
|
9
|
1
|
|
|
1
|
|
12
|
use Data::Dumper; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
38
|
|
10
|
1
|
|
|
1
|
|
538
|
use Oracle::Trace::Utils; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
617
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our @ISA = qw(Oracle::Trace::Utils); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = do { my @r = (q$Revision: 1.10 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my $DEBUG = $ENV{Oracle_Trace_DEBUG} || 0; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=item new |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
Create a new object. |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
my $o_chk = Oracle::Trace::Chunk->new(); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=cut |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub new { |
27
|
27
|
|
|
27
|
1
|
39
|
my $proto = shift; |
28
|
27
|
50
|
|
|
|
42
|
my $class = ref($proto) ? ref($proto) : $proto; |
29
|
27
|
|
|
|
|
179
|
my $self = bless({ |
30
|
|
|
|
|
|
|
_data => {}, |
31
|
|
|
|
|
|
|
_id => '', |
32
|
|
|
|
|
|
|
_parent => 0, |
33
|
|
|
|
|
|
|
_child => 0, |
34
|
|
|
|
|
|
|
@_}, $class); |
35
|
27
|
|
|
|
|
64
|
$self->init; |
36
|
27
|
|
|
|
|
96
|
return $self; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=item init |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Initialise a C, set the oid: |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
$o_chk->parse; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=cut |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub init { |
48
|
27
|
|
|
27
|
1
|
30
|
my $self = shift; |
49
|
27
|
|
|
|
|
30
|
my $xref = $self; |
50
|
27
|
|
|
|
|
29
|
my $x = $xref; |
51
|
27
|
|
|
|
|
220
|
$x =~ s/^(\w+:+)+//; |
52
|
27
|
|
|
|
|
44
|
$x = substr($x, 0, 1); |
53
|
27
|
|
|
|
|
174
|
$xref =~ s/^\w+(?::+\w+)*=[A-Z]+\(//; |
54
|
27
|
|
|
|
|
74
|
$xref =~ s/\)$//; |
55
|
27
|
|
|
|
|
79
|
$self->{_id} = join('-', $$, $x, $xref); |
56
|
27
|
|
|
|
|
34
|
return $self; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=item oid |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Return the id of this object. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
my $oid = $o_chk->oid; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=cut |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub oid { |
68
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
69
|
1
|
|
|
|
|
4
|
return $self->{_id}; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=item parse |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Parse the given string appropriately, expecting to be overriden. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Returns the object |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
$o_chk->parse($string); |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=cut |
81
|
|
|
|
|
|
|
|
82
|
0
|
|
|
0
|
1
|
0
|
sub parse { |
83
|
|
|
|
|
|
|
# supplied by each relevant package |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=item keys |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Return an array of object data keys, restricted by optional regex. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
my @keys = $o_chk->keys($regex); |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=cut |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub keys { |
95
|
36
|
|
|
36
|
1
|
38
|
my $self = shift; |
96
|
36
|
|
100
|
|
|
119
|
my $arg = shift || ''; |
97
|
36
|
|
|
|
|
32
|
return grep(/$arg/, keys %{$self->{_data}}); |
|
36
|
|
|
|
|
523
|
|
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=item value |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Return the value(s) for the given key. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
my ($val/s) = $o_chk->value($key); |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=cut |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
sub value { |
109
|
4
|
|
|
4
|
1
|
5
|
my $self = shift; |
110
|
4
|
|
|
|
|
7
|
my $key = shift; |
111
|
4
|
100
|
|
|
|
11
|
return defined($self->{_data}{$key}) ? @{$self->{_data}{$key}} : (); |
|
3
|
|
|
|
|
19
|
|
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=item statement |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
Return statement/s for an entry: |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
my $s_stmt = $o_ent->statement; |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=cut |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
sub statement { |
123
|
4
|
|
|
4
|
1
|
4
|
my $self = shift; |
124
|
|
|
|
|
|
|
|
125
|
4
|
|
|
|
|
10
|
return $self->values('type'=>'other'); |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
sub dump { |
129
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
130
|
0
|
|
|
|
|
|
return Dumper($self->{_data}); |
131
|
|
|
|
|
|
|
}; |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
1; |
134
|
|
|
|
|
|
|
__END__ |