Skip to main content

JemallocProfCtlExt

Trait JemallocProfCtlExt 

Source
pub trait JemallocProfCtlExt {
    // Required methods
    fn dump_stats(&mut self, json_format: bool) -> Result<String>;
    fn stats(&self) -> Result<JemallocStats>;
    fn pause(&self) -> Result<()>;
    fn resume(&self) -> Result<()>;
}

Required Methods§

Source

fn dump_stats(&mut self, json_format: bool) -> Result<String>

Source

fn stats(&self) -> Result<JemallocStats>

Source

fn pause(&self) -> Result<()>

Pauses allocation sampling by clearing jemalloc’s prof.active mallctl.

Unlike JemallocProfCtl::deactivate, this leaves prof.reset untouched, so the profile accumulated so far and the profiling metadata (start time, sample rate) survive. Pair with resume to keep extending the same profile. Use this to briefly stop sampling, for example while capturing a CPU profile, without discarding the heap profile collected so far. A caller that intends to start a fresh profile wants JemallocProfCtl::deactivate instead.

Takes &self deliberately: pausing does not touch the tracked metadata, only the global mallctl.

Source

fn resume(&self) -> Result<()>

Resumes allocation sampling by setting jemalloc’s prof.active mallctl.

The counterpart to pause. Sampling continues into the profile that pause preserved.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl JemallocProfCtlExt for JemallocProfCtl

Source§

fn dump_stats(&mut self, json_format: bool) -> Result<String>

Source§

fn stats(&self) -> Result<JemallocStats>

Source§

fn pause(&self) -> Result<()>

Source§

fn resume(&self) -> Result<()>

Implementors§