mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-04-14 14:41:42 +03:00
[sdt] Add some tracepoints to sec and hpa modules
This commit is contained in:
parent
67435187d1
commit
d70882a05d
3 changed files with 13 additions and 5 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
#include "jemalloc/internal/jemalloc_internal_includes.h"
|
||||
|
||||
#include "jemalloc/internal/hpdata.h"
|
||||
#include "jemalloc/internal/jemalloc_probe.h"
|
||||
|
||||
static int
|
||||
hpdata_age_comp(const hpdata_t *a, const hpdata_t *b) {
|
||||
|
|
@ -102,8 +101,6 @@ hpdata_reserve_alloc(hpdata_t *hpdata, size_t sz) {
|
|||
hpdata->touched_pages, HUGEPAGE_PAGES, result, npages);
|
||||
fb_set_range(hpdata->touched_pages, HUGEPAGE_PAGES, result, npages);
|
||||
hpdata->h_ntouched += new_dirty;
|
||||
JE_USDT(hpa_reserve, 5, npages, hpdata->h_nactive, hpdata->h_ntouched,
|
||||
new_dirty, largest_unchosen_range);
|
||||
|
||||
/*
|
||||
* If we allocated out of a range that was the longest in the hpdata, it
|
||||
|
|
@ -164,8 +161,6 @@ hpdata_unreserve(hpdata_t *hpdata, void *addr, size_t sz) {
|
|||
hpdata->h_nactive -= npages;
|
||||
|
||||
hpdata_assert_consistent(hpdata);
|
||||
JE_USDT(hpa_unreserve, 5, npages, hpdata->h_nactive, hpdata->h_ntouched,
|
||||
old_longest_range, new_range_len);
|
||||
}
|
||||
|
||||
size_t
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#include "jemalloc/internal/jemalloc_internal_includes.h"
|
||||
|
||||
#include "jemalloc/internal/sec.h"
|
||||
#include "jemalloc/internal/jemalloc_probe.h"
|
||||
|
||||
static edata_t *sec_alloc(tsdn_t *tsdn, pai_t *self, size_t size,
|
||||
size_t alignment, bool zero, bool guarded, bool frequent_reuse,
|
||||
|
|
@ -266,6 +267,7 @@ sec_alloc(tsdn_t *tsdn, pai_t *self, size_t size, size_t alignment, bool zero,
|
|||
deferred_work_generated);
|
||||
}
|
||||
}
|
||||
JE_USDT(sec_alloc, 5, sec, shard, edata, size, frequent_reuse);
|
||||
return edata;
|
||||
}
|
||||
|
||||
|
|
@ -273,6 +275,7 @@ static bool
|
|||
sec_expand(tsdn_t *tsdn, pai_t *self, edata_t *edata, size_t old_size,
|
||||
size_t new_size, bool zero, bool *deferred_work_generated) {
|
||||
sec_t *sec = (sec_t *)self;
|
||||
JE_USDT(sec_expand, 4, sec, edata, old_size, new_size);
|
||||
return pai_expand(tsdn, sec->fallback, edata, old_size, new_size, zero,
|
||||
deferred_work_generated);
|
||||
}
|
||||
|
|
@ -281,6 +284,7 @@ static bool
|
|||
sec_shrink(tsdn_t *tsdn, pai_t *self, edata_t *edata, size_t old_size,
|
||||
size_t new_size, bool *deferred_work_generated) {
|
||||
sec_t *sec = (sec_t *)self;
|
||||
JE_USDT(sec_shrink, 4, sec, edata, old_size, new_size);
|
||||
return pai_shrink(tsdn, sec->fallback, edata, old_size, new_size,
|
||||
deferred_work_generated);
|
||||
}
|
||||
|
|
@ -351,6 +355,7 @@ sec_dalloc(
|
|||
return;
|
||||
}
|
||||
sec_shard_t *shard = sec_shard_pick(tsdn, sec);
|
||||
JE_USDT(sec_dalloc, 3, sec, shard, edata);
|
||||
malloc_mutex_lock(tsdn, &shard->mtx);
|
||||
if (shard->enabled) {
|
||||
sec_shard_dalloc_and_unlock(tsdn, sec, shard, edata);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue