@@ -17,11 +17,14 @@ option! {
1717 /// # static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
1818 /// #
1919 /// # fn main() {
20- /// use tikv_jemalloc_ctl::prof;
21- /// use std::ffi::CStr;
22- /// let dump_file_name = CStr::from_bytes_with_nul(b"dump\0").unwrap();
23- /// let dump = prof::dump::mib().unwrap();
24- /// dump.write(dump_file_name).unwrap();
20+ /// #[cfg(feature = "profiling")]
21+ /// {
22+ /// use tikv_jemalloc_ctl::prof;
23+ /// use std::ffi::CStr;
24+ /// let dump_file_name = CStr::from_bytes_with_nul(b"dump\0").unwrap();
25+ /// let dump = prof::dump::mib().unwrap();
26+ /// dump.write(dump_file_name).unwrap();
27+ /// }
2528 /// # }
2629 /// ```
2730 mib_docs: /// See [`dump`].
@@ -42,11 +45,14 @@ option! {
4245 /// # static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
4346 /// #
4447 /// # fn main() {
45- /// use tikv_jemalloc_ctl::prof;
46- /// use std::ffi::CStr;
47- /// let dump_file_name = CStr::from_bytes_with_nul(b"my_prefix\0").unwrap();
48- /// let prefix = prof::prefix::mib().unwrap();
49- /// prefix.write(dump_file_name).unwrap();
48+ /// #[cfg(feature = "profiling")]
49+ /// {
50+ /// use tikv_jemalloc_ctl::prof;
51+ /// use std::ffi::CStr;
52+ /// let dump_file_name = CStr::from_bytes_with_nul(b"my_prefix\0").unwrap();
53+ /// let prefix = prof::prefix::mib().unwrap();
54+ /// prefix.write(dump_file_name).unwrap();
55+ /// }
5056 /// # }
5157 /// ```
5258 mib_docs: /// See [`prefix`].
@@ -68,9 +74,12 @@ option! {
6874 /// # static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
6975 /// #
7076 /// # fn main() {
71- /// use tikv_jemalloc_ctl::prof;
72- /// let active = prof::active::mib().unwrap();
73- /// active.write(true).unwrap();
77+ /// #[cfg(feature = "profiling")]
78+ /// {
79+ /// use tikv_jemalloc_ctl::prof;
80+ /// let active = prof::active::mib().unwrap();
81+ /// active.write(true).unwrap();
82+ /// }
7483 /// # }
7584 /// ```
7685 mib_docs: /// See [`active`].
0 commit comments