Push event handlers to constituent modules

This commit is contained in:
Yinan Zhang
2020-04-17 10:38:06 -07:00
parent 381c97caa4
commit b06dfb9ccc
8 changed files with 78 additions and 57 deletions

View File

@@ -102,7 +102,7 @@ void prof_postfork_child(tsdn_t *tsdn);
/* Only accessed by thread event. */
uint64_t prof_sample_new_event_wait(tsd_t *tsd);
uint64_t prof_sample_postponed_event_wait(tsd_t *tsd);
bool prof_idump_accum(tsdn_t *tsdn, uint64_t accumbytes);
void prof_sample_event_handler(tsd_t *tsd, uint64_t elapsed);
bool prof_log_start(tsdn_t *tsdn, const char *filename);
bool prof_log_stop(tsdn_t *tsdn);

View File

@@ -40,7 +40,7 @@ extern char opt_stats_interval_opts[stats_print_tot_num_options+1];
/* Only accessed by thread event. */
uint64_t stats_interval_new_event_wait(tsd_t *tsd);
uint64_t stats_interval_postponed_event_wait(tsd_t *tsd);
bool stats_interval_accum(tsd_t *tsd, uint64_t bytes);
void stats_interval_event_handler(tsd_t *tsd, uint64_t elapsed);
/* Implements je_malloc_stats_print. */
void stats_print(write_cb_t *write_cb, void *cbopaque, const char *opts);

View File

@@ -56,9 +56,9 @@ void tcache_assert_initialized(tcache_t *tcache);
/* Only accessed by thread event. */
uint64_t tcache_gc_new_event_wait(tsd_t *tsd);
uint64_t tcache_gc_postponed_event_wait(tsd_t *tsd);
void tcache_gc_event_handler(tsd_t *tsd, uint64_t elapsed);
uint64_t tcache_gc_dalloc_new_event_wait(tsd_t *tsd);
uint64_t tcache_gc_dalloc_postponed_event_wait(tsd_t *tsd);
void tcache_event_hard(tsd_t *tsd, tcache_slow_t *tcache_slow,
tcache_t *tcache);
void tcache_gc_dalloc_event_handler(tsd_t *tsd, uint64_t elapsed);
#endif /* JEMALLOC_INTERNAL_TCACHE_EXTERNS_H */

View File

@@ -23,6 +23,12 @@
*/
#define TE_MAX_INTERVAL ((uint64_t)(4U << 20))
/*
* Invalid elapsed time, for situations where elapsed time is not needed. See
* comments in thread_event.c for more info.
*/
#define TE_INVALID_ELAPSED UINT64_MAX
typedef struct te_ctx_s {
bool is_alloc;
uint64_t *current;