[compiler-rt] 85c622b - [scudo] Improve Secondary Cache Dump

Chia-hung Duan via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 30 13:57:12 PDT 2023


Author: fernandosalas
Date: 2023-06-30T20:55:41Z
New Revision: 85c622b5978ff1209130aff0634aa770de5d86ef

URL: https://github.com/llvm/llvm-project/commit/85c622b5978ff1209130aff0634aa770de5d86ef
DIFF: https://github.com/llvm/llvm-project/commit/85c622b5978ff1209130aff0634aa770de5d86ef.diff

LOG: [scudo] Improve Secondary Cache Dump

Exclude cached blocks with invalid start address. Mainly concerned with
cached blocks that are still available/unused.

Reviewed By: Chia-hungDuan, cferris

Differential Revision: https://reviews.llvm.org/D154148

Added: 
    

Modified: 
    compiler-rt/lib/scudo/standalone/secondary.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/scudo/standalone/secondary.h b/compiler-rt/lib/scudo/standalone/secondary.h
index 5217b7112e92f..105b154b5de26 100644
--- a/compiler-rt/lib/scudo/standalone/secondary.h
+++ b/compiler-rt/lib/scudo/standalone/secondary.h
@@ -143,9 +143,11 @@ template <typename Config> class MapAllocatorCache {
                 EntriesCount, atomic_load_relaxed(&MaxEntriesCount),
                 atomic_load_relaxed(&MaxEntrySize));
     for (CachedBlock Entry : Entries) {
+      if (!Entry.CommitBase)
+        continue;
       Str->append("StartBlockAddress: 0x%zx, EndBlockAddress: 0x%zx, "
                   "BlockSize: %zu\n",
-                  Entry.CommitBase, (Entry.CommitBase + Entry.CommitSize),
+                  Entry.CommitBase, Entry.CommitBase + Entry.CommitSize,
                   Entry.CommitSize);
     }
   }


        


More information about the llvm-commits mailing list