@@ -1655,7 +1655,8 @@ sub initial_state
1655
1655
foreach my $patType (\@lcovutil::exclude_file_patterns ,
1656
1656
\@lcovutil::include_file_patterns ,
1657
1657
\@lcovutil::file_subst_patterns ,
1658
- \@omit_line_patterns
1658
+ \@lcovutil::omit_line_patterns ,
1659
+ \@lcovutil::exclude_function_patterns
1659
1660
) {
1660
1661
foreach my $p (@$patType ) {
1661
1662
$p -> [-1] = 0;
@@ -1696,7 +1697,8 @@ sub compute_update
1696
1697
foreach my $patType (\@lcovutil::exclude_file_patterns ,
1697
1698
\@lcovutil::include_file_patterns ,
1698
1699
\@lcovutil::file_subst_patterns ,
1699
- \@omit_line_patterns
1700
+ \@lcovutil::omit_line_patterns ,
1701
+ \@lcovutil::exclude_function_patterns
1700
1702
) {
1701
1703
my @count ;
1702
1704
foreach my $p (@$patType ) {
@@ -1751,7 +1753,8 @@ sub update_state
1751
1753
foreach my $patType (\@lcovutil::exclude_file_patterns ,
1752
1754
\@lcovutil::include_file_patterns ,
1753
1755
\@lcovutil::file_subst_patterns ,
1754
- \@omit_line_patterns
1756
+ \@lcovutil::omit_line_patterns ,
1757
+ \@lcovutil::exclude_function_patterns
1755
1758
) {
1756
1759
my $count = shift ;
1757
1760
die (" unexpected pattern count" ) unless $# $count == $# $patType ;
@@ -1976,7 +1979,8 @@ sub is_filter_enabled
1976
1979
|| defined ($lcovutil::cov_filter [$lcovutil::FILTER_EXCLUDE_BRANCH ])
1977
1980
|| defined (
1978
1981
$lcovutil::cov_filter [$lcovutil::FILTER_TRIVIAL_FUNCTION ]) ||
1979
- 0 != scalar (@lcovutil::omit_line_patterns ));
1982
+ 0 != scalar (@lcovutil::omit_line_patterns ) ||
1983
+ 0 != scalar (@lcovutil::exclude_function_patterns ));
1980
1984
}
1981
1985
1982
1986
sub parse_cov_filters (@)
@@ -2022,18 +2026,22 @@ sub summarize_cov_filters
2022
2026
" \n " . $histogram -> [1] . " coverpoint" .
2023
2027
($histogram -> [1] > 1 ? " s" : " " ) . " \n " );
2024
2028
}
2025
- my $patternCount = scalar (@omit_line_patterns );
2026
- if ($patternCount ) {
2027
- my $omitCount = 0;
2028
- foreach my $p (@omit_line_patterns ) {
2029
- $omitCount += $p -> [-1];
2029
+ foreach my $q ([' omit-lines' , ' line' , \@omit_line_patterns ],
2030
+ [' erase-functions' , ' function' , \@exclude_function_patterns ]) {
2031
+ my ($opt , $type , $patterns ) = @$q ;
2032
+ my $patternCount = scalar (@$patterns );
2033
+ if ($patternCount ) {
2034
+ my $omitCount = 0;
2035
+ foreach my $p (@$patterns ) {
2036
+ $omitCount += $p -> [-1];
2037
+ }
2038
+ info(-1,
2039
+ " Omitted %d total $type%s matching %d '--$opt ' pattern%s \n " ,
2040
+ $omitCount ,
2041
+ $omitCount == 1 ? ' ' : ' s' ,
2042
+ $patternCount ,
2043
+ $patternCount == 1 ? ' ' : ' s' );
2030
2044
}
2031
- info(-1,
2032
- " Omitted %d total line%s matching %d '--omit-lines' pattern%s \n " ,
2033
- $omitCount ,
2034
- $omitCount == 1 ? ' ' : ' s' ,
2035
- $patternCount ,
2036
- $patternCount == 1 ? ' ' : ' s' );
2037
2045
}
2038
2046
}
2039
2047
@@ -2055,7 +2063,7 @@ sub reenable_cov_filters
2055
2063
{
2056
2064
my $data = shift ;
2057
2065
my $filters = $data -> [0];
2058
- # disable but return current status - so the can be re-enabled
2066
+ # re-enable in the same order
2059
2067
for (my $i = 0; $i < scalar (@$filters ); $i ++) {
2060
2068
$cov_filter [$i ] = $filters -> [$i ];
2061
2069
}
@@ -5843,8 +5851,11 @@ sub _mergeParallelChunk
5843
5851
my $now = Time::HiRes::gettimeofday();
5844
5852
$lcovutil::profileData {filt_undump }{$chunkId } = $now - $start ;
5845
5853
5846
- for (my $i = scalar (@{$store -> [0]}) - 1; $i >= 0; --$i ) {
5847
- $store -> [0]-> [$i ]-> [-1] += $save -> [0]-> [$i ];
5854
+ foreach my $patType (@{$store -> [0]}) {
5855
+ my $svType = shift (@{$save -> [0]});
5856
+ foreach my $p (@$patType ) {
5857
+ $p -> [-1] += shift (@$svType );
5858
+ }
5848
5859
}
5849
5860
for (my $i = scalar (@{$store -> [1]}) - 1; $i >= 0; --$i ) {
5850
5861
$store -> [1]-> [$i ]-> [-2] += $save -> [1]-> [$i ]-> [0];
@@ -5869,9 +5880,9 @@ sub _mergeParallelChunk
5869
5880
}
5870
5881
} else {
5871
5882
lcovutil::report_parallel_error(' filter' ,
5872
- $ERROR_PARALLEL , $child , $childstatus ,
5873
- " serialized data '$dumped ' not presetnt " ,
5874
- , keys (%$children ));
5883
+ $ERROR_PARALLEL , $child , $childstatus ,
5884
+ " serialized data '$dumped ' not present " ,
5885
+ , keys (%$children ));
5875
5886
}
5876
5887
5877
5888
foreach my $f ($dumped ) {
@@ -5960,11 +5971,12 @@ sub _processParallelChunk
5960
5971
};
5961
5972
my $end = Time::HiRes::gettimeofday();
5962
5973
# collect pattern counts
5974
+ my @pcounts ;
5963
5975
foreach my $l (@{$save -> [0]}) {
5964
- foreach my $p (@$l ) {
5965
- $p = $p -> [-1];
5966
- }
5976
+ my @c = map ({ $_ -> [-1] } @$l ); # grap the counts
5977
+ push (@pcounts , \@c );
5967
5978
}
5979
+ $save -> [0] = \@pcounts ;
5968
5980
# filter counts
5969
5981
foreach my $f (@{$save -> [1]}) {
5970
5982
$f = [$f -> [-2], $f -> [-1]];
@@ -5981,7 +5993,6 @@ sub _processParallelChunk
5981
5993
my $h = $f -> hdl();
5982
5994
print ($h $d -> [1]);
5983
5995
}
5984
- my @counts ;
5985
5996
my $dumpf = File::Spec-> catfile($tmp , " dumper_$$ " );
5986
5997
my $then = Time::HiRes::gettimeofday();
5987
5998
$lcovutil::profileData {filt_proc }{$chunkId } = $then - $forkAt ;
@@ -5995,7 +6006,7 @@ sub _processParallelChunk
5995
6006
};
5996
6007
if ($@ ) {
5997
6008
lcovutil::ignorable_error($lcovutil::ERROR_PARALLEL ,
5998
- " Child $$ serialize failed: $! " );
6009
+ " Child $$ serialize failed: $@ " );
5999
6010
}
6000
6011
return $status ;
6001
6012
}
0 commit comments