Fix duplicate "nactive_huge" JSON key in HPA shard stats output

In both the full_slabs and empty_slabs JSON sections of HPA shard
stats, "nactive_huge" was emitted twice instead of emitting
"ndirty_huge" as the second entry. This caused ndirty_huge to be
missing from the JSON output entirely.

Add a unit test that verifies both sections contain "ndirty_huge".
This commit is contained in:
Slobodan Predolac 2026-03-27 09:02:32 -07:00
parent 513778bcb1
commit 87f9938de5
2 changed files with 74 additions and 3 deletions

View file

@ -981,7 +981,7 @@ stats_arena_hpa_shard_slabs_print(emitter_t *emitter, unsigned i) {
emitter_json_kv(
emitter, "nactive_huge", emitter_type_size, &nactive_huge);
emitter_json_kv(
emitter, "nactive_huge", emitter_type_size, &nactive_huge);
emitter, "ndirty_huge", emitter_type_size, &ndirty_huge);
emitter_json_kv(emitter, "npageslabs_nonhuge", emitter_type_size,
&npageslabs_nonhuge);
emitter_json_kv(
@ -1022,7 +1022,7 @@ stats_arena_hpa_shard_slabs_print(emitter_t *emitter, unsigned i) {
emitter_json_kv(
emitter, "nactive_huge", emitter_type_size, &nactive_huge);
emitter_json_kv(
emitter, "nactive_huge", emitter_type_size, &nactive_huge);
emitter, "ndirty_huge", emitter_type_size, &ndirty_huge);
emitter_json_kv(emitter, "npageslabs_nonhuge", emitter_type_size,
&npageslabs_nonhuge);
emitter_json_kv(