tracy_client_sys/
lib.rs

1//! The Tracy Client and its low level API
2//!
3//! This crate embeds the C++ Tracy client library and exposes its API. For a higher-level API
4//! consider the `tracy-client` crate.
5//!
6//! # Important note
7//!
8//! Depending on the configuration Tracy may broadcast discovery packets to the local network and
9//! expose the data it collects in the background to that same network. Traces collected by Tracy
10//! may include source and assembly code as well.
11//!
12//! As thus, you may want make sure to only enable the `tracy-client-sys` crate conditionally, via
13//! the `enable` feature flag provided by this crate.
14//!
15//! In order to start tracing it is important that you first call the [`___tracy_startup_profiler`]
16//! function first to initialize the client. The [`___tracy_shutdown_profiler`] must not be called
17//! until it is guaranteed that there will be no more calls to any other Tracy APIs. This can be
18//! especially difficult to ensure if you have detached threads.
19//!
20//! # Features
21//!
22//! The following crate features are provided to customize the functionality of the Tracy client:
23//!
24//! * `manual-lifetime` – disables Tracy’s life-before-main initialization, requiring manual
25//!   initialization. Corresponds to the `TRACY_MANUAL_LIFETIME` define.
26//! * `delayed-init` – profiler data is gathered into one structure and initialized on the first
27//!   request rather than statically at the DLL load at the expense of atomic load on each request
28//!   to the profiler data. Corresponds to the `TRACY_DELAYED_INIT` define.
29#![doc = include_str!("../FEATURES.mkd")]
30#![allow(
31    non_snake_case,
32    non_camel_case_types,
33    non_upper_case_globals,
34    unused_variables,
35    deref_nullptr
36)]
37
38#[cfg(feature = "enable")]
39mod generated;
40#[cfg(feature = "enable")]
41pub use generated::*;
42
43#[cfg(all(feature = "enable", feature = "manual-lifetime"))]
44mod generated_manual_lifetime;
45#[cfg(all(feature = "enable", feature = "manual-lifetime"))]
46pub use generated_manual_lifetime::*;
47
48#[cfg(all(feature = "enable", feature = "fibers"))]
49mod generated_fibers;
50#[cfg(all(feature = "enable", feature = "fibers"))]
51pub use generated_fibers::{___tracy_fiber_enter, ___tracy_fiber_leave};
52
53#[cfg(all(feature = "enable", target_os = "windows"))]
54mod dbghelp;