Skip to content

Commit 9157e96

Browse files
committed
Bugfix: use unique ID for filter chunk: we may filter more than one tracefile.
Signed-off-by: Henry Cox <[email protected]>
1 parent 5b3390a commit 9157e96

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lib/lcovutil.pm

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5016,6 +5016,10 @@ sub _processParallelChunk
50165016
}
50175017
}
50185018

5019+
# chunkID is only used for uniquification and as a key in profile data.
5020+
# We want this umber to be unique - even if we process more than one TraceFile
5021+
our $masterChunkID = 0;
5022+
50195023
sub _processFilterWorklist
50205024
{
50215025
my ($self, $fileList) = @_;
@@ -5141,15 +5145,15 @@ sub _processFilterWorklist
51415145
if (0 == $pid) {
51425146
# I'm the child
51435147
_processParallelChunk($tmp, $d, $srcReader, \@save, \@state,
5144-
$now, $processedChunks);
5148+
$now, $masterChunkID);
51455149
exit(0);
51465150
} else {
51475151
# parent
5148-
$children{$pid} = [$d, $now, $processedChunks];
5149-
debug(1, "fork:$pid ID $processedChunks\n");
5152+
$children{$pid} = [$d, $now, $masterChunkID];
5153+
lcovutil::debug(1, "fork:$pid ID $masterChunkID\n");
51505154
++$currentParallel;
51515155
}
5152-
5156+
++$masterChunkID;
51535157
}
51545158
} # foreach
51555159
while ($currentParallel != 0) {
@@ -5306,6 +5310,7 @@ sub applyFilters
53065310
$self->[STATE] |= DID_DERIVE;
53075311

53085312
if (@filter_workList) {
5313+
lcovutil::info("Apply filtering..\n");
53095314
$self->_processFilterWorklist(\@filter_workList);
53105315
# keep track - so we don't do this again
53115316
$self->[STATE] |= DID_FILTER;

0 commit comments

Comments
 (0)