LatencyProfiler Class
Per-sample latency tracker; attach to a Run to capture timing telemetry. More...
Declaration
Included Headers
Public Member Typedefs Index
| using | Options = LatencyProfilerOptions |
|
Tunable knobs for the profiler. More... | |
Public Constructors Index
| LatencyProfiler (Options o=Options()) | |
|
Construct a profiler with the given options. More... | |
| LatencyProfiler (const LatencyProfiler &)=delete | |
|
Deleted copy constructor; the profiler owns thread-bound state. More... | |
Public Destructor Index
| ~LatencyProfiler () | |
|
Destructor; detaches from any attached Run/Session. More... | |
Public Operators Index
| LatencyProfiler & | operator= (const LatencyProfiler &)=delete |
|
Deleted copy assignment; the profiler owns thread-bound state. More... | |
Public Member Functions Index
| void | attach (Run &run) |
| void | attach (Session &session) |
| void | mark_warmup_done () |
|
Reset all counters/event ring to mark the warmup→measured boundary. More... | |
| ProfilerReport | finalize () |
|
Drain the event ring and snapshot all telemetry sources. More... | |
Private Member Attributes Index
| Options | options_ |
| Run * | attached_run_ = nullptr |
| Session * | attached_session_ = nullptr |
| bool | enabled_at_attach_ = false |
Public Static Functions Index
| static std::string | to_text (const ProfilerReport &report) |
|
Render report as a human-readable text summary. More... | |
| static std::string | to_chrome_trace (const ProfilerReport &report) |
|
Render report as a Chrome/Perfetto trace JSON document. More... | |
Description
Per-sample latency tracker; attach to a Run to capture timing telemetry.
Lifetime: construct, attach() to a Run (or Session) before pushing frames, push frames, optionally call mark_warmup_done() after the warmup window, then call finalize() to obtain a ProfilerReport. The profiler is single-owner (non-copyable) and detaches automatically on destruction.
- See Also
- See Also
Definition at line 202 of file LatencyProfiler.h.
Public Member Typedefs
Options
|
Tunable knobs for the profiler.
Definition at line 205 of file LatencyProfiler.h.
Public Constructors
LatencyProfiler()
Construct a profiler with the given options.
Definition at line 208 of file LatencyProfiler.h.
LatencyProfiler()
| delete |
Deleted copy constructor; the profiler owns thread-bound state.
Definition at line 213 of file LatencyProfiler.h.
Public Destructor
~LatencyProfiler()
|
Destructor; detaches from any attached Run/Session.
Definition at line 210 of file LatencyProfiler.h.
Public Operators
operator=()
| delete |
Deleted copy assignment; the profiler owns thread-bound state.
Definition at line 215 of file LatencyProfiler.h.
Public Member Functions
attach()
|
Attach to a Run (Session-level path).
After this call, every kernel event emitted by the runtime is captured in the profiler's ring. Must be called before frames are pushed for events to be observed.
Definition at line 226 of file LatencyProfiler.h.
attach()
|
Optional: attach a Session directly.
Reserved for V2: would let per-output frame_id stamping hook the existing tensor_callback. No-op for V1.
Definition at line 236 of file LatencyProfiler.h.
finalize()
|
Drain the event ring and snapshot all telemetry sources.
Safe to call multiple times; each call drains incremental events since the previous drain (use mark_warmup_done() to discard rather than emit).
- Returns
Snapshot bundle ready for serialisation via to_text() or to_chrome_trace().
Definition at line 260 of file LatencyProfiler.h.
mark_warmup_done()
|
Reset all counters/event ring to mark the warmup→measured boundary.
Call after pushing Options::warmup_frames inputs. Subsequent telemetry starts fresh from this point.
Definition at line 246 of file LatencyProfiler.h.
Private Member Attributes
attached_run_
|
Definition at line 270 of file LatencyProfiler.h.
attached_session_
|
Definition at line 271 of file LatencyProfiler.h.
enabled_at_attach_
|
Definition at line 272 of file LatencyProfiler.h.
options_
|
Definition at line 269 of file LatencyProfiler.h.
Public Static Functions
to_chrome_trace()
| static |
Render report as a Chrome/Perfetto trace JSON document.
Definition at line 266 of file LatencyProfiler.h.
to_text()
| static |
Render report as a human-readable text summary.
Definition at line 264 of file LatencyProfiler.h.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.