[sdt] Add some tracepoints to sec and hpa modules

This commit is contained in:
Slobodan Predolac 2025-08-07 09:34:30 -07:00 committed by Guangli Dai
parent d0287ffda4
commit dde70db2dc
3 changed files with 13 additions and 5 deletions

View file

@ -6,6 +6,7 @@
#include "jemalloc/internal/fb.h"
#include "jemalloc/internal/witness.h"
#include "jemalloc/internal/jemalloc_probe.h"
#define HPA_EDEN_SIZE (128 * HUGEPAGE)
@ -752,6 +753,8 @@ hpa_try_alloc_one_no_grow(
}
void *addr = hpdata_reserve_alloc(ps, size);
JE_USDT(hpa_alloc, 5, shard->ind, addr, size, hpdata_nactive_get(ps),
hpdata_age_get(ps));
edata_init(edata, shard->ind, addr, size, /* slab */ false, SC_NSIZES,
/* sn */ hpdata_age_get(ps), extent_state_active,
/* zeroed */ false, /* committed */ true, EXTENT_PAI_HPA,
@ -771,6 +774,9 @@ hpa_try_alloc_one_no_grow(
if (err) {
hpdata_unreserve(
ps, edata_addr_get(edata), edata_size_get(edata));
JE_USDT(hpa_dalloc_err, 5, shard->ind, edata_addr_get(edata),
edata_size_get(edata), hpdata_nactive_get(ps),
hpdata_age_get(ps));
/*
* We should arguably reset dirty state here, but this would
* require some sort of prepare + commit functionality that's a
@ -1024,6 +1030,8 @@ hpa_dalloc_locked(tsdn_t *tsdn, hpa_shard_t *shard, edata_t *edata) {
psset_update_begin(&shard->psset, ps);
hpdata_unreserve(ps, unreserve_addr, unreserve_size);
JE_USDT(hpa_dalloc, 5, shard->ind, unreserve_addr, unreserve_size,
hpdata_nactive_get(ps), hpdata_age_get(ps));
hpa_update_purge_hugify_eligibility(tsdn, shard, ps);
psset_update_end(&shard->psset, ps);
}