summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-cov
Commit message (Collapse)AuthorAgeFilesLines
* Revert "[Coverage] Revise format to reduce binary size"Vedant Kumar2019-12-042-1/+0
| | | | | | | | | | This reverts commit e18531595bba495946aa52c0a16b9f9238cff8bc. On Windows, there is an error: http://lab.llvm.org:8011/builders/sanitizer-windows/builds/54963/steps/stage%201%20check/logs/stdio error: C:\b\slave\sanitizer-windows\build\stage1\projects\compiler-rt\test\profile\Profile-x86_64\Output\instrprof-merging.cpp.tmp.v1.o: Failed to load coverage: Malformed coverage data
* [Coverage] Revise format to reduce binary sizeVedant Kumar2019-12-042-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revise the coverage mapping format to reduce binary size by: 1. Naming function records and marking them `linkonce_odr`, and 2. Compressing filenames. This shrinks the size of llc's coverage segment by 82% (334MB -> 62MB) and speeds up end-to-end single-threaded report generation by 10%. For reference the compressed name data in llc is 81MB (__llvm_prf_names). Rationale for changes to the format: - With the current format, most coverage function records are discarded. E.g., more than 97% of the records in llc are *duplicate* placeholders for functions visible-but-not-used in TUs. Placeholders *are* used to show under-covered functions, but duplicate placeholders waste space. - We reached general consensus about giving (1) a try at the 2017 code coverage BoF [1]. The thinking was that using `linkonce_odr` to merge duplicates is simpler than alternatives like teaching build systems about a coverage-aware database/module/etc on the side. - Revising the format is expensive due to the backwards compatibility requirement, so we might as well compress filenames while we're at it. This shrinks the encoded filenames in llc by 86% (12MB -> 1.6MB). See CoverageMappingFormat.rst for the details on what exactly has changed. Fixes PR34533 [2], hopefully. [1] http://lists.llvm.org/pipermail/llvm-dev/2017-October/118428.html [2] https://bugs.llvm.org/show_bug.cgi?id=34533 Differential Revision: https://reviews.llvm.org/D69471
* Revert "[llvm-cov] Add option to whitelist filenames"Vlad Tsyrklevich2019-10-291-88/+0
| | | | | | This reverts commit bfed824b57d14e2ba98ddbaf1a1410cf04a3e279, the included test fails on many bots including the sanitier bots, e.g. in http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/36140
* [llvm-cov] Add option to whitelist filenamesVedant Kumar2019-10-291-0/+88
| | | | | | | | | Add the `-whitelist-filename-regex` option to restrict coverage reporting to file paths that match a whitelist regex. Patch by Michael Daniels! rdar://56720320
* Remove some unnecessary REQUIRES: shell linesReid Kleckner2019-09-104-8/+6
| | | | | | | This means these tests will run on Windows. Replace one with UNSUPPORTED: system-windows. llvm-svn: 371473
* Ignore object files that lack coverage information.James Y Knight2019-08-287-0/+18
| | | | | | | | | | Before this change, if multiple binary files were presented, all of them must have been instrumented or the load would fail with coverage_map_error::no_data_found. Patch by Dean Sturtevant. Differential Revision: https://reviews.llvm.org/D66763 llvm-svn: 370257
* Fix line endings (NFC)Paul Robinson2019-07-021-85/+85
| | | | llvm-svn: 364919
* [llvm-cov[ Fix lcov coverage report contains functions from other ↵Max Moroz2019-06-281-0/+12
| | | | | | | | | | | | | | | | | | compilation units. Summary: Patch by Chuan Qiu (@eagleonhill). Reviewers: Dor1s Reviewed By: Dor1s Subscribers: lebedev.ri, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63571 llvm-svn: 364653
* Add REQUIRES: zlib to test added in r363325 as the profile uses zlib ↵Douglas Yung2019-06-141-0/+1
| | | | | | compression. llvm-svn: 363347
* [Coverage] Load code coverage data from archivesVedant Kumar2019-06-137-0/+54
| | | | | | | | | | | | | Support loading code coverage data from regular archives, thin archives, and from MachO universal binaries which contain archives. Testing: check-llvm, check-profile (with {A,UB}San enabled) rdar://51538999 Differential Revision: https://reviews.llvm.org/D63232 llvm-svn: 363325
* [tests] Add host-byteorder-*-endian; update XFAILs of big-endian triplesHubert Tong2019-05-014-4/+4
| | | | | | | | | | | | | | | | | | | | Summary: Triple components in `XFAIL` lines are tested against the target triple. Various tests that are expected to fail on big-endian hosts are marked as being `XFAIL` for big-endian targets. This patch corrects these tests by having them test against a new `host-byteorder-big-endian` feature. Reviewers: xingxue, sfertile, jasonliu Reviewed By: xingxue Subscribers: jvesely, nhaehnle, fedor.sergeev, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60551 llvm-svn: 359689
* Speeding up llvm-cov export with multithreaded renderFiles implementation.Max Moroz2019-03-142-0/+13
| | | | | | | | | | | | | | | | | | | | | Summary: CoverageExporterJson::renderFiles accounts for most of the execution time given a large profdata file with multiple binaries. Proposed solution is to generate JSON for each file in parallel and sort at the end to preserve deterministic output. Also added flags to skip generating parts of the output to trim the output size. Patch by Sajjad Mirza (@sajjadm). Reviewers: Dor1s, vsk Reviewed By: Dor1s, vsk Subscribers: liaoyuke, mgrang, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59277 llvm-svn: 356178
* [llvm-cov] Add support for gcov --hash-filenames optionVedant Kumar2019-02-192-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | The patch adds support for --hash-filenames to llvm-cov. This option adds md5 hash of the source path to the name of the generated .gcov file. The option is crucial for cases where you have multiple files with the same name but can't use --preserve-paths as resulting filenames exceed the limit. from gcov(1): ``` -x --hash-filenames By default, gcov uses the full pathname of the source files to to create an output filename. This can lead to long filenames that can overflow filesystem limits. This option creates names of the form source-file##md5.gcov, where the source-file component is the final filename part and the md5 component is calculated from the full mangled name that would have been used otherwise. ``` Patch by Igor Ignatev! Differential Revision: https://reviews.llvm.org/D58370 llvm-svn: 354379
* [llvm-cov] Add lcov tracefile export format.Max Moroz2018-11-091-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | Summary: lcov tracefiles are used by various coverage reporting tools and build systems (e.g., Bazel). It is a simple text-based format to parse and more convenient to use than the JSON export format, which needs additional processing to map regions/segments back to line numbers. It's a little unfortunate that "text" format is now overloaded to refer specifically to JSON for export, but I wanted to avoid making any breaking changes to the UI of the llvm-cov tool at this time. Patch by Tony Allevato (@allevato). Reviewers: Dor1s, vsk Reviewed By: Dor1s, vsk Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D54266 llvm-svn: 346506
* [gcov] Fix wrong line hit counts when multiple blocks are on the same lineCalixte Denizet2018-09-2013-25/+25
| | | | | | | | | | | | | | | | | | | | | Summary: The goal of this patch is to have the same behaviour than gcc-gcov. Currently the hit counts for a line is the sum of the counts for each block on that line. The idea is to detect the cycles in the graph of blocks in using the algorithm by Hawick & James. The count for a cycle is the min of the counts for each edge in the cycle. Once we've the count for each cycle, we can sum them and add the transition counts of those cycles. Fix both https://bugs.llvm.org/show_bug.cgi?id=38065 and https://bugs.llvm.org/show_bug.cgi?id=38066 Reviewers: marco-c, davidxl Reviewed By: marco-c Subscribers: vsk, lebedev.ri, sylvestre.ledru, dblaikie, llvm-commits Differential Revision: https://reviews.llvm.org/D49659 llvm-svn: 342657
* [llvm-cov] Delete custom JSON serialization code (NFC)Vedant Kumar2018-09-1211-263/+31
| | | | | | | Teach llvm-cov to use the new llvm JSON library, and remove some redundant/brittle JSON serialization tests. llvm-svn: 342088
* [lit, python] Always add quotes around the python path in litStella Stamenova2018-08-061-1/+1
| | | | | | | | | | | | | | | | | Summary: The issue with the python path is that the path to python on Windows can contain spaces. To make the tests always work, the path to python needs to be surrounded by quotes. This change updates several configuration files which specify the path to python as a substitution and also remove quotes from existing tests. Reviewers: asmith, zturner, alexshap, jakehehrlich Reviewed By: zturner, alexshap, jakehehrlich Subscribers: mehdi_amini, nemanjai, eraman, kbarton, jakehehrlich, steven_wu, dexonsmith, stella.stamenova, delcypher, llvm-commits Differential Revision: https://reviews.llvm.org/D50206 llvm-svn: 339073
* [llvm-cov] Use the new PrintHTMLEscaped utilityVedant Kumar2018-05-301-7/+7
| | | | | | This removes some duplicate logic to escape characters in HTML output. llvm-svn: 333608
* [Coverage] Take filenames into account when loading function records.Max Moroz2018-05-081-0/+5
| | | | | | | | | | | | | | | | | | | | Summary: Don't skip functions with the same name but from different files. That change makes it possible to generate code coverage reports from different binaries compiled from different sources even if there are functions with non-unique names. Without that change, code coverage for such functions is missing except of the first function processed. Reviewers: vsk, morehouse Reviewed By: vsk Subscribers: llvm-commits, kcc Differential Revision: https://reviews.llvm.org/D46478 llvm-svn: 331801
* [llvm-cov] Implement -ignore-filename-regex= option for excluding source files.Max Moroz2018-04-091-0/+71
| | | | | | | | | | | | | | | | | | | Summary: The option is helpful for large projects where it's not feasible to specify sources which user would like to see in the report. Instead, it allows to black-list specific sources via regular expressions (e.g. now it's possible to skip all files that have "test" in its name). This also partially fixes https://bugs.llvm.org/show_bug.cgi?id=34277 Reviewers: vsk, morehouse, liaoyuke Reviewed By: vsk Subscribers: kcc, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D43907 llvm-svn: 329581
* [lit] Fix a problem with spaces in the python path by adding quotes around itAaron Smith2018-02-211-1/+1
| | | | | | These are the last tests left to fix after D43265. llvm-svn: 325657
* [llvm-cov] Improvements for summary report generated in HTML format.Max Moroz2018-01-313-11/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This commit adds the following changes: 1) coverage numbers are aligned to the left and padded with spaces in order to provide better readability for percentage values, e.g.: ``` file1 | 89.13% (123 / 2323) | 100.00% (55 / 55) | 9.33% (14545 / 234234) file_asda | 1.78% ( 23 / 4323) | 32.31% (555 / 6555) | 67.89% (1545 / 2234) fileXXX | 100.00% (12323 / 12323) | 100.00% (555 / 555) | 100.00% (12345 / 12345) ``` 2) added "hover" attribute to CSS for highlighting table row under mouse cursor see screenshot attached to the phabricator review page {F5764813} 3) table title row and "totals" row now use bold text Reviewers: vsk, morehouse Reviewed By: vsk Subscribers: kcc, llvm-commits Differential Revision: https://reviews.llvm.org/D42093 llvm-svn: 323892
* Profiling tests: Endianess XFAIL for powerpc- (32-bit)Hubert Tong2018-01-094-4/+4
| | | | | | | | | | | | Add powerpc- (32-bit) as XFAIL for tests that are documented either in- line or via commit messages as expected to fail on big-endian systems. Tests not documented in-line are documented in commit messages as follows: r211172 - test/tools/llvm-cov/llvm-cov.test r247920 - test/Transforms/SampleProfile/gcc-simple.ll llvm-svn: 322114
* [lit] Implement "-r" option for builtin "diff" command + a test using that.Max Moroz2018-01-091-3/+0
| | | | | | | | | | | | | | | | Summary: That would allow to recursively compare directories in tests using "diff -r" on Windows in a similar way as it can be done on Linux or Mac. Reviewers: zturner, morehouse, vsk Reviewed By: zturner Subscribers: kcc, llvm-commits Differential Revision: https://reviews.llvm.org/D41776 llvm-svn: 322102
* [llvm-cov] Change test to use FileCheck instead of grep.Douglas Yung2018-01-051-4/+6
| | | | | | Reviewed by Paul Robinson llvm-svn: 321888
* [llvm-cov] Temporarily disable multithreaded-report.test on Windows.Max Moroz2018-01-051-0/+4
| | | | | | | | | | | | Summary: The test is failing because Windows do not support "diff -r". Reviewers: Dor1s Reviewed By: Dor1s Differential Revision: https://reviews.llvm.org/D41768 llvm-svn: 321876
* [llvm-cov] Multi-threaded implementation of prepareFileReports method.Max Moroz2018-01-0510-0/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [llvm-cov] Refactor "export" command implementation and add support for SOURCES.Max Moroz2018-01-041-0/+14
| | | | | | | | | | | | | | Summary: Define an interface for Exporter + split JSON exporter into .h and .cpp. Reviewers: vsk, morehouse Reviewed By: vsk Subscribers: llvm-commits, Dor1s, kcc Differential Revision: https://reviews.llvm.org/D41600 llvm-svn: 321815
* Fix tests after move to utohexstr.Benjamin Kramer2017-12-281-1/+1
| | | | llvm-svn: 321527
* [llvm-cov] Simplify a test case. NFC.Vedant Kumar2017-12-111-24/+5
| | | | llvm-svn: 320439
* [llvm-cov] Add an option for "export" command to emit only file summary data.Max Moroz2017-12-111-24/+27
| | | | | | | | | | | | | | Summary: That allows to get the same data as produced by "llvm-cov report", but in JSON format, which is better for further processing by end users. Reviewers: vsk Reviewed By: vsk Differential Revision: https://reviews.llvm.org/D41085 llvm-svn: 320435
* [Coverage] Use the most-recent completed region count (PR35437)Vedant Kumar2017-11-301-1/+3
| | | | | | | | | | | | | | | This is a fix for the coverage segment builder. If multiple regions must be popped off the active stack at once, and more than one of them end at the same location, emit a segment using the count from the most-recent completed region. Fixes PR35437, rdar://35760630 Testing: invoked llvm-cov on a stage2 build of clang, additional unit tests, check-profile llvm-svn: 319391
* [llvm-cov] Fix more -path-equivalence test bugsVedant Kumar2017-11-093-1/+1
| | | | llvm-svn: 317764
* [llvm-cov] Fix a -path-equivalence bug in a testVedant Kumar2017-11-091-2/+2
| | | | llvm-svn: 317763
* [llvm-cov] Don't render empty region marker linesVedant Kumar2017-11-091-1/+1
| | | | | | | This fixes an issue where llvm-cov prints an empty line, thinking it needs to display region markers, when it actually doesn't. llvm-svn: 317762
* [Coverage] Use the wrapped segment when a line has entry segmentsVedant Kumar2017-11-0917-92/+57
| | | | | | | | | We've worked around bugs in the frontend by ignoring the count from wrapped segments when a line has at least one region entry segment. Those frontend bugs are now fixed, so it's time to regenerate the checked-in covmapping files and remove the workaround. llvm-svn: 317761
* [llvm-cov] Suppress sub-line highlights in simple casesVedant Kumar2017-10-182-15/+3
| | | | | | | | | | llvm-cov tends to highlight too many regions because its policy is to highlight all region entry segments. This can look confusing to users: not all region entry segments are interesting and deserve highlighting. Emitting these highlights only when the region count differs from the line count is a more user-friendly policy. llvm-svn: 316109
* [llvm-cov] Highlight gaps in consecutive uncovered regionsVedant Kumar2017-10-181-0/+1
| | | | | | | llvm-cov typically doesn't highlight gap segments, but it should if the gap occurs after an uncovered region in order to preserve continuity. llvm-svn: 316107
* [llvm-cov] Add one correction to r315960 (PR34962)Vedant Kumar2017-10-171-1/+1
| | | | | | | | | In r315960, I accidentally assumed that the first line segment is guaranteed to be the non-gap region entry segment (given that one is present). It can actually be any segment on the line, and the test I checked in demonstrates that. llvm-svn: 315963
* [llvm-cov] Remove workaround in line execution count calculation (PR34962)Vedant Kumar2017-10-163-0/+12
| | | | | | | | | | | | | Gap areas make it possible to correctly determine when to use counts from deferred regions. Before gap areas were introduced, llvm-cov needed to use a heuristic to do this: it ignored counts from segments that start, but do not end, on a line. This heuristic breaks down on a simple example (see PR34962). This patch removes the heuristic and picks counts from any region entry segment which isn't a gap area. llvm-svn: 315960
* [llvm-cov] Reland sources-specified.test with addition of "-path-equivalence".Max Moroz2017-10-132-0/+34
| | | | | | | | | | | | Summary: This version of tests should be working properly. Reviewers: vsk Reviewed By: vsk Differential Revision: https://reviews.llvm.org/D38889 llvm-svn: 315714
* [llvm-cov] Temporary delete sources-specified.test, it is failing on some bots.Max Moroz2017-10-131-27/+0
| | | | | | | | | | | | | | Summary: http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/5950/steps/test-stage1-compiler/logs/stdio Reviewers: vsk, Dor1s Reviewed By: Dor1s Subscribers: mehdi_amini Differential Revision: https://reviews.llvm.org/D38888 llvm-svn: 315693
* [llvm-cov] Fix sources-specified.test so it ignores the order of files printed.Max Moroz2017-10-131-7/+6
| | | | | | | | | | | | Summary: https://reviews.llvm.org/D38884#896964 Reviewers: vsk, Dor1s Reviewed By: Dor1s Differential Revision: https://reviews.llvm.org/D38887 llvm-svn: 315691
* [llvm-cov] An attempt to fix sources_specified.test failing on some buildbots.Max Moroz2017-10-131-4/+4
| | | | | | | | | | | | Summary: https://reviews.llvm.org/rL315685#115380 Reviewers: vsk, Dor1s Reviewed By: Dor1s Differential Revision: https://reviews.llvm.org/D38884 llvm-svn: 315687
* [llvm-cov] Generate "report" for given source paths if sources are specified.Max Moroz2017-10-137-0/+48
| | | | | | | | | | | | | | | | Summary: Documentation says that user can specify sources for both "show" and "report" commands. "Show" command respects specified sources, but "report" does not. It is useful to have both "show" and "report" generated for specified sources. Also added tests to for both commands with sources specified. Reviewers: vsk, kcc Reviewed By: vsk Differential Revision: https://reviews.llvm.org/D38860 llvm-svn: 315685
* [llvm-cov] Fix showing title when filtering and not outputting to a directorySean Eveson2017-10-041-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D38507 llvm-svn: 314885
* [llvm-cov] Hide files with no coverage from the index when filtering by nameSean Eveson2017-10-031-0/+16
| | | | | | Differential Revision: https://reviews.llvm.org/D38457 llvm-svn: 314782
* [llvm-cov] Create directory structure when filtering using -name*= optionsSean Eveson2017-09-2810-11/+131
| | | | | | | | | | | Before this change using any of the -name*= command line options with an output directory would result in a single file (functions.txt/functions.html) containing the coverage for those specific functions. Now you get the same directory structure as when not using any -name*= options. Differential Revision: https://reviews.llvm.org/D38280 llvm-svn: 314396
* Revert "[llvm-cov] Create directory structure when filtering using -name*= ↵Sean Eveson2017-09-278-128/+8
| | | | | | | | options" Test failures. llvm-svn: 314314
* [llvm-cov] Create directory structure when filtering using -name*= optionsSean Eveson2017-09-278-8/+128
| | | | | | | | | | | Before this change using any of the -name*= command line options with an output directory would result in a single file (functions.txt/functions.html) containing the coverage for those specific functions. Now you get the same directory structure as when not using any -name*= options. Differential Revision: https://reviews.llvm.org/D38280 llvm-svn: 314310
OpenPOWER on IntegriCloud