Skip to content

Commit bb3bf17

Browse files
committed
add opt.prof
Signed-off-by: Yuhao Su <yuhaosu@outlook.com>
1 parent 4914c5d commit bb3bf17

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

jemalloc-ctl/dump

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
heap_v2/524288
2+
t*: 0: 0 [0: 0]
3+
t0: 0: 0 [0: 0]

jemalloc-ctl/src/opt.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,3 +215,24 @@ option! {
215215
/// ```
216216
mib_docs: /// See [`background_thread`].
217217
}
218+
219+
option! {
220+
prof[ str: b"opt.prof\0", non_str: 2 ] => bool |
221+
ops: r |
222+
docs:
223+
/// Memory profiling enabled/disabled. If enabled, profile memory allocation activity.
224+
///
225+
/// # Examples
226+
///
227+
/// ```
228+
/// # #[global_allocator]
229+
/// # static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
230+
/// #
231+
/// # fn main() {
232+
/// use tikv_jemalloc_ctl::opt;
233+
/// let prof = opt::prof::read().unwrap();
234+
/// println!("Jemalloc profiling enabled: {}", prof);
235+
/// # }
236+
/// ```
237+
mib_docs: /// See [`prof`].
238+
}

jemalloc-ctl/test

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
heap_v2/524288
2+
t*: 0: 0 [0: 0]
3+
t0: 0: 0 [0: 0]
4+
t1: 0: 0 [0: 0]

0 commit comments

Comments
 (0)