Expand description
The Tracy Client and its low level API
This crate embeds the C++ Tracy client library and exposes its API. For a higher-level API
consider the tracy-client crate.
§Important note
Depending on the configuration Tracy may broadcast discovery packets to the local network and expose the data it collects in the background to that same network. Traces collected by Tracy may include source and assembly code as well.
As thus, you may want make sure to only enable the tracy-client-sys crate conditionally, via
the enable feature flag provided by this crate.
In order to start tracing it is important that you first call the [___tracy_startup_profiler]
function first to initialize the client. The [___tracy_shutdown_profiler] must not be called
until it is guaranteed that there will be no more calls to any other Tracy APIs. This can be
especially difficult to ensure if you have detached threads.
§Features
The following crate features are provided to customize the functionality of the Tracy client:
manual-lifetime– disables Tracy’s life-before-main initialization, requiring manual initialization. Corresponds to theTRACY_MANUAL_LIFETIMEdefine.delayed-init– profiler data is gathered into one structure and initialized on the first request rather than statically at the DLL load at the expense of atomic load on each request to the profiler data. Corresponds to theTRACY_DELAYED_INITdefine.enable– enables the Tracy client. Corresponds to theTRACY_ENABLEdefine.flush-on-exit– waits for Tracy to connect and read out the profiling data before the program terminates. Corresponds to theTRACY_NO_EXITdefine. Does not work in combination with themanual-lifetimefeature.manual-lifetime– allow for manual initialization and deinitialization of the profiler data structures. Corresponds to theTRACY_MANUAL_LIFETIMEdefine.tracy_client::Clienttransparently switches to manual lifetime management when this feature is enabled. Impliesdelayed-init.system-tracing– enable capture of system level details. Corresponds to theTRACY_NO_SYSTEM_TRACINGdefine.context-switch-tracing– enable capture of the context switch data. Corresponds to theTRACY_NO_CONTEXT_SWITCHdefine.sampling– enable periodic sampling of the call stack. Corresponds to theTRACY_NO_SAMPLINGdefine.code-transfer– enable transfer of the machine code to the profiler. Corresponds to theTRACY_NO_CODE_TRANSFERdefine.broadcast– announce presence of the client to the profilers on the local network. Corresponds to theTRACY_NO_BROADCASTdefine.only-localhost– listen for profilers on the localhost interface only. Corresponds to theTRACY_ONLY_LOCALHOSTdefine.only-ipv4– listen for profilers on IPv4 interfaces only. Corresponds to theTRACY_ONLY_IPV4define.timer-fallback– allow running on devices without a high resolution timer support. Corresponds to theTRACY_TIMER_FALLBACKdefine.ondemand– start collecting traces only when a server connects to the client. Corresponds to theTRACY_ON_DEMANDdefine.fibers– enable support for instrumenting fibers, coroutines and similar such asynchrony primitives. Corresponds to theTRACY_FIBERSdefine.callstack-inlines- enables resolution of inline frames for call stacks. Disabling it will make the profiler use the basic but much faster frame resolution mode. Corresponds to theTRACY_NO_CALLSTACK_INLINESdefine.delayed-init– initializes trace structures upon a first request, rather than at load time. Corresponds to theTRACY_DELAYED_INITdefine.demangle- requires that the demangling function be defined by the user. See theregister_demangler!macro for more details. Corresponds to theTRACY_DEMANGLEdefine.verify- enables verification that instrumentation is well formed. Enabling this introduces additional instrumentation overhead (~50% for 0 callstack depth spans.) When disabled corresponds to theTRACY_NO_VERIFYdefine.debuginfod- enables debuginfo for system libraries on systems supporting debuginfod. Corresponds to theTRACY_DEBUGINFODdefine.
Refer to this package’s Cargo.toml for the list of the features enabled by default. Refer to
the Tracy manual for more information on the implications of each feature.
Structs§
- ___
tracy_ c_ zone_ context - ___
tracy_ gpu_ calibration_ data - ___
tracy_ gpu_ context_ name_ data - ___
tracy_ gpu_ new_ context_ data - ___
tracy_ gpu_ time_ data - ___
tracy_ gpu_ time_ sync_ data - ___
tracy_ gpu_ zone_ begin_ callstack_ data - ___
tracy_ gpu_ zone_ begin_ data - ___
tracy_ gpu_ zone_ end_ data - ___
tracy_ source_ location_ data - __
tracy_ lockable_ context_ data
Constants§
- Tracy
Plot Format Enum_ Tracy Plot Format Memory - Tracy
Plot Format Enum_ Tracy Plot Format Number - Tracy
Plot Format Enum_ Tracy Plot Format Percentage - Tracy
Plot Format Enum_ Tracy Plot Format Watt
Functions§
- ___
tracy_ ⚠after_ lock_ lockable_ ctx - ___
tracy_ ⚠after_ try_ lock_ lockable_ ctx - ___
tracy_ ⚠after_ unlock_ lockable_ ctx - ___
tracy_ ⚠alloc_ srcloc - ___
tracy_ ⚠alloc_ srcloc_ name - ___
tracy_ ⚠announce_ lockable_ ctx - ___
tracy_ ⚠before_ lock_ lockable_ ctx - ___
tracy_ ⚠connected - ___
tracy_ ⚠custom_ name_ lockable_ ctx - ___
tracy_ ⚠emit_ frame_ image - ___
tracy_ ⚠emit_ frame_ mark - ___
tracy_ ⚠emit_ frame_ mark_ end - ___
tracy_ ⚠emit_ frame_ mark_ start - ___
tracy_ ⚠emit_ gpu_ calibration - ___
tracy_ ⚠emit_ gpu_ calibration_ serial - ___
tracy_ ⚠emit_ gpu_ context_ name - ___
tracy_ ⚠emit_ gpu_ context_ name_ serial - ___
tracy_ ⚠emit_ gpu_ new_ context - ___
tracy_ ⚠emit_ gpu_ new_ context_ serial - ___
tracy_ ⚠emit_ gpu_ time - ___
tracy_ ⚠emit_ gpu_ time_ serial - ___
tracy_ ⚠emit_ gpu_ time_ sync - ___
tracy_ ⚠emit_ gpu_ time_ sync_ serial - ___
tracy_ ⚠emit_ gpu_ zone_ begin - ___
tracy_ ⚠emit_ gpu_ zone_ begin_ alloc - ___
tracy_ ⚠emit_ gpu_ zone_ begin_ alloc_ callstack - ___
tracy_ ⚠emit_ gpu_ zone_ begin_ alloc_ callstack_ serial - ___
tracy_ ⚠emit_ gpu_ zone_ begin_ alloc_ serial - ___
tracy_ ⚠emit_ gpu_ zone_ begin_ callstack - ___
tracy_ ⚠emit_ gpu_ zone_ begin_ callstack_ serial - ___
tracy_ ⚠emit_ gpu_ zone_ begin_ serial - ___
tracy_ ⚠emit_ gpu_ zone_ end - ___
tracy_ ⚠emit_ gpu_ zone_ end_ serial - ___
tracy_ ⚠emit_ memory_ alloc - ___
tracy_ ⚠emit_ memory_ alloc_ callstack - ___
tracy_ ⚠emit_ memory_ alloc_ callstack_ named - ___
tracy_ ⚠emit_ memory_ alloc_ named - ___
tracy_ ⚠emit_ memory_ free - ___
tracy_ ⚠emit_ memory_ free_ callstack - ___
tracy_ ⚠emit_ memory_ free_ callstack_ named - ___
tracy_ ⚠emit_ memory_ free_ named - ___
tracy_ ⚠emit_ message - ___
tracy_ ⚠emit_ messageC - ___
tracy_ ⚠emit_ messageL - ___
tracy_ ⚠emit_ messageLC - ___
tracy_ ⚠emit_ message_ appinfo - ___
tracy_ ⚠emit_ plot - ___
tracy_ ⚠emit_ plot_ config - ___
tracy_ ⚠emit_ plot_ float - ___
tracy_ ⚠emit_ plot_ int - ___
tracy_ ⚠emit_ zone_ begin - ___
tracy_ ⚠emit_ zone_ begin_ alloc - ___
tracy_ ⚠emit_ zone_ begin_ alloc_ callstack - ___
tracy_ ⚠emit_ zone_ begin_ callstack - ___
tracy_ ⚠emit_ zone_ color - ___
tracy_ ⚠emit_ zone_ end - ___
tracy_ ⚠emit_ zone_ name - ___
tracy_ ⚠emit_ zone_ text - ___
tracy_ ⚠emit_ zone_ value - ___
tracy_ ⚠mark_ lockable_ ctx - ___
tracy_ ⚠set_ thread_ name - ___
tracy_ ⚠terminate_ lockable_ ctx