From 2b164d764b09b443f0548d965acc1ebac404a52c Mon Sep 17 00:00:00 2001 From: Addison Crump Date: Mon, 12 Aug 2024 15:09:43 +0200 Subject: [PATCH] revert changes in coverage_utils; remove warning lines in save --- experiment/measurer/coverage_utils.py | 25 ++++++++++++++++++------- experiment/measurer/measure_manager.py | 3 ++- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/experiment/measurer/coverage_utils.py b/experiment/measurer/coverage_utils.py index 21a39b5dd..42ca57385 100644 --- a/experiment/measurer/coverage_utils.py +++ b/experiment/measurer/coverage_utils.py @@ -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: @@ -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: diff --git a/experiment/measurer/measure_manager.py b/experiment/measurer/measure_manager.py index 82baf0a9d..b3813653d 100644 --- a/experiment/measurer/measure_manager.py +++ b/experiment/measurer/measure_manager.py @@ -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,