Control idump and gdump with prof_active.
This commit is contained in:
parent
6d02421730
commit
2dccf45640
@ -25,7 +25,7 @@ static inline bool
|
|||||||
arena_prof_accum(tsdn_t *tsdn, arena_t *arena, uint64_t accumbytes) {
|
arena_prof_accum(tsdn_t *tsdn, arena_t *arena, uint64_t accumbytes) {
|
||||||
cassert(config_prof);
|
cassert(config_prof);
|
||||||
|
|
||||||
if (likely(prof_interval == 0)) {
|
if (likely(prof_interval == 0 || !prof_active_get_unlocked())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,4 +69,15 @@ prof_accum_cancel(tsdn_t *tsdn, prof_accum_t *prof_accum, size_t usize) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JEMALLOC_ALWAYS_INLINE bool
|
||||||
|
prof_active_get_unlocked(void) {
|
||||||
|
/*
|
||||||
|
* Even if opt_prof is true, sampling can be temporarily disabled by
|
||||||
|
* setting prof_active to false. No locking is used when reading
|
||||||
|
* prof_active in the fast path, so there are no guarantees regarding
|
||||||
|
* how long it will take for all threads to notice state changes.
|
||||||
|
*/
|
||||||
|
return prof_active;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* JEMALLOC_INTERNAL_PROF_INLINES_A_H */
|
#endif /* JEMALLOC_INTERNAL_PROF_INLINES_A_H */
|
||||||
|
@ -3,17 +3,6 @@
|
|||||||
|
|
||||||
#include "jemalloc/internal/sz.h"
|
#include "jemalloc/internal/sz.h"
|
||||||
|
|
||||||
JEMALLOC_ALWAYS_INLINE bool
|
|
||||||
prof_active_get_unlocked(void) {
|
|
||||||
/*
|
|
||||||
* Even if opt_prof is true, sampling can be temporarily disabled by
|
|
||||||
* setting prof_active to false. No locking is used when reading
|
|
||||||
* prof_active in the fast path, so there are no guarantees regarding
|
|
||||||
* how long it will take for all threads to notice state changes.
|
|
||||||
*/
|
|
||||||
return prof_active;
|
|
||||||
}
|
|
||||||
|
|
||||||
JEMALLOC_ALWAYS_INLINE bool
|
JEMALLOC_ALWAYS_INLINE bool
|
||||||
prof_gdump_get_unlocked(void) {
|
prof_gdump_get_unlocked(void) {
|
||||||
/*
|
/*
|
||||||
|
@ -1780,7 +1780,7 @@ prof_idump(tsdn_t *tsdn) {
|
|||||||
|
|
||||||
cassert(config_prof);
|
cassert(config_prof);
|
||||||
|
|
||||||
if (!prof_booted || tsdn_null(tsdn)) {
|
if (!prof_booted || tsdn_null(tsdn) || !prof_active_get_unlocked()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tsd = tsdn_tsd(tsdn);
|
tsd = tsdn_tsd(tsdn);
|
||||||
@ -1837,7 +1837,7 @@ prof_gdump(tsdn_t *tsdn) {
|
|||||||
|
|
||||||
cassert(config_prof);
|
cassert(config_prof);
|
||||||
|
|
||||||
if (!prof_booted || tsdn_null(tsdn)) {
|
if (!prof_booted || tsdn_null(tsdn) || !prof_active_get_unlocked()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tsd = tsdn_tsd(tsdn);
|
tsd = tsdn_tsd(tsdn);
|
||||||
|
Loading…
Reference in New Issue
Block a user