Skip to main content

chronon::observe::ClockTraceRecorder

#include <ClockTraceRecorder.hpp>

Public Classes

Name
structStats
structConfig

Public Functions

Name
~ClockTraceRecorder()
booltryAdmitClockBatch(const SimTime & time)
Single scheduler coordinator only; false means retry after backend drain.
Statsstats() const
Valid after close(); includes metadata files and both enabled sinks.
voidstartParallel(size_t lookahead_batches)
voidstart(bool serial_coordinator =false)
voidpublishClockProgress(uint64_t exclusive_ns)
boolparallelActive() const
ClockTraceRecorder &operator=(const ClockTraceRecorder & ) =delete
boolneedsProgress() const
voidendClockBatch()
boolenabled() const
voiddefineEvent(ClockEventKind kind, std::string name)
voidclose()
voidbeginClockBatch(const SimTime & time)
voidadvance(uint64_t exclusive_ns)
ClockTraceStream *addStream(const ClockDomain & domain, uint32_t unit_id, std::string unit_name)
ClockTraceStream *addProducerStream(ClockTraceStream * unit, uint64_t producer_order)
ClockTraceRecorder(Config config)
ClockTraceRecorder(const ClockTraceRecorder & ) =delete

Friends

Name
classClockTraceStream

Public Functions Documentation

function ~ClockTraceRecorder

~ClockTraceRecorder()

function tryAdmitClockBatch

bool tryAdmitClockBatch(
const SimTime & time
)

Single scheduler coordinator only; false means retry after backend drain.

function stats

Stats stats() const

Valid after close(); includes metadata files and both enabled sinks.

function startParallel

void startParallel(
size_t lookahead_batches
)

Scheduler-owned, nonblocking observation credits. Compact staging for admitted ns buckets lets the backend drain EVERY ingress stream without waiting for simulation progress, including several actors on one worker.

function start

void start(
bool serial_coordinator =false
)

Serial coordinator mode requires begin/endClockBatch around all producers. All records must belong to that exact batch time; do not advance/finish individual streams. Leave disabled for independent worker streams.

function publishClockProgress

void publishClockProgress(
uint64_t exclusive_ns
)

All records below this bound have been published (units AND CDC commits). Does not wait for the backend; quiet actors need no per-stream advance.

function parallelActive

bool parallelActive() const

function operator=

ClockTraceRecorder & operator=(
const ClockTraceRecorder &
) =delete

function needsProgress

bool needsProgress() const

function endClockBatch

void endClockBatch()

function enabled

bool enabled() const

function defineEvent

void defineEvent(
ClockEventKind kind,
std::string name
)

function close

void close()

Join/drain and finish the open tail buckets. Encoded prefixes are already available during recording; no whole-trace sorting or temporary disk IO. I/O errors are surfaced here and to blocked producers.

function beginClockBatch

void beginClockBatch(
const SimTime & time
)

function advance

void advance(
uint64_t exclusive_ns
)

Coordinator-only alternative to per-stream advance: ALL producers must have published every event with floor(time/ns) < exclusive_ns before this call, and promise never to publish another. Waits for backend acknowledgement. Use at scheduler safe points, not sequential blocking per-stream advances.

function addStream

ClockTraceStream * addStream(
const ClockDomain & domain,
uint32_t unit_id,
std::string unit_name
)

function addProducerStream

ClockTraceStream * addProducerStream(
ClockTraceStream * unit,
uint64_t producer_order
)

Independent actor, same logical unit/track. Stable nonzero producer_order breaks commit ties (CDC uses FIFO ID + 1), never a host worker identity.

function ClockTraceRecorder

explicit ClockTraceRecorder(
Config config
)

function ClockTraceRecorder

ClockTraceRecorder(
const ClockTraceRecorder &
) =delete

Friends

friend ClockTraceStream

friend class ClockTraceStream(
ClockTraceStream
);

Updated on 2026-09-20 at 14:23:39 +0000