[PATCH] D106314: [Utils] Add -compilation-dir flag to prepare-code-coverage-artifact.py
Zequan Wu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 19 14:27:59 PDT 2021
zequanwu created this revision.
zequanwu added reviewers: vsk, thakis.
zequanwu requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D106314
Files:
llvm/utils/prepare-code-coverage-artifact.py
Index: llvm/utils/prepare-code-coverage-artifact.py
===================================================================
--- llvm/utils/prepare-code-coverage-artifact.py
+++ llvm/utils/prepare-code-coverage-artifact.py
@@ -35,7 +35,7 @@
return profdata_path
def prepare_html_report(host_llvm_cov, profile, report_dir, binaries,
- restricted_dirs):
+ restricted_dirs, compilation_dir):
print(':: Preparing html report for {0}...'.format(binaries), end='')
sys.stdout.flush()
objects = []
@@ -47,7 +47,8 @@
invocation = [host_llvm_cov, 'show'] + objects + ['-format', 'html',
'-instr-profile', profile, '-o', report_dir,
'-show-line-counts-or-regions', '-Xdemangler', 'c++filt',
- '-Xdemangler', '-n'] + restricted_dirs
+ '-Xdemangler', '-n'] + restricted_dirs + ['-compilation-dir=',
+ compilation_dir]
subprocess.check_call(invocation)
with open(os.path.join(report_dir, 'summary.txt'), 'wb') as Summary:
subprocess.check_call([host_llvm_cov, 'report'] + objects +
@@ -56,16 +57,16 @@
print('Done!')
def prepare_html_reports(host_llvm_cov, profdata_path, report_dir, binaries,
- unified_report, restricted_dirs):
+ unified_report, restricted_dirs, compilation_dir):
if unified_report:
prepare_html_report(host_llvm_cov, profdata_path, report_dir, binaries,
- restricted_dirs)
+ restricted_dirs, compilation_dir)
else:
for binary in binaries:
binary_report_dir = os.path.join(report_dir,
os.path.basename(binary))
prepare_html_report(host_llvm_cov, profdata_path, binary_report_dir,
- [binary], restricted_dirs)
+ [binary], restricted_dirs, compilation_dir)
if __name__ == '__main__':
parser = argparse.ArgumentParser(description=__doc__)
@@ -90,6 +91,8 @@
default=[],
help='Restrict the reporting to the given source paths'
' (must be specified after all other positional arguments)')
+ parser.add_argument('--compilation-dir', type=str, default="",
+ help='The compilation directory of the binary')
args = parser.parse_args()
if args.use_existing_profdata and args.only_merge:
@@ -109,4 +112,5 @@
if not args.only_merge:
prepare_html_reports(args.host_llvm_cov, profdata_path, args.report_dir,
- args.binaries, args.unified_report, args.restrict)
+ args.binaries, args.unified_report, args.restrict,
+ args.compilation_dir)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106314.359916.patch
Type: text/x-patch
Size: 2892 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210719/cac889ee/attachment.bin>
More information about the llvm-commits
mailing list