diff options
Diffstat (limited to 'src/zen/trace/trace_model.h')
| -rw-r--r-- | src/zen/trace/trace_model.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/zen/trace/trace_model.h b/src/zen/trace/trace_model.h index bd6dcc674..3ac4c0cce 100644 --- a/src/zen/trace/trace_model.h +++ b/src/zen/trace/trace_model.h @@ -260,6 +260,39 @@ struct TraceModel eastl::vector<CsvEvent> CsvEvents; // sorted by TimeUs eastl::vector<CsvMeta> CsvMetadata; + // -- Counters (TRACE_INT_VALUE / TRACE_FLOAT_VALUE / TRACE_MEMORY_VALUE) -- + // One CounterDef per registered counter (Counters.Spec event), and one + // CounterSeries per counter that produced any samples (Counters.SetValueInt + // / SetValueFloat events). + struct CounterDef + { + uint16_t Id = 0; + uint8_t Type = 0; // 0 = Int, 1 = Float + uint8_t DisplayHint = 0; // 0 = None, 1 = Memory + std::string Name; + }; + + struct CounterSample + { + uint32_t TimeUs; + double Value; // int counters are widened to double for transport; + // exact int values up to 2^53 round-trip losslessly. + }; + + struct CounterSeries + { + uint16_t Id = 0; + uint8_t Type = 0; // mirrors CounterDef::Type + uint8_t Pad = 0; + uint32_t Count = 0; + double Min = 0.0; + double Max = 0.0; + eastl::vector<CounterSample> Samples; // sorted by TimeUs + }; + + eastl::vector<CounterDef> CounterDefs; // sorted by Id + eastl::vector<CounterSeries> CounterTimeSeries; // one per counter that produced samples, sorted by Id + // -- Event type counts (sorted by count descending) -- struct EventTypeCount { |