Skip to content

Commit

Permalink
archive coverage data alongside corpus archives
Browse files Browse the repository at this point in the history
  • Loading branch information
addisoncrump committed Aug 8, 2024
1 parent d8a7723 commit 394dc29
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions common/experiment_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ def get_corpus_archive_name(cycle: int) -> str:
"""Returns a corpus archive name given a cycle."""
return get_cycle_filename('corpus-archive', cycle) + '.tar.gz'

def get_coverage_archive_name(cycle: int) -> str:
"""Returns a corpus archive name given a cycle."""
return get_cycle_filename('coverage-archive', cycle) + '.json'


def get_stats_filename(cycle: int) -> str:
"""Returns a corpus archive name given a cycle."""
Expand Down
10 changes: 9 additions & 1 deletion experiment/measurer/measure_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,10 +614,18 @@ def measure_snapshot_coverage( # pylint: disable=too-many-locals
# Generate profdata and transform it into json form.
snapshot_measurer.generate_coverage_information(cycle)

# Save profdata snapshot.
coverage_archive_dst = experiment_utils.get_coverage_archive_name(cycle)
if filestore_utils.cp(snapshot_measurer.cov_summary_file,
coverage_archive_dst,
expect_zero=False).retcode:
snapshot_logger.warning('Coverage not found for cycle: %d.', cycle)
return None

# Run crashes again, parse stacktraces and generate crash signatures.
crashes = snapshot_measurer.process_crashes(cycle)

# Get the coverage of the new corpus units.
# Get the coverage summary of the new corpus units.
branches_covered = snapshot_measurer.get_current_coverage()
fuzzer_stats_data = snapshot_measurer.get_fuzzer_stats(cycle)
snapshot = models.Snapshot(time=this_time,
Expand Down

0 comments on commit 394dc29

Please sign in to comment.