mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-25 08:33:38 +03:00
Push event handlers to constituent modules
This commit is contained in:
parent
381c97caa4
commit
b06dfb9ccc
8 changed files with 78 additions and 57 deletions
14
src/stats.c
14
src/stats.c
|
|
@ -1493,11 +1493,6 @@ stats_print(write_cb_t *write_cb, void *cbopaque, const char *opts) {
|
|||
emitter_end(&emitter);
|
||||
}
|
||||
|
||||
bool
|
||||
stats_interval_accum(tsd_t *tsd, uint64_t bytes) {
|
||||
return counter_accum(tsd_tsdn(tsd), &stats_interval_accumulated, bytes);
|
||||
}
|
||||
|
||||
uint64_t
|
||||
stats_interval_new_event_wait(tsd_t *tsd) {
|
||||
return stats_interval_accum_batch;
|
||||
|
|
@ -1508,6 +1503,15 @@ stats_interval_postponed_event_wait(tsd_t *tsd) {
|
|||
return TE_MIN_START_WAIT;
|
||||
}
|
||||
|
||||
void
|
||||
stats_interval_event_handler(tsd_t *tsd, uint64_t elapsed) {
|
||||
assert(elapsed > 0 && elapsed != TE_INVALID_ELAPSED);
|
||||
if (counter_accum(tsd_tsdn(tsd), &stats_interval_accumulated,
|
||||
elapsed)) {
|
||||
je_malloc_stats_print(NULL, NULL, opt_stats_interval_opts);
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
stats_boot(void) {
|
||||
uint64_t stats_interval;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue