Add missing jemalloc profiling interface mallctl's.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2026-03-08 03:29:00 +00:00
parent d2836e9f50
commit 31e7dc2735

View File

@@ -304,6 +304,12 @@ pub fn stats_reset() -> Result { notify(&mallctl!("stats.mutexes.reset")) }
pub fn prof_reset() -> Result { notify(&mallctl!("prof.reset")) } pub fn prof_reset() -> Result { notify(&mallctl!("prof.reset")) }
pub fn prof_dump() -> Result { notify(&mallctl!("prof.dump")) }
pub fn prof_gdump(enable: bool) -> Result<bool> {
set::<u8>(&mallctl!("prof.gdump"), enable.into()).map(is_nonzero!())
}
pub fn prof_enable(enable: bool) -> Result<bool> { pub fn prof_enable(enable: bool) -> Result<bool> {
set::<u8>(&mallctl!("prof.active"), enable.into()).map(is_nonzero!()) set::<u8>(&mallctl!("prof.active"), enable.into()).map(is_nonzero!())
} }
@@ -312,6 +318,10 @@ pub fn is_prof_enabled() -> Result<bool> {
get::<u8>(&mallctl!("prof.active")).map(is_nonzero!()) get::<u8>(&mallctl!("prof.active")).map(is_nonzero!())
} }
pub fn prof_interval() -> Result<u64> {
get::<u64>(&mallctl!("prof.interval")).and_then(math::try_into)
}
pub fn trim<I: Into<Option<usize>> + Copy>(arena: I) -> Result { pub fn trim<I: Into<Option<usize>> + Copy>(arena: I) -> Result {
decay(arena).and_then(|()| purge(arena)) decay(arena).and_then(|()| purge(arena))
} }