Rewrite profiling thread event

This commit is contained in:
Yinan Zhang
2020-03-09 15:49:15 -07:00
parent 0dcd576600
commit 441d88d1c7
6 changed files with 31 additions and 68 deletions

View File

@@ -78,17 +78,7 @@ te_prof_sample_event_handler(tsd_t *tsd) {
if (prof_idump_accum(tsd_tsdn(tsd), last_event - last_sample_event)) {
prof_idump(tsd_tsdn(tsd));
}
if (!prof_active_get_unlocked()) {
/*
* If prof_active is off, we reset prof_sample_event_wait to be
* the sample interval when it drops to 0, so that there won't
* be excessive routings to the slow path, and that when
* prof_active is turned on later, the counting for sampling
* can immediately resume as normal.
*/
te_prof_sample_event_update(tsd,
(uint64_t)(1 << lg_prof_sample));
}
te_tsd_prof_sample_event_init(tsd);
}
static void