Skip to main content

Module trace

Module trace 

Source
Expand description

System trace emission for driver-lab activity.

AuditTracer mirrors audit records into Fuchsia tracing so host probes, register and knob writes, and interrupt taps share a timeline with scheduler, power, and driver events. An experiment can then relate a register or knob change to its effect on, for example, CPU wakeups or power rail counters within a single trace.

Each audit record becomes an instant event named after its operation (for example read32 or write32). Its arguments use the field names of target-audit.jsonl evidence rows (seq, session, resource, offset, decision, denial, status, value, timestamp_ns, run_id, item_index), plus node and resource_name, so trace events can be joined with evidence bundles. timestamp_ns is the audit record’s monotonic timestamp; the event’s own timestamp is when it was written.

Each successful write also samples a counter named <node>/<resource_name> with one series per register offset (for example 0x1c), so A/B arms appear as step functions.

Events are written only while a trace session enables their category:

  • CATEGORY (driver_lab): all activity except interrupts.
  • IRQ_CATEGORY (driver_lab:irq): interrupt taps, kept separate because high interrupt rates can crowd other events out of the trace buffer.

When neither category is enabled, the cost is one cached category check per record.

Structs§

AuditTracer
Writes one driver-lab instance’s audit records as trace events.

Constants§

CATEGORY
Trace category for driver-lab operations other than interrupts.
IRQ_CATEGORY
Trace category for interrupt taps.