Skip to content
This repository was archived by the owner on May 21, 2019. It is now read-only.

Commit 8e66cf5

Browse files
committed
[lsan] Minor adjustments to LSan messages.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182648 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 6c3634b commit 8e66cf5

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

lib/lsan/lsan_common.cc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -390,31 +390,31 @@ void LeakReport::PrintLargest(uptr max_leaks) {
390390
"reported.\n",
391391
kMaxLeaksConsidered);
392392
if (max_leaks > 0 && max_leaks < leaks_.size())
393-
Printf("The %llu largest leak%s:\n", max_leaks, max_leaks > 1 ? "s" : "");
393+
Printf("The %llu largest leak(s):\n", max_leaks);
394394
InternalSort(&leaks_, leaks_.size(), IsLarger);
395395
max_leaks = max_leaks > 0 ? Min(max_leaks, leaks_.size()) : leaks_.size();
396396
for (uptr i = 0; i < max_leaks; i++) {
397-
Printf("%s leak of %llu bytes in %llu object%s allocated from:\n",
397+
Printf("%s leak of %llu byte(s) in %llu object(s) allocated from:\n",
398398
leaks_[i].is_directly_leaked ? "Direct" : "Indirect",
399-
leaks_[i].total_size, leaks_[i].hit_count,
400-
leaks_[i].hit_count == 1 ? "" : "s");
399+
leaks_[i].total_size, leaks_[i].hit_count);
401400
PrintStackTraceById(leaks_[i].stack_trace_id);
402401
Printf("\n");
403402
}
404403
if (max_leaks < leaks_.size()) {
405404
uptr remaining = leaks_.size() - max_leaks;
406-
Printf("Omitting %llu more leak%s.\n", remaining,
407-
remaining > 1 ? "s" : "");
405+
Printf("Omitting %llu more leak(s).\n", remaining);
408406
}
409407
}
410408

411409
void LeakReport::PrintSummary() {
412410
CHECK(leaks_.size() <= kMaxLeaksConsidered);
413-
uptr bytes_leaked = 0;
411+
uptr bytes = 0, allocations = 0;
414412
for (uptr i = 0; i < leaks_.size(); i++) {
415-
bytes_leaked += leaks_[i].total_size;
413+
bytes += leaks_[i].total_size;
414+
allocations += leaks_[i].hit_count;
416415
}
417-
Printf("SUMMARY: LeakSanitizer: %llu bytes leaked.\n", bytes_leaked);
416+
Printf("SUMMARY: LeakSanitizer: %llu byte(s) leaked in %llu allocation(s).\n",
417+
bytes, allocations);
418418
}
419419
} // namespace __lsan
420420
#endif // CAN_SANITIZE_LEAKS

lib/lsan/lsan_common_linux.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ void InitializePlatformSpecificModules() {
4343
return;
4444
}
4545
if (num_matches == 0)
46-
Report("%s: Dynamic linker not found. TLS will not be handled correctly.\n",
47-
SanitizerToolName);
46+
Report("LeakSanitizer: Dynamic linker not found. "
47+
"TLS will not be handled correctly.\n");
4848
else if (num_matches > 1)
49-
Report("%s: Multiple modules match \"%s\". TLS will not be handled "
50-
"correctly.\n", SanitizerToolName, kLinkerName);
49+
Report("LeakSanitizer: Multiple modules match \"%s\". "
50+
"TLS will not be handled correctly.\n", kLinkerName);
5151
linker = 0;
5252
}
5353

0 commit comments

Comments
 (0)