summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Matveev <earthdok@google.com>2013-05-24 15:36:30 +0000
committerSergey Matveev <earthdok@google.com>2013-05-24 15:36:30 +0000
commit37dff38495e6123ff1902e87110351125a22ab22 (patch)
tree696c29419ea80e14bce12cfd9b5e1518b1952307
parentef50ee9ebd90cf9252c93eb7ee23e5c6304e2103 (diff)
downloadbcm5719-llvm-37dff38495e6123ff1902e87110351125a22ab22.tar.gz
bcm5719-llvm-37dff38495e6123ff1902e87110351125a22ab22.zip
[lsan] Minor adjustments to LSan messages.
llvm-svn: 182648
-rw-r--r--compiler-rt/lib/lsan/lsan_common.cc18
-rw-r--r--compiler-rt/lib/lsan/lsan_common_linux.cc8
2 files changed, 13 insertions, 13 deletions
diff --git a/compiler-rt/lib/lsan/lsan_common.cc b/compiler-rt/lib/lsan/lsan_common.cc
index 63ba4dbfda5..815e78bd1ef 100644
--- a/compiler-rt/lib/lsan/lsan_common.cc
+++ b/compiler-rt/lib/lsan/lsan_common.cc
@@ -390,31 +390,31 @@ void LeakReport::PrintLargest(uptr max_leaks) {
"reported.\n",
kMaxLeaksConsidered);
if (max_leaks > 0 && max_leaks < leaks_.size())
- Printf("The %llu largest leak%s:\n", max_leaks, max_leaks > 1 ? "s" : "");
+ Printf("The %llu largest leak(s):\n", max_leaks);
InternalSort(&leaks_, leaks_.size(), IsLarger);
max_leaks = max_leaks > 0 ? Min(max_leaks, leaks_.size()) : leaks_.size();
for (uptr i = 0; i < max_leaks; i++) {
- Printf("%s leak of %llu bytes in %llu object%s allocated from:\n",
+ Printf("%s leak of %llu byte(s) in %llu object(s) allocated from:\n",
leaks_[i].is_directly_leaked ? "Direct" : "Indirect",
- leaks_[i].total_size, leaks_[i].hit_count,
- leaks_[i].hit_count == 1 ? "" : "s");
+ leaks_[i].total_size, leaks_[i].hit_count);
PrintStackTraceById(leaks_[i].stack_trace_id);
Printf("\n");
}
if (max_leaks < leaks_.size()) {
uptr remaining = leaks_.size() - max_leaks;
- Printf("Omitting %llu more leak%s.\n", remaining,
- remaining > 1 ? "s" : "");
+ Printf("Omitting %llu more leak(s).\n", remaining);
}
}
void LeakReport::PrintSummary() {
CHECK(leaks_.size() <= kMaxLeaksConsidered);
- uptr bytes_leaked = 0;
+ uptr bytes = 0, allocations = 0;
for (uptr i = 0; i < leaks_.size(); i++) {
- bytes_leaked += leaks_[i].total_size;
+ bytes += leaks_[i].total_size;
+ allocations += leaks_[i].hit_count;
}
- Printf("SUMMARY: LeakSanitizer: %llu bytes leaked.\n", bytes_leaked);
+ Printf("SUMMARY: LeakSanitizer: %llu byte(s) leaked in %llu allocation(s).\n",
+ bytes, allocations);
}
} // namespace __lsan
#endif // CAN_SANITIZE_LEAKS
diff --git a/compiler-rt/lib/lsan/lsan_common_linux.cc b/compiler-rt/lib/lsan/lsan_common_linux.cc
index cafca17cb04..ff7eebf4980 100644
--- a/compiler-rt/lib/lsan/lsan_common_linux.cc
+++ b/compiler-rt/lib/lsan/lsan_common_linux.cc
@@ -43,11 +43,11 @@ void InitializePlatformSpecificModules() {
return;
}
if (num_matches == 0)
- Report("%s: Dynamic linker not found. TLS will not be handled correctly.\n",
- SanitizerToolName);
+ Report("LeakSanitizer: Dynamic linker not found. "
+ "TLS will not be handled correctly.\n");
else if (num_matches > 1)
- Report("%s: Multiple modules match \"%s\". TLS will not be handled "
- "correctly.\n", SanitizerToolName, kLinkerName);
+ Report("LeakSanitizer: Multiple modules match \"%s\". "
+ "TLS will not be handled correctly.\n", kLinkerName);
linker = 0;
}
OpenPOWER on IntegriCloud