added stats

This commit is contained in:
Tony Printezis 2026-04-08 11:16:19 -07:00
parent c0e2a93e4d
commit 52e72a04a1
5 changed files with 109 additions and 3 deletions

View file

@ -178,6 +178,9 @@ TEST_BEGIN(test_hpa_sec) {
expect_zu_eq(hpa_stats.psset_stats.merged.nactive, target_nallocs, "");
expect_zu_eq(hpa_stats.secstats.bytes, (target_nallocs - 1) * PAGE,
"sec should have extra pages");
expect_zu_eq(
hpa_stats.nonderived_stats.alloc_batch_nallocs[target_nallocs], 1,
"");
/* Alloc/dealloc NALLOCS times and confirm extents are in sec. */
edata_t *edatas[NALLOCS];
@ -193,6 +196,11 @@ TEST_BEGIN(test_hpa_sec) {
hpa_stats.psset_stats.merged.nactive, expected_nactive, "");
expect_zu_eq(hpa_stats.secstats.bytes, (target_nallocs - 1) * PAGE,
"multiple refills (every target_nallocs allocations)");
const size_t expected_nsuccesses = (NALLOCS + 1 + target_nallocs - 1)
/ target_nallocs;
expect_zu_eq(
hpa_stats.nonderived_stats.alloc_batch_nallocs[target_nallocs],
expected_nsuccesses, "");
for (int i = 0; i < NALLOCS - 1; i++) {
pai_dalloc(