aboutsummaryrefslogtreecommitdiff
path: root/include/jemalloc/internal/prof.h
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2015-01-25 21:16:57 -0800
committerJason Evans <jasone@canonware.com>2015-01-25 21:21:35 -0800
commit5b8ed5b7c91939f64f14fc48be84ed20e3f023f4 (patch)
tree27e35ebb42a1fa6e5dbe7f234624ed7c5362a349 /include/jemalloc/internal/prof.h
parent41f2e692f664da683ae694b17630f5e186aa454c (diff)
downloadjemalloc-5b8ed5b7c91939f64f14fc48be84ed20e3f023f4.tar.gz
Implement the prof.gdump mallctl.
This feature makes it possible to toggle the gdump feature on/off during program execution, whereas the the opt.prof_dump mallctl value can only be set during program startup. This resolves #72.
Diffstat (limited to 'include/jemalloc/internal/prof.h')
-rw-r--r--include/jemalloc/internal/prof.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/jemalloc/internal/prof.h b/include/jemalloc/internal/prof.h
index e081884..b2db685 100644
--- a/include/jemalloc/internal/prof.h
+++ b/include/jemalloc/internal/prof.h
@@ -239,6 +239,9 @@ extern char opt_prof_prefix[
/* Accessed via prof_active_[gs]et{_unlocked,}(). */
extern bool prof_active;
+/* Accessed via prof_gdump_[gs]et{_unlocked,}(). */
+extern bool prof_gdump_val;
+
/*
* Profile dump interval, measured in bytes allocated. Each arena triggers a
* profile dump when it reaches this threshold. The effect is that the
@@ -285,6 +288,8 @@ bool prof_thread_active_get(void);
bool prof_thread_active_set(bool active);
bool prof_thread_active_init_get(void);
bool prof_thread_active_init_set(bool active_init);
+bool prof_gdump_get(void);
+bool prof_gdump_set(bool active);
void prof_boot0(void);
void prof_boot1(void);
bool prof_boot2(void);
@@ -299,6 +304,7 @@ void prof_sample_threshold_update(prof_tdata_t *tdata);
#ifndef JEMALLOC_ENABLE_INLINE
bool prof_active_get_unlocked(void);
+bool prof_gdump_get_unlocked(void);
prof_tdata_t *prof_tdata_get(tsd_t *tsd, bool create);
bool prof_sample_accum_update(tsd_t *tsd, size_t usize, bool commit,
prof_tdata_t **tdata_out);
@@ -327,6 +333,18 @@ prof_active_get_unlocked(void)
return (prof_active);
}
+JEMALLOC_ALWAYS_INLINE bool
+prof_gdump_get_unlocked(void)
+{
+
+ /*
+ * No locking is used when reading prof_gdump_val in the fast path, so
+ * there are no guarantees regarding how long it will take for all
+ * threads to notice state changes.
+ */
+ return (prof_gdump_val);
+}
+
JEMALLOC_ALWAYS_INLINE prof_tdata_t *
prof_tdata_get(tsd_t *tsd, bool create)
{