Fix wrong mutex stats in json-formatted malloc stats

During mutex stats emit, derived counters are not emitted for json.
Yet the array indexing counter should still be increased to skip
derived elements in the output, which was not. This commit fixes it.
This commit is contained in:
guangli-dai 2026-02-18 17:39:57 -08:00 committed by Guangli Dai
parent 79cc7dcc82
commit 12b33ed8f1

View file

@ -260,10 +260,10 @@ mutex_stats_emit(emitter_t *emitter, emitter_row_t *row,
#define OP(counter, type, human, derived, base_counter) \ #define OP(counter, type, human, derived, base_counter) \
if (!derived) { \ if (!derived) { \
col = &col_##type[k_##type]; \ col = &col_##type[k_##type]; \
++k_##type; \
emitter_json_kv(emitter, #counter, EMITTER_TYPE_##type, \ emitter_json_kv(emitter, #counter, EMITTER_TYPE_##type, \
(const void *)&col->bool_val); \ (const void *)&col->bool_val); \
} } \
++k_##type;
MUTEX_PROF_COUNTERS; MUTEX_PROF_COUNTERS;
#undef OP #undef OP
#undef EMITTER_TYPE_uint32_t #undef EMITTER_TYPE_uint32_t