| 1 |
// |
| 2 |
// To use this library, enable one of the feature flags. Each backend implementation provides the |
| 3 |
// exact same interface. Only one may be active at a time. |
| 4 |
// |
| 5 |
|
| 6 |
/// Proc macro for creating a scope around the function, using the name of the function for the |
| 7 |
/// scope's name |
| 8 |
/// |
| 9 |
/// This must be done as a proc macro because tracing requires a const string |
| 10 |
/// |
| 11 |
/// ``` |
| 12 |
/// #[profiling::function] |
| 13 |
/// fn my_function() { |
| 14 |
/// |
| 15 |
/// } |
| 16 |
/// ``` |
| 17 |
#[cfg(feature = "procmacros")] |
| 18 |
pub use profiling_procmacros::function; |
| 19 |
|
| 20 |
#[cfg(feature = "profile-with-puffin")] |
| 21 |
pub use puffin; |
| 22 |
#[cfg(feature = "profile-with-puffin")] |
| 23 |
mod puffin_impl; |
| 24 |
#[cfg(feature = "profile-with-puffin")] |
| 25 |
pub use puffin_impl::*; |
| 26 |
|
| 27 |
#[cfg(feature = "profile-with-optick")] |
| 28 |
pub use optick; |
| 29 |
#[cfg(feature = "profile-with-optick")] |
| 30 |
mod optick_impl; |
| 31 |
#[cfg(feature = "profile-with-optick")] |
| 32 |
pub use optick_impl::*; |
| 33 |
|
| 34 |
#[cfg(feature = "profile-with-superluminal")] |
| 35 |
pub use superluminal_perf; |
| 36 |
#[cfg(feature = "profile-with-superluminal")] |
| 37 |
mod superluminal_impl; |
| 38 |
#[cfg(feature = "profile-with-superluminal")] |
| 39 |
pub use superluminal_impl::*; |
| 40 |
|
| 41 |
#[cfg(feature = "profile-with-tracing")] |
| 42 |
pub use tracing; |
| 43 |
#[cfg(feature = "profile-with-tracing")] |
| 44 |
mod tracing_impl; |
| 45 |
#[cfg(feature = "profile-with-tracing")] |
| 46 |
pub use tracing_impl::*; |
| 47 |
|
| 48 |
#[cfg(feature = "profile-with-tracy")] |
| 49 |
pub use tracy_client; |
| 50 |
#[cfg(feature = "profile-with-tracy")] |
| 51 |
mod tracy_impl; |
| 52 |
#[cfg(feature = "profile-with-tracy")] |
| 53 |
pub use tracy_impl::*; |
| 54 |
|
| 55 |
#[cfg(feature = "type-check")] |
| 56 |
mod type_check_impl; |
| 57 |
#[cfg(feature = "type-check")] |
| 58 |
pub use type_check_impl::*; |
| 59 |
|
| 60 |
#[cfg(not(any( |
| 61 |
feature = "profile-with-puffin", |
| 62 |
feature = "profile-with-optick", |
| 63 |
feature = "profile-with-superluminal", |
| 64 |
feature = "profile-with-tracing", |
| 65 |
feature = "profile-with-tracy", |
| 66 |
feature = "type-check" |
| 67 |
)))] |
| 68 |
mod empty_impl; |
| 69 |
|
| 70 |
#[cfg(not(any( |
| 71 |
feature = "profile-with-puffin", |
| 72 |
feature = "profile-with-optick", |
| 73 |
feature = "profile-with-superluminal", |
| 74 |
feature = "profile-with-tracing", |
| 75 |
feature = "profile-with-tracy", |
| 76 |
feature = "type-check" |
| 77 |
)))] |
| 78 |
pub use empty_impl::*; |