Crate tracy_client_sys

Source
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 the TRACY_MANUAL_LIFETIME define.
  • 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 the TRACY_DELAYED_INIT define.
  • enable – enables the Tracy client. Corresponds to the TRACY_ENABLE define.
  • flush-on-exit – waits for Tracy to connect and read out the profiling data before the program terminates. Corresponds to the TRACY_NO_EXIT define. Does not work in combination with the manual-lifetime feature.
  • manual-lifetime – allow for manual initialization and deinitialization of the profiler data structures. Corresponds to the TRACY_MANUAL_LIFETIME define. tracy_client::Client transparently switches to manual lifetime management when this feature is enabled. Implies delayed-init.
  • system-tracing – enable capture of system level details. Corresponds to the TRACY_NO_SYSTEM_TRACING define.
  • context-switch-tracing – enable capture of the context switch data. Corresponds to the TRACY_NO_CONTEXT_SWITCH define.
  • sampling – enable periodic sampling of the call stack. Corresponds to the TRACY_NO_SAMPLING define.
  • code-transfer – enable transfer of the machine code to the profiler. Corresponds to the TRACY_NO_CODE_TRANSFER define.
  • broadcast – announce presence of the client to the profilers on the local network. Corresponds to the TRACY_NO_BROADCAST define.
  • only-localhost – listen for profilers on the localhost interface only. Corresponds to the TRACY_ONLY_LOCALHOST define.
  • only-ipv4 – listen for profilers on IPv4 interfaces only. Corresponds to the TRACY_ONLY_IPV4 define.
  • timer-fallback – allow running on devices without a high resolution timer support. Corresponds to the TRACY_TIMER_FALLBACK define.
  • ondemand – start collecting traces only when a server connects to the client. Corresponds to the TRACY_ON_DEMAND define.
  • fibers – enable support for instrumenting fibers, coroutines and similar such asynchrony primitives. Corresponds to the TRACY_FIBERS define.
  • 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 the TRACY_NO_CALLSTACK_INLINES define.
  • delayed-init – initializes trace structures upon a first request, rather than at load time. Corresponds to the TRACY_DELAYED_INIT define.
  • demangle - requires that the demangling function be defined by the user. See the register_demangler! macro for more details. Corresponds to the TRACY_DEMANGLE define.
  • verify - enables verification that instrumentation is well formed. Enabling this introduces additional instrumentation overhead (~50% for 0 callstack depth spans.) When disabled corresponds to the TRACY_NO_VERIFY define.
  • debuginfod - enables debuginfo for system libraries on systems supporting debuginfod. Corresponds to the TRACY_DEBUGINFOD define.
  • crash-handler – activate signal handler that intercepts application crashes. Corresponds to the TRACY_NO_CRASH_HANDLER 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.

Structs§

___tracy_c_zone_contextenable
___tracy_gpu_calibration_dataenable
___tracy_gpu_context_name_dataenable
___tracy_gpu_new_context_dataenable
___tracy_gpu_time_dataenable
___tracy_gpu_time_sync_dataenable
___tracy_gpu_zone_begin_callstack_dataenable
___tracy_gpu_zone_begin_dataenable
___tracy_gpu_zone_end_dataenable
___tracy_source_location_dataenable
__tracy_lockable_context_dataenable

Constants§

TracyPlotFormatEnum_TracyPlotFormatMemoryenable
TracyPlotFormatEnum_TracyPlotFormatNumberenable
TracyPlotFormatEnum_TracyPlotFormatPercentageenable
TracyPlotFormatEnum_TracyPlotFormatWattenable

Functions§

___tracy_after_lock_lockable_ctxenable
___tracy_after_try_lock_lockable_ctxenable
___tracy_after_unlock_lockable_ctxenable
___tracy_alloc_srclocenable
___tracy_alloc_srcloc_nameenable
___tracy_announce_lockable_ctxenable
___tracy_before_lock_lockable_ctxenable
___tracy_connectedenable
___tracy_custom_name_lockable_ctxenable
___tracy_emit_frame_imageenable
___tracy_emit_frame_markenable
___tracy_emit_frame_mark_endenable
___tracy_emit_frame_mark_startenable
___tracy_emit_gpu_calibrationenable
___tracy_emit_gpu_calibration_serialenable
___tracy_emit_gpu_context_nameenable
___tracy_emit_gpu_context_name_serialenable
___tracy_emit_gpu_new_contextenable
___tracy_emit_gpu_new_context_serialenable
___tracy_emit_gpu_timeenable
___tracy_emit_gpu_time_serialenable
___tracy_emit_gpu_time_syncenable
___tracy_emit_gpu_time_sync_serialenable
___tracy_emit_gpu_zone_beginenable
___tracy_emit_gpu_zone_begin_allocenable
___tracy_emit_gpu_zone_begin_alloc_callstackenable
___tracy_emit_gpu_zone_begin_alloc_callstack_serialenable
___tracy_emit_gpu_zone_begin_alloc_serialenable
___tracy_emit_gpu_zone_begin_callstackenable
___tracy_emit_gpu_zone_begin_callstack_serialenable
___tracy_emit_gpu_zone_begin_serialenable
___tracy_emit_gpu_zone_endenable
___tracy_emit_gpu_zone_end_serialenable
___tracy_emit_memory_allocenable
___tracy_emit_memory_alloc_callstackenable
___tracy_emit_memory_alloc_callstack_namedenable
___tracy_emit_memory_alloc_namedenable
___tracy_emit_memory_discardenable
___tracy_emit_memory_discard_callstackenable
___tracy_emit_memory_freeenable
___tracy_emit_memory_free_callstackenable
___tracy_emit_memory_free_callstack_namedenable
___tracy_emit_memory_free_namedenable
___tracy_emit_messageenable
___tracy_emit_messageCenable
___tracy_emit_messageLenable
___tracy_emit_messageLCenable
___tracy_emit_message_appinfoenable
___tracy_emit_plotenable
___tracy_emit_plot_configenable
___tracy_emit_plot_floatenable
___tracy_emit_plot_intenable
___tracy_emit_zone_beginenable
___tracy_emit_zone_begin_allocenable
___tracy_emit_zone_begin_alloc_callstackenable
___tracy_emit_zone_begin_callstackenable
___tracy_emit_zone_colorenable
___tracy_emit_zone_endenable
___tracy_emit_zone_nameenable
___tracy_emit_zone_textenable
___tracy_emit_zone_valueenable
___tracy_fiber_enterenable and fibers
___tracy_fiber_leaveenable and fibers
___tracy_mark_lockable_ctxenable
___tracy_set_thread_nameenable
___tracy_shutdown_profilerenable and manual-lifetime
___tracy_startup_profilerenable and manual-lifetime
___tracy_terminate_lockable_ctxenable