blib/lib/Devel/StatProfiler/EvalSource.pm

filter: Statementstmt 92.5% 148 / 160 Branchbran 72.9% 35 / 48 Conditioncond 58.0% 36 / 62 MC/DCmcdc 25.0% 9 / 36 Subroutinesub 90.9% 20 / 22 Podpod 0.0% 0 / 11 totaltotal 73.1% 248 / 339 CC 60 SCAR 25.5
CC
60
Cov
81%
_merge_source
26.2
_get_hash_by_name
16.4
_pack_data
12.0
CRAP 12.8
« blib/lib/Devel/StatProfiler/Aggregate.pm ↑ Summary blib/lib/Devel/StatProfiler/FlameGraph.pm »
1 package Devel::StatProfiler::EvalSource;
2  
3 25 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 25 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 25 ▶use Devel::StatProfiler::EvalSourceStorage;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 25 ▶use Devel::StatProfiler::Utils qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
8 check_serializer
9 read_data
10 read_file
11 state_dir
12 utf8_sha1
13 write_data_any
14 write_file
15 25 );
16 25 ▶use File::Path;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 25 ▶use File::Spec::Functions;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 1985 ▶sub new {
Subroutine new: called CC=3 SCAR=11.0
Pod undocumented
20 1985 my ($class, %opts) = @_;
21 my $self = bless {
22 all => {},
23 seen_in_process => {},
24 hashed => {},
25 serializer => $opts{serializer} || 'storable',
26 root_dir => $opts{root_directory},
27 shard => $opts{shard},
28 genealogy => $opts{genealogy},
29 1985 ▶ storage => undef,
Condition100%2/2
$opts{'serializer'} || 'storable'
l!l
101975
MC/DC100%1/1
$opts{'serializer'} || 'storable'
$opts{'serializer'}
Truth table100%2/2
A
A= $opts{'serializer'}
Aresult
11
00
30 }, $class;
31  
32 1985 ▶ if ($self->{root_dir}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"root_dir"}) 1959 26 1985
33 1959 my $storage_base = File::Spec::Functions::catdir($self->{root_dir}, '__source__');
34 1959 $self->{storage} = Devel::StatProfiler::EvalSourceStorage->new(
35 base_dir => $storage_base,
36 ),
37 }
38  
39 1985 check_serializer($self->{serializer});
40  
41 1985 return $self;
42 }
43  
44 25 my $HOLE = "\x00" x 20;
45  
46 8014 ▶sub add_sources_from_reader {
Subroutine add_sources_from_reader: called CC=4 SCAR=14.2
Pod undocumented
47 8014 my ($self, $r) = @_;
48  
49 8014 my ($process_id, $process_ordinal) = @{$r->get_genealogy_info};
50 8014 my $source_code = $r->get_source_code;
51 8014 for my $name (keys %$source_code) {
52 312 my $hash = utf8_sha1($source_code->{$name});
53  
54 warn "Duplicate eval STRING source code for eval '$name'"
55 if exists $self->{seen_in_process}{$process_id}{$name} &&
56 312 ▶ $self->{seen_in_process}{$process_id}{$name} ne $hash;
Branch: 1 branch
BranchTrueFalseTotal
if exists $self->{"seen_in_process"}{$process_id}{$name} and $self->{"seen_in_process"}{$process_id}{$name} ne $hash 0 312 312
Condition33%1/3
exists $self->{"seen_in_process"}{$process_id}{$name} and $self->{"seen_in_process"}{$process_id}{$name} ne $hash
!ll&&!rl&&r
31200
MC/DC0%0/2
exists $self->{"seen_in_process"}{$process_id}{$name} and $self->{"seen_in_process"}{$process_id}{$name} ne $hash
exists $self->{"seen_in_process"}{$process_id}{$name} $self->{"seen_in_process"}{$process_id}{$name} ne $hash
Truth table33%1/3
A and B
A= exists $self->{"seen_in_process"}{$process_id}{$name}B= $self->{"seen_in_process"}{$process_id}{$name} ne $hash
ABresult
0X0
100
111
57 312 $self->{seen_in_process}{$process_id}{$name} = $hash;
58 312 $self->{all}{$process_id}{$process_ordinal}{sparse}{$name} = $hash;
59 312 $self->{hashed}{$hash} = $source_code->{$name};
60 }
61 }
62  
63 8001 ▶sub update_genealogy {
Subroutine update_genealogy: called CC=1 SCAR=0.0
Pod undocumented
64 8001 my ($self, $process_id, $process_ordinal, $parent_id, $parent_ordinal) = @_;
65  
66 8001 $self->{genealogy}{$process_id}{$process_ordinal} = [$parent_id, $parent_ordinal];
67 }
68  
69 # this tries to optimize for the case where we dumped all evals, the number
70 # of evals is unlikely to be an issue when we only dump traced ones
71 1967 ▶sub _pack_data {
Subroutine _pack_data: called CC=12 SCAR=24.9
72 1967 my ($self) = @_;
73 1967 my $all = $self->{all};
74  
75 1967 for my $process_id (keys %$all) {
76 23 ORDINAL: for my $ordinal (keys %{$all->{$process_id}}) {
77 27 my $first = $all->{$process_id}{$ordinal}{first};
78 27 ▶ my $next = $first && $first + length($all->{$process_id}{$ordinal}{packed}) / 20;
Condition66%2/3
$first && $first + length($all->{$process_id}{$ordinal}{'packed'}) / 20
!ll&&!rl&&r
2403
MC/DC50%1/2
$first && $first + length($all->{$process_id}{$ordinal}{'packed'}) / 20
$first $first + length($all->{$process_id}{$ordinal}{'packed'}) / 20
Truth table66%2/3
A && B
A= $firstB= $first + length($all->{$process_id}{$ordinal}{'packed'}) / 20
ABresult
0X0
100
111
79  
80 # files are processed in sequential order, and either we have all the
81 # evals handed to us in order, or we have holes in the sequence
82 # (depending on save_source mode)
83 27 ▶ next if $first && !exists $all->{$process_id}{$ordinal}{sparse}{"(eval $next)"};
Branch: 1 branch
BranchTrueFalseTotal
if $first and not exists $all->{$process_id}{$ordinal}{"sparse"}{"(eval $next)"} 2 25 27
Condition100%3/3
$first and not exists $all->{$process_id}{$ordinal}{"sparse"}{"(eval $next)"}
!ll&&!rl&&r
2412
MC/DC100%2/2
$first and not exists $all->{$process_id}{$ordinal}{"sparse"}{"(eval $next)"}
$first not exists $all->{$process_id}{$ordinal}{"sparse"}{"(eval $next)"}
Truth table100%3/3
A and not(B)
A= $firstB= not exists $all->{$process_id}{$ordinal}{"sparse"}{"(eval $next)"}
ABresult
0X0
100
111
84 761 my @indices = sort { $a <=> $b }
85 243 ▶ map { /^\(eval ([0-9]+)\)$/ ? ($1) : () }
Branch: 1 branch
BranchTrueFalseTotal
/^\(eval ([0-9]+)\)$/ ? : 243 0 243
86 25 keys %{$all->{$process_id}{$ordinal}{sparse}};
87 25 my $curr;
88 25 ▶ if (!$first) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $first) { } 24 1 25
89 24 for my $index (@indices) {
90 67 ▶ if (!$first) {
Branch: 2 branches
BranchTrueFalseTotal
if (not $first) { } 24 43 67
elsif ($next == $index) { } 31 12 43
91 24 $first = $index;
92 24 $next = $first + 1;
93 } elsif ($next == $index) {
94 31 ++$next
95 } else {
96 # not contiguous, bail out
97 12 next ORDINAL;
98 }
99 }
100 12 $all->{$process_id}{$ordinal}{first} = $curr = $first;
101 } else {
102 1 $curr = $next;
103 }
104  
105 13 for my $name (@indices) {
106 27 my $hash = delete $all->{$process_id}{$ordinal}{sparse}{"(eval $curr)"};
107 27 $all->{$process_id}{$ordinal}{packed} .= $hash;
108 27 ++$curr;
109 }
110 }
111 }
112 }
113  
114 1946 ▶sub _save {
Subroutine _save: called CC=4 SCAR=13.9
115 1946 my ($self, $state_dir, $is_part) = @_;
116  
117 1946 ▶ $state_dir //= state_dir($self);
Condition66%2/3
$state_dir //= state_dir($self)
l!l&&r!l&&!r
194240
MC/DC0%0/2
$state_dir //= state_dir($self)
$state_dir state_dir($self)
Truth table66%2/3
A //= B
A= $state_dirB= state_dir($self)
ABresult
1X1
011
000
118 1946 $self->_pack_data;
119  
120 # $self->{seen_in_process} can be reconstructed from $self->{all}
121 write_data_any($is_part, $self, $state_dir, 'source', $self->{all})
122 1946 ▶ if %{$self->{all}};
Branch: 1 branch
BranchTrueFalseTotal
if %{$self->{"all"};} 5 1941 1946
123  
124 1946 my $storage = $self->{storage};
125 1946 for my $hash (keys %{$self->{hashed}}) {
126 99 my $unpacked = unpack "H*", $hash;
127  
128 99 $storage->add_source_string($unpacked, $self->{hashed}{$hash});
129 }
130 }
131  
132 1942 ▶sub save_part { $_[0]->_save($_[1], 1) }
Subroutine save_part: called CC=1 SCAR=0.0
Pod undocumented
133 4 ▶sub save_merged { $_[0]->_save(undef, 0) }
Subroutine save_merged: called CC=1 SCAR=0.0
Pod undocumented
134  
135 9 ▶sub _merge_source {
Subroutine _merge_source: called CC=22 SCAR=32.6
136 9 my ($self, $all) = @_;
137  
138 9 for my $process_id (keys %$all) {
139 11 for my $ordinal (keys %{$all->{$process_id}}) {
140 13 my $entry = $all->{$process_id}{$ordinal};
141 13 ▶ my $self_entry = $self->{all}{$process_id}{$ordinal} //= {};
Condition100%2/2
$self->{"all"}{$process_id}{$ordinal} //= {}
l!l
67
MC/DC100%1/1
$self->{"all"}{$process_id}{$ordinal} //= {}
$self->{"all"}{$process_id}{$ordinal}
Truth table100%2/2
A
A= $self->{"all"}{$process_id}{$ordinal}
Aresult
11
00
142  
143 13 for my $name (keys %{$entry->{sparse} //
144 # backwards compatibility
145 13 ▶ $entry}) {
Condition33%1/3
$entry->{"sparse"} // $entry
l!l&&r!l&&!r
1300
MC/DC0%0/2
$entry->{"sparse"} // $entry
$entry->{"sparse"} $entry
Truth table33%1/3
A // B
A= $entry->{"sparse"}B= $entry
ABresult
1X1
011
000
146 my $hash = $entry->{sparse}{$name} //
147 # backwards compatibility
148 88 ▶ $entry->{$name};
Condition33%1/3
$entry->{"sparse"}{$name} // $entry->{$name}
l!l&&r!l&&!r
8800
MC/DC0%0/2
$entry->{"sparse"}{$name} // $entry->{$name}
$entry->{"sparse"}{$name} $entry->{$name}
Truth table33%1/3
A // B
A= $entry->{"sparse"}{$name}B= $entry->{$name}
ABresult
1X1
011
000
149 # backwards compatibility
150 88 ▶ $hash = pack "H*", $hash if length($hash) == 40;
Branch: 1 branch
BranchTrueFalseTotal
if length $hash == 40 0 88 88
151  
152 warn "Duplicate eval STRING source code for eval '$name'"
153 if exists $self->{seen_in_process}{$process_id}{$name} &&
154 88 ▶ $self->{seen_in_process}{$process_id}{$name} ne $hash;
Branch: 1 branch
BranchTrueFalseTotal
if exists $self->{"seen_in_process"}{$process_id}{$name} and $self->{"seen_in_process"}{$process_id}{$name} ne $hash 0 88 88
Condition33%1/3
exists $self->{"seen_in_process"}{$process_id}{$name} and $self->{"seen_in_process"}{$process_id}{$name} ne $hash
!ll&&!rl&&r
8800
MC/DC0%0/2
exists $self->{"seen_in_process"}{$process_id}{$name} and $self->{"seen_in_process"}{$process_id}{$name} ne $hash
exists $self->{"seen_in_process"}{$process_id}{$name} $self->{"seen_in_process"}{$process_id}{$name} ne $hash
Truth table33%1/3
A and B
A= exists $self->{"seen_in_process"}{$process_id}{$name}B= $self->{"seen_in_process"}{$process_id}{$name} ne $hash
ABresult
0X0
100
111
155 88 $self->{seen_in_process}{$process_id}{$name} = $hash;
156 88 $self_entry->{sparse}{$name} = $hash;
157 }
158  
159 13 ▶ if ($entry->{first}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($entry->{"first"}) 6 7 13
160 6 ▶ if ($self_entry->{first}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self_entry->{'first'}) { } 3 3 6
161 3 my ($af, $bf) = ($self_entry->{first}, $entry->{first});
162 3 my ($ap, $bp);
163  
164 3 ▶ if ($af < $bf) {
Branch: 1 branch
BranchTrueFalseTotal
if ($af < $bf) { } 3 0 3
165 3 ($ap, $bp) = ($self_entry->{packed}, $entry->{packed});
166 } else {
167 0 ($af, $bf) = ($bf, $af);
168 0 ($ap, $bp) = ($entry->{packed}, $self_entry->{packed});
169 }
170 3 my $an = $af + length($ap) / 20;
171 3 my $bn = $bf + length($bp) / 20;
172  
173 # TODO it does not handle overlapping ranges
174 # (probably overkill)
175 3 ▶ if ($an == $bf) {
Branch: 2 branches
BranchTrueFalseTotal
if ($an == $bf) { } 1 2 3
elsif ($an < $bf and $bf - $an < 5 || $bf - $an < ($bn - $af) / 5) { } 1 1 2
176 # contiguous
177 1 $self_entry->{first} = $af;
178 1 $self_entry->{packed} = $ap . $bp;
179 ▶ } elsif (
Condition66%4/6
$an < $bf and $bf - $an < 5 || $bf - $an < ($bn - $af) / 5
!ll&&!rl&&r
011
$bf - $an < 5 or $bf - $an < ($bn - $af) / 5
l!l&&r!l&&!r
101
MC/DC33%1/3
$an < $bf and $bf - $an < 5 || $bf - $an < ($bn - $af) / 5
$an < $bf $bf - $an < 5 $bf - $an < ($bn - $af) / 5
Truth table50%2/4
A and B or C
A= $an < $bfB= $bf - $an < 5C= $bf - $an < ($bn - $af) / 5
ABCresult
0XX0
1000
11X1
1011
180 $an < $bf && (
181 ($bf - $an) < 5 ||
182 ($bf - $an) < ($bn - $af) / 5)) {
183 # close enough that leaving an "hole" is ok
184 1 $self_entry->{first} = $af;
185 1 $self_entry->{packed} = $ap . ($HOLE x ($bf - $an)) . $bp;
186 } else {
187 # unpack the second entry (arbitrary)
188 1 $self_entry->{first} = $af;
189 1 $self_entry->{packed} = $ap;
190  
191 1 for my $i ($bf..$bf + length($bp) / 20 - 1) {
192 2 $self_entry->{sparse}{"(eval $i)"} =
193 substr $bp, ($i - $bf) * 20, 20;
194 }
195 }
196 } else {
197 3 $self_entry->{first} = $entry->{first};
198 3 $self_entry->{packed} = $entry->{packed};
199 }
200  
201 6 ▶ my $seen = $self->{seen_in_process}{$process_id} //= {};
Condition100%2/2
$self->{"seen_in_process"}{$process_id} //= {}
l!l
42
MC/DC100%1/1
$self->{"seen_in_process"}{$process_id} //= {}
$self->{"seen_in_process"}{$process_id}
Truth table100%2/2
A
A= $self->{"seen_in_process"}{$process_id}
Aresult
11
00
202 6 for my $i (0 .. length($entry->{packed}) / 20 - 1) {
203 12 my $name = "(eval " . ($entry->{first} + $i) . ")";
204 12 my $hash = substr $entry->{packed}, $i * 20, 20;
205  
206 warn "Duplicate eval STRING source code for eval '$name'"
207 if exists $seen->{$name} &&
208 12 ▶ $seen->{$name} ne $hash;
Branch: 1 branch
BranchTrueFalseTotal
if exists $seen->{$name} and $seen->{$name} ne $hash 0 12 12
Condition33%1/3
exists $seen->{$name} and $seen->{$name} ne $hash
!ll&&!rl&&r
1200
MC/DC0%0/2
exists $seen->{$name} and $seen->{$name} ne $hash
exists $seen->{$name} $seen->{$name} ne $hash
Truth table33%1/3
A and B
A= exists $seen->{$name}B= $seen->{$name} ne $hash
ABresult
0X0
100
111
209 12 $seen->{$name} = $hash;
210 }
211 }
212 }
213 }
214 }
215  
216 10 ▶sub load_and_merge {
Subroutine load_and_merge: called CC=2 SCAR=6.9
Pod undocumented
217 10 my ($self, @files) = @_;
218  
219 $self->_merge_source(read_data($self->{serializer}, $_))
220 10 for @files;
221  
222 10 $self->_pack_data;
223 }
224  
225 129 ▶sub _get_source_by_hash {
Subroutine _get_source_by_hash: called CC=2 SCAR=7.1
226 129 my ($self, $hash) = @_;
227  
228 return $self->{hashed}{$hash} //
229 129 ▶ $self->{storage}->get_source_by_hash(unpack "H*", $hash);
Condition66%2/3
$self->{"hashed"}{$hash} // $self->{"storage"}->get_source_by_hash(unpack("H*", $hash))
l!l&&r!l&&!r
86430
MC/DC0%0/2
$self->{"hashed"}{$hash} // $self->{"storage"}->get_source_by_hash(unpack("H*", $hash))
$self->{"hashed"}{$hash} $self->{"storage"}->get_source_by_hash(unpack("H*", $hash))
Truth table66%2/3
A // B
A= $self->{"hashed"}{$hash}B= $self->{"storage"}->get_source_by_hash(unpack("H*", $hash))
ABresult
1X1
011
000
230 }
231  
232 39 ▶sub _get_hash_by_name {
Subroutine _get_hash_by_name: called CC=12 SCAR=28.0
233 39 my ($self, $process_id, $name) = @_;
234 39 ▶ my ($ordinal) = sort { $b <=> $a } keys %{$self->{all}{$process_id} || {}};
Condition50%1/2
$self->{'all'}{$process_id} || {}
l!l
390
MC/DC0%0/1
$self->{'all'}{$process_id} || {}
$self->{'all'}{$process_id}
Truth table50%1/2
A
A= $self->{'all'}{$process_id}
Aresult
11
00
235 39 my ($p_id, $o) = ($process_id, $ordinal);
236  
237 39 for (;;) {
238 72 ▶ if (my $by_process = $self->{all}{$p_id}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $by_process = $self->{"all"}{$p_id}) 72 0 72
239 # sorting is there for "extra correctness"
240 72 for my $ord (sort { $b <=> $a } grep $_ <= $o, keys %$by_process) {
241 99 my $entry = $by_process->{$ord};
242 99 my $hash = $entry->{sparse}{$name};
243 99 ▶ return $hash if $hash;
Branch: 1 branch
BranchTrueFalseTotal
if $hash 39 60 99
244 60 ▶ if ($entry->{first} &&
Branch: 1 branch
BranchTrueFalseTotal
if ($entry->{"first"} and $name =~ /^\(eval ([0-9]+)\)$/ and $1 >= $entry->{"first"} and $1 < $entry->{"first"} + length($entry->{"packed"}) / 20) 0 60 60
Condition55%5/9
$entry->{"first"} and $name =~ /^\(eval ([0-9]+)\)$/ and $1 >= $entry->{"first"} and $1 < $entry->{"first"} + length($entry->{"packed"}) / 20
!ll&&!rl&&r
6000
$entry->{"first"} and $name =~ /^\(eval ([0-9]+)\)$/ and $1 >= $entry->{"first"}
!ll&&!rl&&r
34260
$entry->{"first"} and $name =~ /^\(eval ([0-9]+)\)$/
!ll&&!rl&&r
34026
MC/DC0%0/4
$entry->{"first"} and $name =~ /^\(eval ([0-9]+)\)$/ and $1 >= $entry->{"first"} and $1 < $entry->{"first"} + length($entry->{"packed"}) / 20
$entry->{"first"} $name =~ /^\(eval ([0-9]+)\)$/ $1 >= $entry->{"first"} $1 < $entry->{"first"} + length($entry->{"packed"}) / 20
Truth table40%2/5
A and B and C and D
A= $entry->{"first"}B= $name =~ /^\(eval ([0-9]+)\)$/C= $1 >= $entry->{"first"}D= $1 < $entry->{"first"} + length($entry->{"packed"}) / 20
ABCDresult
0XXX0
10XX0
110X0
11100
11111
245 $name =~ /^\(eval ([0-9]+)\)$/ &&
246 $1 >= $entry->{first} &&
247 $1 < $entry->{first} + length($entry->{packed}) / 20) {
248 return substr(
249 $entry->{packed},
250 0 ($1 - $entry->{first}) * 20,
251 20,
252 );
253 }
254 }
255 }
256  
257 33 ▶ if ($self->{genealogy}{$p_id}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'genealogy'}{$p_id}) { } 33 0 33
258 # we only need to get a random value, but using just
259 # each() returns undef from time to time (when it reaches the
260 # end of the hash)
261 33 keys(%{$self->{genealogy}{$p_id}});
262 33 my (undef, $parent) = each %{$self->{genealogy}{$p_id}};
263  
264 33 ▶ if ($parent &&
Branch: 1 branch
BranchTrueFalseTotal
if ($parent and $parent->[1] != 0) { } 33 0 33
Condition33%1/3
$parent and $parent->[1] != 0
!ll&&!rl&&r
0033
MC/DC0%0/2
$parent and $parent->[1] != 0
$parent $parent->[1] != 0
Truth table33%1/3
A and B
A= $parentB= $parent->[1] != 0
ABresult
0X0
100
111
265 # the root process has parent ['0000...0000', 0]
266 $parent->[1] != 0) {
267 33 ($p_id, $o) = @$parent;
268 } else {
269 0 last;
270 }
271 } else {
272 0 last;
273 }
274 }
275  
276 0 return undef;
277 }
278  
279 0 ▶sub get_hash_by_name {
Subroutine get_hash_by_name: not called CC=3 SCAR=24.8
Pod undocumented
280 0 my ($self, $process_id, $name) = @_;
281 0 my $hash = $self->_get_hash_by_name($process_id, $name);
282  
283 0 ▶ return $hash && $hash ne $HOLE ? unpack "H*", $hash : undef;
Branch: 1 branch
BranchTrueFalseTotal
$hash && $hash ne $HOLE ? : 0 0 0
Condition0%0/3
$hash and $hash ne $HOLE
!ll&&!rl&&r
000
MC/DC0%0/2
$hash and $hash ne $HOLE
$hash $hash ne $HOLE
Truth table0%0/3
A and B
A= $hashB= $hash ne $HOLE
ABresult
0X0
100
111
284 }
285  
286 39 ▶sub get_source_by_name {
Subroutine get_source_by_name: called CC=2 SCAR=7.1
Pod undocumented
287 39 my ($self, $process_id, $name) = @_;
288 39 my $hash = $self->_get_hash_by_name($process_id, $name);
289  
290 39 ▶ return $hash ? $self->_get_source_by_hash($hash) : '';
Branch: 1 branch
BranchTrueFalseTotal
$hash ? : 39 0 39
291 }
292  
293 90 ▶sub get_source_by_hash {
Subroutine get_source_by_hash: called CC=1 SCAR=0.0
Pod undocumented
294 90 my ($self, $hash) = @_;
295  
296 90 return $self->_get_source_by_hash(pack "H*", $hash);
297 }
298  
299 0 ▶sub delete_process {
Subroutine delete_process: not called CC=1 SCAR=6.9
Pod undocumented
300 0 my ($self, $process_id) = @_;
301  
302 0 delete $self->{seen_in_process}{$process_id};
303 0 delete $self->{all}{$process_id};
304 }
305  
306 16 ▶sub is_processed {
Subroutine is_processed: called CC=4 SCAR=13.9
Pod undocumented
307 16 my ($self, $process_id, $process_ordinal) = @_;
308 16 my $genealogy = $self->{genealogy};
309  
310 return 1 if $genealogy &&
311 $genealogy->{$process_id} &&
312 16 ▶ $genealogy->{$process_id}{$process_ordinal};
Branch: 1 branch
BranchTrueFalseTotal
if $genealogy and $genealogy->{$process_id} and $genealogy->{$process_id}{$process_ordinal} 3 13 16
Condition83%5/6
$genealogy and $genealogy->{$process_id} and $genealogy->{$process_id}{$process_ordinal}
!ll&&!rl&&r
763
$genealogy and $genealogy->{$process_id}
!ll&&!rl&&r
079
MC/DC66%2/3
$genealogy and $genealogy->{$process_id} and $genealogy->{$process_id}{$process_ordinal}
$genealogy $genealogy->{$process_id} $genealogy->{$process_id}{$process_ordinal}
Truth table75%3/4
A and B and C
A= $genealogyB= $genealogy->{$process_id}C= $genealogy->{$process_id}{$process_ordinal}
ABCresult
0XX0
10X0
1100
1111
313 }
314  
315 25 1;
316  
317 __END__
« blib/lib/Devel/StatProfiler/Aggregate.pm ↑ Summary blib/lib/Devel/StatProfiler/FlameGraph.pm »