summaryrefslogtreecommitdiff
path: root/tools/llvm-cov
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2017-09-21 01:11:30 +0000
committerVedant Kumar <vsk@apple.com>2017-09-21 01:11:30 +0000
commit3d39fc262434a48c12f5e9c06d7b144a0b19767d (patch)
tree9b8ed36d28da4b1a3e71accf1b9006c5b57851d8 /tools/llvm-cov
parentec61af4bcc20ba5dccff7c354b761232febbcb13 (diff)
[llvm-cov] Improve error messaging for function mismatches
Passing "-dump" to llvm-cov will now print more detailed information about function hash and counter mismatches. This should make it easier to debug *.profdata files which contain incorrect records, and to debug other scenarios where coverage goes missing due to mismatch issues. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313853 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-cov')
-rw-r--r--tools/llvm-cov/CodeCoverage.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/tools/llvm-cov/CodeCoverage.cpp b/tools/llvm-cov/CodeCoverage.cpp
index 09ee82a491e..981c93a2d95 100644
--- a/tools/llvm-cov/CodeCoverage.cpp
+++ b/tools/llvm-cov/CodeCoverage.cpp
@@ -350,9 +350,23 @@ std::unique_ptr<CoverageMapping> CodeCoverageTool::load() {
}
auto Coverage = std::move(CoverageOrErr.get());
unsigned Mismatched = Coverage->getMismatchedCount();
- if (Mismatched)
+ if (Mismatched) {
warning(utostr(Mismatched) + " functions have mismatched data");
+ if (ViewOpts.Debug) {
+ for (const auto &HashMismatch : Coverage->getHashMismatches())
+ errs() << "hash-mismatch: "
+ << "No profile record found for '" << HashMismatch.first << "'"
+ << " with hash = 0x" << utohexstr(HashMismatch.second) << "\n";
+
+ for (const auto &CounterMismatch : Coverage->getCounterMismatches())
+ errs() << "counter-mismatch: "
+ << "Coverage mapping for " << CounterMismatch.first
+ << " only has " << CounterMismatch.second
+ << " valid counter expressions\n";
+ }
+ }
+
remapPathNames(*Coverage);
if (!SourceFiles.empty())