Do not repeat reentrancy test in profiling

This commit is contained in:
Yinan Zhang 2020-08-24 20:56:34 -07:00
parent 20f2479ed7
commit 866231fc61

View File

@ -1,5 +1,5 @@
#ifndef JEMALLOC_INTERNAL_PROF_INLINES_B_H #ifndef JEMALLOC_INTERNAL_PROF_INLINES_H
#define JEMALLOC_INTERNAL_PROF_INLINES_B_H #define JEMALLOC_INTERNAL_PROF_INLINES_H
#include "jemalloc/internal/safety_check.h" #include "jemalloc/internal/safety_check.h"
#include "jemalloc/internal/sz.h" #include "jemalloc/internal/sz.h"
@ -115,9 +115,12 @@ prof_sample_should_skip(tsd_t *tsd, bool sample_event) {
return true; return true;
} }
if (tsd_reentrancy_level_get(tsd) > 0) { /*
return true; * sample_event is always obtained from the thread event module, and
} * whenever it's true, it means that the thread event module has
* already checked the reentrancy level.
*/
assert(tsd_reentrancy_level_get(tsd) == 0);
prof_tdata_t *tdata = prof_tdata_get(tsd, true); prof_tdata_t *tdata = prof_tdata_get(tsd, true);
if (unlikely(tdata == NULL)) { if (unlikely(tdata == NULL)) {
@ -255,4 +258,4 @@ prof_free(tsd_t *tsd, const void *ptr, size_t usize,
} }
} }
#endif /* JEMALLOC_INTERNAL_PROF_INLINES_B_H */ #endif /* JEMALLOC_INTERNAL_PROF_INLINES_H */