Skip to content

Commit

Permalink
Disable profiling tests on windows
Browse files Browse the repository at this point in the history
Profiling is not currently supported by jemalloc on windows, as it
requires a profiling backend based on libraries available on Windows.

As such, we disable the profiling-related tests when running on windows.
  • Loading branch information
roblabla committed Sep 23, 2024
1 parent 697e0a1 commit d2461b3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
6 changes: 6 additions & 0 deletions jemalloc-ctl/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ macro_rules! r {
"background_thread" |
"max_background_threads"
if cfg!(any(target_os = "macos", windows)) => return,
"lg_prof_interval" |
"lg_prof_sample" |
"prof_final" |
"prof_leak" |
"prof"
if cfg!(windows) => return,
_ => (),
}

Expand Down
20 changes: 20 additions & 0 deletions jemalloc-ctl/src/profiling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ option! {
/// # static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
/// #
/// # fn main() {
/// # #[cfg(not(windows))] {
/// #
/// use tikv_jemalloc_ctl::profiling;
/// let lg_prof_interval = profiling::lg_prof_interval::read().unwrap();
/// println!("average interval between memory profile dumps: {}", lg_prof_interval);
/// #
/// # } // #[cfg(..)]
/// # }
/// ```
mib_docs: /// See [`lg_prof_interval`].
Expand All @@ -49,9 +53,13 @@ option! {
/// # static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
/// #
/// # fn main() {
/// # #[cfg(not(windows))] {
/// #
/// use tikv_jemalloc_ctl::profiling;
/// let lg_prof_sample = profiling::lg_prof_sample::read().unwrap();
/// println!("average interval between allocation samples: {}", lg_prof_sample);
/// #
/// # } // #[cfg(..)]
/// # }
/// ```
mib_docs: /// See [`lg_prof_sample`].
Expand Down Expand Up @@ -79,9 +87,13 @@ option! {
/// # static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
/// #
/// # fn main() {
/// # #[cfg(not(windows))] {
/// #
/// use tikv_jemalloc_ctl::profiling;
/// let prof_final = profiling::prof_final::read().unwrap();
/// println!("dump final memory usage to file: {}", prof_final);
/// #
/// # } // #[cfg(..)]
/// # }
/// ```
mib_docs: /// See [`prof_final`].
Expand Down Expand Up @@ -116,9 +128,13 @@ option! {
/// # static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
/// #
/// # fn main() {
/// # #[cfg(not(windows))] {
/// #
/// use tikv_jemalloc_ctl::profiling;
/// let prof = profiling::prof::read().unwrap();
/// println!("is memory profiling enabled: {}", prof);
/// #
/// # } // #[cfg(..)]
/// # }
/// ```
mib_docs: /// See [`prof`].
Expand Down Expand Up @@ -146,9 +162,13 @@ option! {
/// # static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
/// #
/// # fn main() {
/// # #[cfg(not(windows))] {
/// #
/// use tikv_jemalloc_ctl::profiling;
/// let prof_leak = profiling::prof_leak::read().unwrap();
/// println!("is leak reporting enabled: {}", prof_leak);
/// #
/// # } // #[cfg(..)]
/// # }
/// ```
mib_docs: /// See [`prof_leak`].
Expand Down

0 comments on commit d2461b3

Please sign in to comment.