summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cov/CoverageExporterJson.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [llvm-cov] Fix illegal cast from uint64_t to int64_tSajjad Mirza2019-11-151-3/+13
| | | | | | | | | | | | | | | | | Summary: Counters are stored as uint64_t in the coverage mapping, but exporting in JSON requires signed integers. Clamp the values to the smaller range to make the conversion safe. Reviewers: Dor1s, vsk Reviewed By: Dor1s Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70200
* Revert "[llvm-cov] Add option to whitelist filenames"Vlad Tsyrklevich2019-10-291-3/+2
| | | | | | 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-2/+3
| | | | | | | | | Add the `-whitelist-filename-regex` option to restrict coverage reporting to file paths that match a whitelist regex. Patch by Michael Daniels! rdar://56720320
* Speeding up llvm-cov export with multithreaded renderFiles implementation.Max Moroz2019-03-141-13/+49
| | | | | | | | | | | | | | | | | | | | | 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
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [llvm-cov] Delete custom JSON serialization code (NFC)Vedant Kumar2018-09-121-325/+133
| | | | | | | Teach llvm-cov to use the new llvm JSON library, and remove some redundant/brittle JSON serialization tests. llvm-svn: 342088
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-011-2/+2
| | | | | | | | | | | | | | | | We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46290 llvm-svn: 331272
* [llvm-cov] Implement -ignore-filename-regex= option for excluding source files.Max Moroz2018-04-091-5/+8
| | | | | | | | | | | | | | | | | | | 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
* [llvm-cov] Skip unnecessary coverage computations for "export -summary-only".Max Moroz2018-01-121-29/+34
| | | | | | | | | | | | | | | | | | | Summary: This speeds up export "summary-only" execution by an order of magnitude or two, depending on number of threads used for prepareFileReports execution. Also includes minor refactoring for splitting render of summary and detailed data in two independent methods. Reviewers: vsk, morehouse Reviewed By: vsk Subscribers: llvm-commits, kcc Differential Revision: https://reviews.llvm.org/D42000 llvm-svn: 322397
* [llvm-cov] Refactor "export" command implementation and add support for SOURCES.Max Moroz2018-01-041-310/+254
| | | | | | | | | | | | | | 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
* [llvm-cov] Add an option for "export" command to emit only file summary data.Max Moroz2017-12-111-16/+23
| | | | | | | | | | | | | | 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
* [llvm-cov] Make some summary info fields private. NFC.Vedant Kumar2017-09-151-10/+10
| | | | | | | | There's a bug in the way the line and region summary objects are merged. It would have been less likely to occur if those objects kept some data private. llvm-svn: 313416
* [llvm-cov] Remove a redundant field. NFC.Vedant Kumar2017-09-151-1/+3
| | | | | | | | | | The "NotCovered" fields in the region and line summary structs are redundant. We should remove them to make the code clearer. As a follow-up, the "NotCovered" entries should be removed from the reports as well. llvm-svn: 313415
* [llvm-cov] Fix a lifetime issueVedant Kumar2017-09-081-5/+9
| | | | | | | This fixes an issue where a std::string was moved to a constructor which accepted a StringRef. llvm-svn: 312816
* [llvm-cov] Do not print out the filename of the object fileVedant Kumar2016-10-251-14/+5
| | | | | | | | | When we load coverage data from multiple objects, we don't have a way to attribute a source object to a function record. Printing out the object filename next to the source filename is already not very useful: soon, it'll actually become misleading. Stop printing out the filename now. llvm-svn: 285043
* [Coverage] Delete some copy constructors (NFC)Vedant Kumar2016-10-121-1/+1
| | | | llvm-svn: 284064
* [llvm-cov] Get rid of all invalid filename referencesVedant Kumar2016-09-231-2/+4
| | | | | | | | | | | | | | We used to append filenames into a vector of std::string, and then append a reference to each string into a separate vector. This made it easier to work with the getUniqueSourceFiles API. But it's buggy. std::string has a small-string optimization, so you can't expect to capture a reference to one if you're copying it into a growing vector. Add a test that triggers this invalid reference to std::string scenario, and kill the issue with fire by just using ArrayRef<std::string> everywhere. llvm-svn: 282281
* [llvm-cov] Delete the NonCodeLines field, it was always deadVedant Kumar2016-09-191-11/+1
| | | | llvm-svn: 281882
* [llvm-cov] Teach the coverage exporter about instantiation coverageVedant Kumar2016-09-191-16/+26
| | | | | | | While we're at it, re-use the logic from CoverageReport to compute summaries. llvm-svn: 281877
* [llvm-cov] Escape '\' in strings when emitting JSONVedant Kumar2016-07-271-2/+12
| | | | | | | Test that Windows path separators are escaped properly. Add a round-trip test to verify the JSON produced by the exporter. llvm-svn: 276832
* Retry: [llvm-cov] Add support for exporting coverage data to JSONVedant Kumar2016-07-261-0/+418
| | | | | | | | | | | | | | | | | | | | | | | | This enables users to export coverage information as portable JSON for use by analysis tools and storage in document based databases. The export sub-command is invoked just like the others: llvm-cov export -instr-profile path/to/foo.profdata path/to/foo.binary The resulting JSON contains a list of files and functions. Every file object contains a list of segments, expansions, and a summary of the file's region, function, and line coverage. Every function object contains the function's name and regions. There is also a total summary for the entire object file. Changes since the initial commit (r276813): - Fixed the regexes in the tests to handle Windows filepaths. Patch by Eddie Hurtig! Differential Revision: https://reviews.llvm.org/D22651 llvm-svn: 276818
* Revert "[llvm-cov] Add support for exporting coverage data to JSON"Vedant Kumar2016-07-261-418/+0
| | | | | | | | | This reverts commit r276813. The Windows bots are complaining about some of the filename regexes in the tests: http://bb.pgr.jp/builders/ninja-clang-i686-msc19-R/builds/5299 llvm-svn: 276816
* [llvm-cov] Add support for exporting coverage data to JSONVedant Kumar2016-07-261-0/+418
This enables users to export coverage information as portable JSON for use by analysis tools and storage in document based databases. The export sub-command is invoked just like the others: llvm-cov export -instr-profile path/to/foo.profdata path/to/foo.binary The resulting JSON contains a list of files and functions. Every file object contains a list of segments, expansions, and a summary of the file's region, function, and line coverage. Every function object contains the function's name and regions. There is also a total summary for the entire object file. Patch by Eddie Hurtig! Differential Revision: https://reviews.llvm.org/D22651 llvm-svn: 276813
OpenPOWER on IntegriCloud