llvm-project/llvm/test/tools/llvm-cov/multithreaded-report.test

95 lines
3.7 KiB
Plaintext
Raw Normal View History

[llvm-cov] Multi-threaded implementation of prepareFileReports method. Summary: Local testing has demonstrated a great speed improvement, compare the following: 1) Existing version: ``` $ time llvm-cov show -format=html -output-dir=report -instr-profile=... ... The tool has been launched: 00:00:00 Loading coverage data: 00:00:00 Get unique source files: 00:00:33 Creating an index out of the source files: 00:00:34 Going into prepareFileReports: 00:00:34 Going to emit summary information for each file: 00:28:55 <-- 28:21 min! Going to emit links to files with no function: 00:28:55 Launching 32 threads for generating HTML files: 00:28:55 real 37m43.651s user 112m5.540s sys 7m39.872s ``` 2) Multi-threaded version with 32 CPUs: ``` $ time llvm-cov show -format=html -output-dir=report -instr-profile=... ... The tool has been launched: 00:00:00 Loading coverage data: 00:00:00 Get unique source files: 00:00:38 Creating an index out of the source files: 00:00:40 Going into prepareFileReports: 00:00:40 Preparing file reports using 32 threads: 00:00:40 # Creating thread tasks for the following number of files: 16422 Going to emit summary information for each file: 00:01:57 <-- 1:17 min! Going to emit links to files with no function: 00:01:58 Launching 32 threads for generating HTML files: 00:01:58 real 11m2.044s user 134m48.124s sys 7m53.388s ``` Reviewers: vsk, morehouse Reviewed By: vsk Subscribers: Dor1s, llvm-commits, kcc Differential Revision: https://reviews.llvm.org/D41206 llvm-svn: 321871
2018-01-06 00:15:07 +08:00
# Test "report" command with and without multiple threads.
[llvm-cov] Multi-threaded implementation of prepareFileReports method. Summary: Local testing has demonstrated a great speed improvement, compare the following: 1) Existing version: ``` $ time llvm-cov show -format=html -output-dir=report -instr-profile=... ... The tool has been launched: 00:00:00 Loading coverage data: 00:00:00 Get unique source files: 00:00:33 Creating an index out of the source files: 00:00:34 Going into prepareFileReports: 00:00:34 Going to emit summary information for each file: 00:28:55 <-- 28:21 min! Going to emit links to files with no function: 00:28:55 Launching 32 threads for generating HTML files: 00:28:55 real 37m43.651s user 112m5.540s sys 7m39.872s ``` 2) Multi-threaded version with 32 CPUs: ``` $ time llvm-cov show -format=html -output-dir=report -instr-profile=... ... The tool has been launched: 00:00:00 Loading coverage data: 00:00:00 Get unique source files: 00:00:38 Creating an index out of the source files: 00:00:40 Going into prepareFileReports: 00:00:40 Preparing file reports using 32 threads: 00:00:40 # Creating thread tasks for the following number of files: 16422 Going to emit summary information for each file: 00:01:57 <-- 1:17 min! Going to emit links to files with no function: 00:01:58 Launching 32 threads for generating HTML files: 00:01:58 real 11m2.044s user 134m48.124s sys 7m53.388s ``` Reviewers: vsk, morehouse Reviewed By: vsk Subscribers: Dor1s, llvm-commits, kcc Differential Revision: https://reviews.llvm.org/D41206 llvm-svn: 321871
2018-01-06 00:15:07 +08:00
RUN: llvm-cov report -num-threads=1 \
RUN: -path-equivalence=/tmp,%S/Inputs \
RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \
RUN: %S/Inputs/multithreaded_report/main.covmapping > %t.1.report
RUN: llvm-cov report -num-threads=10 \
RUN: -path-equivalence=/tmp,%S/Inputs \
RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \
RUN: %S/Inputs/multithreaded_report/main.covmapping > %t.2.report
RUN: diff %t.1.report %t.2.report
# Test "export" command with and without multiple threads.
RUN: llvm-cov export -num-threads=1 \
RUN: -path-equivalence=/tmp,%S/Inputs \
RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \
RUN: %S/Inputs/multithreaded_report/main.covmapping > %t.1.json
RUN: llvm-cov export -num-threads=10 \
RUN: -path-equivalence=/tmp,%S/Inputs \
RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \
RUN: %S/Inputs/multithreaded_report/main.covmapping > %t.2.json
RUN: diff %t.1.json %t.2.json
# Test "show" command with and without multiple threads, single text file.
RUN: llvm-cov show -format=text -num-threads=1 \
RUN: -path-equivalence=/tmp,%S/Inputs \
RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \
RUN: %S/Inputs/multithreaded_report/main.covmapping > %t.1.text
RUN: llvm-cov show -format=text -num-threads=10 \
RUN: -path-equivalence=/tmp,%S/Inputs \
RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \
RUN: %S/Inputs/multithreaded_report/main.covmapping > %t.2.text
RUN: diff %t.1.text %t.2.text
# Test "show" command with and without multiple threads, single HTML file.
RUN: llvm-cov show -format=html -num-threads=1 \
RUN: -path-equivalence=/tmp,%S/Inputs \
RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \
RUN: %S/Inputs/multithreaded_report/main.covmapping > %t.1.html
RUN: llvm-cov show -format=html -num-threads=10 \
RUN: -path-equivalence=/tmp,%S/Inputs \
RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \
RUN: %S/Inputs/multithreaded_report/main.covmapping > %t.2.html
RUN: diff %t.1.html %t.2.html
# Test "show" command with and without multiple threads, text directory.
RUN: llvm-cov show -format=text -num-threads=1 \
RUN: -path-equivalence=/tmp,%S/Inputs \
RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \
RUN: %S/Inputs/multithreaded_report/main.covmapping -o %t.1.text_dir
RUN: llvm-cov show -format=text -num-threads=10 \
RUN: -path-equivalence=/tmp,%S/Inputs \
RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \
RUN: %S/Inputs/multithreaded_report/main.covmapping -o %t.2.text_dir
RUN: diff -r %t.1.text_dir %t.2.text_dir
# Test "show" command with and without multiple threads, HTML directory.
RUN: llvm-cov show -format=html -num-threads=1 \
RUN: -path-equivalence=/tmp,%S/Inputs \
RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \
RUN: %S/Inputs/multithreaded_report/main.covmapping -o %t.1.html_dir
RUN: llvm-cov show -format=html -num-threads=10 \
RUN: -path-equivalence=/tmp,%S/Inputs \
RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \
RUN: %S/Inputs/multithreaded_report/main.covmapping -o %t.2.html_dir
RUN: diff -r %t.1.html_dir %t.2.html_dir
Instructions for regenerating the test:
# cd %S/Inputs/multithreaded_report
cp -r . /tmp/multithreaded_report
clang++ -std=c++11 -mllvm -enable-name-compression=false \
-fprofile-instr-generate -fcoverage-mapping \
/tmp/multithreaded_report/*.cc -o main
LLVM_PROFILE_FILE="main.profraw" ./main
llvm-profdata merge main.profraw -o main.profdata
llvm-cov convert-for-testing ./main -o ./main.covmapping
rm main main.profraw