Expand description
Tracy profiler offline trace export
Serialises profiling data to Tracy’s text-based CSV/log format for offline analysis with Tracy’s viewer or compatible tools.
Format reference (line-oriented, one record per line):
ZoneBegin,<name>,<file>,<line>,<timestamp_ns>
ZoneEnd,<timestamp_ns>
Message,<text>,<timestamp_ns>
Plot,<name>,<value>,<timestamp_ns>§Example
use trustformers_debug::export::tracy::{TracyTrace, TracyZone};
let mut trace = TracyTrace::new();
trace.add_zone(TracyZone {
name: "attention_forward".to_string(),
timestamp_ns: 0,
duration_ns: 1_500_000,
thread_id: 1,
});
trace.add_message("training started", 0);
trace.add_plot("loss", 0.345, 0);
let path = std::path::Path::new("/tmp/trace.tracy.csv");
trace.export_to_file(path).unwrap();Structs§
- Tracy
Exporter - Converts a
ProfilerReportto aTracyTraceand writes it to disk. - Tracy
Trace - In-memory collection of Tracy trace records.
- Tracy
Zone - A single profiling zone recorded in a Tracy trace.