Skip to content

Commit

Permalink
revert changes in coverage_utils; remove warning lines in save
Browse files Browse the repository at this point in the history
  • Loading branch information
addisoncrump committed Aug 12, 2024
1 parent d8718bc commit 2b164d7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
25 changes: 18 additions & 7 deletions experiment/measurer/coverage_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,17 @@ def generate_coverage_summary_json(self):
def generate_coverage_report(self):
"""Generates the coverage report and stores in bucket."""
command = [
'llvm-cov', 'show', '-format=html',
'llvm-cov',
'show',
'-format=html',
f'-path-equivalence=/,{self.source_files_dir}',
f'-output-dir={self.report_dir}', '-Xdemangler', 'c++filt',
'-Xdemangler', '-n', self.binary_file,
f'-instr-profile={self.merged_profdata_file}'
f'-output-dir={self.report_dir}',
'-Xdemangler',
'c++filt',
'-Xdemangler',
'-n',
self.binary_file,
f'-instr-profile={self.merged_profdata_file}',
]
result = new_process.execute(command, expect_zero=False)
if result.retcode != 0:
Expand Down Expand Up @@ -258,9 +264,14 @@ def generate_json_summary(coverage_binary,
"""Generates the json summary file from |coverage_binary|
and |profdata_file|."""
command = [
'llvm-cov', 'export', '-format=text', '-num-threads=1',
'-region-coverage-gt=0', '-skip-expansions', coverage_binary,
f'-instr-profile={profdata_file}'
'llvm-cov',
'export',
'-format=text',
'-num-threads=1',
'-region-coverage-gt=0',
'-skip-expansions',
coverage_binary,
f'-instr-profile={profdata_file}',
]

if summary_only:
Expand Down
3 changes: 2 additions & 1 deletion experiment/measurer/measure_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,8 @@ def measure_snapshot_coverage( # pylint: disable=too-many-locals

with gzip.open(str(coverage_archive_zipped), 'wb') as compressed:
with open(snapshot_measurer.cov_summary_file, 'rb') as uncompressed:
compressed.write(uncompressed.read())
# avoid saving warnings so we can direct import with pandas
compressed.write(uncompressed.readlines()[-1])

coverage_archive_dst = exp_path.filestore(coverage_archive_zipped)
if filestore_utils.cp(coverage_archive_zipped,
Expand Down

0 comments on commit 2b164d7

Please sign in to comment.