Skip to main content

servo_background_hang_monitor/
lib.rs

1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5#![deny(unsafe_code)]
6
7pub mod background_hang_monitor;
8mod sampler;
9#[cfg(all(
10    feature = "sampler",
11    target_os = "linux",
12    not(any(
13        target_arch = "arm",
14        target_arch = "aarch64",
15        target_env = "ohos",
16        target_env = "musl"
17    ))
18))]
19mod sampler_linux;
20#[cfg(all(feature = "sampler", target_os = "android"))]
21mod sampler_linux;
22#[cfg(all(feature = "sampler", target_os = "macos"))]
23mod sampler_mac;
24#[cfg(all(feature = "sampler", target_os = "windows"))]
25mod sampler_windows;
26
27pub use self::background_hang_monitor::*;
28#[cfg(any(
29    not(feature = "sampler"),
30    all(
31        target_os = "linux",
32        any(
33            target_arch = "arm",
34            target_arch = "aarch64",
35            target_env = "ohos",
36            target_env = "musl"
37        )
38    ),
39    all(target_os = "windows", target_arch = "aarch64"),
40    target_os = "freebsd"
41))]
42pub(crate) use crate::sampler::DummySampler as SamplerImpl;
43#[cfg(all(
44    feature = "sampler",
45    target_os = "linux",
46    not(any(
47        target_arch = "arm",
48        target_arch = "aarch64",
49        target_env = "ohos",
50        target_env = "musl"
51    ))
52))]
53pub(crate) use crate::sampler_linux::LinuxSampler as SamplerImpl;
54#[cfg(all(feature = "sampler", target_os = "android"))]
55pub(crate) use crate::sampler_linux::LinuxSampler as SamplerImpl;
56#[cfg(all(feature = "sampler", target_os = "macos"))]
57pub(crate) use crate::sampler_mac::MacOsSampler as SamplerImpl;
58#[cfg(all(
59    feature = "sampler",
60    target_os = "windows",
61    any(target_arch = "x86_64", target_arch = "x86")
62))]
63pub(crate) use crate::sampler_windows::WindowsSampler as SamplerImpl;