Skip to content

Commit a8d2aee

Browse files
authored
[scudo] Fix the format of getStats() (#121608)
This is a quick fix for b71c44b "last released" was removed by accident in primary64.h and the update of "NumReleasesAttempted" was missing.
1 parent 251ef3f commit a8d2aee

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

compiler-rt/lib/scudo/standalone/primary64.h

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,18 +1141,18 @@ template <typename Config> class SizeClassAllocator64 {
11411141
BytesInFreeList - Region->ReleaseInfo.BytesInFreeListAtLastCheckpoint;
11421142
}
11431143
const uptr TotalChunks = Region->MemMapInfo.AllocatedUser / BlockSize;
1144-
Str->append(
1145-
"%s %02zu (%6zu): mapped: %6zuK popped: %7zu pushed: %7zu "
1146-
"inuse: %6zu total: %6zu releases: %6zu last "
1147-
"releases attempted: %6zuK latest pushed bytes: %6zuK region: 0x%zx "
1148-
"(0x%zx)\n",
1149-
Region->Exhausted ? "E" : " ", ClassId, getSizeByClassId(ClassId),
1150-
Region->MemMapInfo.MappedUser >> 10, Region->FreeListInfo.PoppedBlocks,
1151-
Region->FreeListInfo.PushedBlocks, InUseBlocks, TotalChunks,
1152-
Region->ReleaseInfo.NumReleasesAttempted,
1153-
Region->ReleaseInfo.LastReleasedBytes >> 10,
1154-
RegionPushedBytesDelta >> 10, Region->RegionBeg,
1155-
getRegionBaseByClassId(ClassId));
1144+
Str->append("%s %02zu (%6zu): mapped: %6zuK popped: %7zu pushed: %7zu "
1145+
"inuse: %6zu total: %6zu releases attempted: %6zu last "
1146+
"released: %6zuK latest pushed bytes: %6zuK region: 0x%zx "
1147+
"(0x%zx)\n",
1148+
Region->Exhausted ? "E" : " ", ClassId,
1149+
getSizeByClassId(ClassId), Region->MemMapInfo.MappedUser >> 10,
1150+
Region->FreeListInfo.PoppedBlocks,
1151+
Region->FreeListInfo.PushedBlocks, InUseBlocks, TotalChunks,
1152+
Region->ReleaseInfo.NumReleasesAttempted,
1153+
Region->ReleaseInfo.LastReleasedBytes >> 10,
1154+
RegionPushedBytesDelta >> 10, Region->RegionBeg,
1155+
getRegionBaseByClassId(ClassId));
11561156
}
11571157

11581158
void getRegionFragmentationInfo(RegionInfo *Region, uptr ClassId,
@@ -1297,6 +1297,10 @@ template <typename Config> class SizeClassAllocator64 {
12971297
return 0;
12981298
}
12991299

1300+
// The following steps contribute to the majority time spent in page
1301+
// releasing thus we increment the counter here.
1302+
++Region->ReleaseInfo.NumReleasesAttempted;
1303+
13001304
// Note that we have extracted the `GroupsToRelease` from region freelist.
13011305
// It's safe to let pushBlocks()/popBlocks() access the remaining region
13021306
// freelist. In the steps 3 and 4, we will temporarily release the FLLock

0 commit comments

Comments
 (0)