summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChiaHungDuan <chiahungduan@google.com>2024-03-28 15:28:01 -0700
committerCopybara-Service <copybara-worker@google.com>2024-03-28 15:34:20 -0700
commit2a7116c927c51b928cfc2d10280beb27a744da03 (patch)
tree32863bddcb386cc1cf2fd9cbc922f8a076ef0b17
parent6f702b833d714a2225f72dc86e7e0edb1dc77d77 (diff)
downloadscudo-2a7116c927c51b928cfc2d10280beb27a744da03.tar.gz
[scudo] Dump ReleaseToOsIntervalMs (#86887)
This can be adjusted during runtime and it may impact the memory footprint if it's set to a big value or is disabled. GitOrigin-RevId: 6b149f70abc2d0214cc29e7a2aeea428d3719491 Change-Id: I8e18f40c2a6df8e2ba8764011846a7eff08010cb
-rw-r--r--standalone/primary64.h5
-rw-r--r--standalone/secondary.h10
2 files changed, 9 insertions, 6 deletions
diff --git a/standalone/primary64.h b/standalone/primary64.h
index f5e4ab57b4d..abce4bff321 100644
--- a/standalone/primary64.h
+++ b/standalone/primary64.h
@@ -372,10 +372,11 @@ public:
PushedBlocks += Region->FreeListInfo.PushedBlocks;
}
}
+ const s32 IntervalMs = atomic_load_relaxed(&ReleaseToOsIntervalMs);
Str->append("Stats: SizeClassAllocator64: %zuM mapped (%uM rss) in %zu "
- "allocations; remains %zu\n",
+ "allocations; remains %zu; ReleaseToOsIntervalMs = %d\n",
TotalMapped >> 20, 0U, PoppedBlocks,
- PoppedBlocks - PushedBlocks);
+ PoppedBlocks - PushedBlocks, IntervalMs >= 0 ? IntervalMs : -1);
for (uptr I = 0; I < NumClasses; I++) {
RegionInfo *Region = getRegionInfo(I);
diff --git a/standalone/secondary.h b/standalone/secondary.h
index 202c55cc1a9..674af507177 100644
--- a/standalone/secondary.h
+++ b/standalone/secondary.h
@@ -179,10 +179,12 @@ public:
uptr Fractional;
computePercentage(SuccessfulRetrieves, CallsToRetrieve, &Integral,
&Fractional);
- Str->append("Stats: MapAllocatorCache: EntriesCount: %d, "
- "MaxEntriesCount: %u, MaxEntrySize: %zu\n",
- EntriesCount, atomic_load_relaxed(&MaxEntriesCount),
- atomic_load_relaxed(&MaxEntrySize));
+ const s32 Interval = atomic_load_relaxed(&ReleaseToOsIntervalMs);
+ Str->append(
+ "Stats: MapAllocatorCache: EntriesCount: %d, "
+ "MaxEntriesCount: %u, MaxEntrySize: %zu, ReleaseToOsIntervalMs = %d\n",
+ EntriesCount, atomic_load_relaxed(&MaxEntriesCount),
+ atomic_load_relaxed(&MaxEntrySize), Interval >= 0 ? Interval : -1);
Str->append("Stats: CacheRetrievalStats: SuccessRate: %u/%u "
"(%zu.%02zu%%)\n",
SuccessfulRetrieves, CallsToRetrieve, Integral, Fractional);