Crate tracy_client
source ·Expand description
This crate is a set of safe bindings to the client library of the Tracy profiler.
If you have already instrumented your application with tracing
, consider the tracing-tracy
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
crate conditionally, via
the enable
feature flag provided by this crate.
Features
The following crate features are provided to customize the functionality of the Tracy client:
enable
– enables the Tracy client. Corresponds to theTRACY_ENABLE
define.system-tracing
– enable capture of system level details. Corresponds to theTRACY_NO_SYSTEM_TRACING
define.context-switch-tracing
– enable capture of the context switch data. Corresponds to theTRACY_NO_CONTEXT_SWITCH
define.sampling
– enable periodic sampling of the call stack. Corresponds to theTRACY_NO_SAMPLING
define.code-transfer
– enable transfer of the machine code to the profiler. Corresponds to theTRACY_NO_CODE_TRANSFER
define.broadcast
– announce presence of the client to the profilers on the local network. Corresponds to theTRACY_NO_BROADCAST
define.only-localhost
– listen for profilers on the localhost interface only. Corresponds to theTRACY_ONLY_LOCALHOST
define.only-ipv4
– listen for profilers on IPv4 interfaces only. Corresponds to theTRACY_ONLY_IPV4
define.timer-fallback
– allow running on devices without a high resolution timer support. Corresponds to theTRACY_TIMER_FALLBACK
define.ondemand
– start collecting traces only when a server connects to the client. Corresponds to theTRACY_ON_DEMAND
define.fibers
– enable support for instrumenting fibers, coroutines and similar such asynchrony primitives. Corresponds to theTRACY_FIBERS
define.
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.
Re-exports
pub use sys;
Macros
- Construct a
FrameName
. - Convenience macro for
Client::non_continuous_frame
on the current client. - Convenience macro for
Client::plot
on the current client. - Construct a
PlotName
. - Convenience macro for
Client::secondary_frame_mark
on the current client. - Convenience macro for
Client::set_thread_name
on the current client. - Start a new Tracy span with function, file, and line determined automatically.
- Construct a
&’static SpanLocation
.
Structs
- A type representing an enabled Tracy client.
- A non-continuous frame region.
- A name for secondary and non-continuous frames.
- Name of a plot.
- A profiling wrapper around another allocator.
- A handle representing a span of execution.
- A statically allocated location information for a span.
Functions
- Convenience shortcut for
Client::frame_mark
on the current client.