aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xinfra/base-images/base-runner/coverage11
-rw-r--r--infra/gcb/build_and_run_coverage.py17
2 files changed, 19 insertions, 9 deletions
diff --git a/infra/base-images/base-runner/coverage b/infra/base-images/base-runner/coverage
index acf77032..ac35fca7 100755
--- a/infra/base-images/base-runner/coverage
+++ b/infra/base-images/base-runner/coverage
@@ -96,7 +96,16 @@ function run_fuzz_target {
rm $profraw_file_mask
shared_libraries=$(coverage_helper shared_libs -build-dir=$OUT -object=$target)
- llvm-cov export -summary-only -instr-profile=$profdata_file -object=$target \
+
+ local summary_only_flag="-summary-only"
+ if [ -n "${FULL_SUMMARY_PER_TARGET-}" ]; then
+ # This is needed for dataflow strategy analysis, can be removed later. See
+ # - https://github.com/google/oss-fuzz/pull/3306
+ # - https://github.com/google/oss-fuzz/issues/1632
+ summary_only_flag=""
+ fi
+
+ llvm-cov export $summary_only_flag -instr-profile=$profdata_file -object=$target \
$shared_libraries $LLVM_COV_COMMON_ARGS > $FUZZER_STATS_DIR/$target.json
}
diff --git a/infra/gcb/build_and_run_coverage.py b/infra/gcb/build_and_run_coverage.py
index b94fe355..649d5ad8 100644
--- a/infra/gcb/build_and_run_coverage.py
+++ b/infra/gcb/build_and_run_coverage.py
@@ -147,15 +147,16 @@ def get_build_steps(project_dir):
'*' * 80).format(name=name)
# Unpack the corpus and run coverage script.
+ coverage_env = env + [
+ 'HTTP_PORT=',
+ 'COVERAGE_EXTRA_ARGS=%s' % project_yaml['coverage_extra_args'].strip(),
+ ]
+ if 'dataflow' in project_yaml['fuzzing_engines']:
+ coverage_env.append('FULL_SUMMARY_PER_TARGET=1')
+
build_steps.append({
- 'name':
- 'gcr.io/oss-fuzz-base/base-runner',
- 'env':
- env + [
- 'HTTP_PORT=',
- 'COVERAGE_EXTRA_ARGS=%s' %
- project_yaml['coverage_extra_args'].strip()
- ],
+ 'name': 'gcr.io/oss-fuzz-base/base-runner',
+ 'env': coverage_env,
'args': [
'bash', '-c',
('for f in /corpus/*.zip; do unzip -q $f -d ${f%%.*} || ('