[compiler-rt] a4b92d6 - [memprof] Remove the "Live on exit:" print for text format.
Snehasish Kumar via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 22 13:31:45 PST 2021
Author: Snehasish Kumar
Date: 2021-11-22T13:30:48-08:00
New Revision: a4b92d61580d9a1ef9f4946ffe8d0bb6949596a8
URL: https://github.com/llvm/llvm-project/commit/a4b92d61580d9a1ef9f4946ffe8d0bb6949596a8
DIFF: https://github.com/llvm/llvm-project/commit/a4b92d61580d9a1ef9f4946ffe8d0bb6949596a8.diff
LOG: [memprof] Remove the "Live on exit:" print for text format.
We dropped the printing of live on exit blocks in rG1243cef245f6 -
the commit changed the insertOrMerge logic. Remove the message since it
is no longer needed (all live blocks are inserted into the hashmap)
before serializing/printing the profile. Furthermore, the original
intent was to capture evicted blocks so it wasn't entirely correct.
Also update the binary format test invocation to remove the redundant
print_text directive now that it is the default.
Differential Revision: https://reviews.llvm.org/D114285
Added:
Modified:
compiler-rt/lib/memprof/memprof_allocator.cpp
compiler-rt/test/memprof/TestCases/memprof_profile_dump.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/memprof/memprof_allocator.cpp b/compiler-rt/lib/memprof/memprof_allocator.cpp
index 696f64d8c324a..059ce283b8c93 100644
--- a/compiler-rt/lib/memprof/memprof_allocator.cpp
+++ b/compiler-rt/lib/memprof/memprof_allocator.cpp
@@ -252,6 +252,8 @@ struct Allocator {
InsertLiveBlocks();
if (print_text) {
+ if (!flags()->print_terse)
+ Printf("Recorded MIBs (incl. live on exit):\n");
MIBMap.ForEach(PrintCallback,
reinterpret_cast<void *>(flags()->print_terse));
StackDepotPrintAll();
@@ -271,9 +273,6 @@ struct Allocator {
// Inserts any blocks which have been allocated but not yet deallocated.
void InsertLiveBlocks() {
- if (print_text && !flags()->print_terse)
- Printf("Live on exit:\n");
-
allocator.ForEachChunk(
[](uptr chunk, void *alloc) {
u64 user_requested_size;
diff --git a/compiler-rt/test/memprof/TestCases/memprof_profile_dump.cpp b/compiler-rt/test/memprof/TestCases/memprof_profile_dump.cpp
index b843f904d867c..be0f5d5e113f4 100644
--- a/compiler-rt/test/memprof/TestCases/memprof_profile_dump.cpp
+++ b/compiler-rt/test/memprof/TestCases/memprof_profile_dump.cpp
@@ -1,7 +1,7 @@
-// RUN: %clangxx_memprof %s -o %t
+// RUN: %clangxx_memprof %s -o %t
// RUN: %env_memprof_opts=print_text=true:log_path=stdout %run %t | FileCheck --check-prefix=CHECK-TEXT %s
-// RUN: %env_memprof_opts=print_text=true:log_path=stdout,print_text=false %run %t > %t.memprofraw
+// RUN: %env_memprof_opts=log_path=stdout %run %t > %t.memprofraw
// RUN: od -c -N 8 %t.memprofraw | FileCheck --check-prefix=CHECK-RAW %s
#include <sanitizer/memprof_interface.h>
@@ -19,8 +19,12 @@ int main(int argc, char **argv) {
}
// We should get 2 rounds of profile info, one from the explicit dump request,
// and one at exit.
+//
+// CHECK-TEXT: Recorded MIBs (incl. live on exit):
// CHECK-TEXT: Memory allocation stack id
// CHECK-TEXT: Stack for id
+//
+// CHECK-TEXT: Recorded MIBs (incl. live on exit):
// CHECK-TEXT: Memory allocation stack id
// CHECK-TEXT: Stack for id
//
More information about the llvm-commits
mailing list