class Reservation

Defined at line 844 of file ../../zircon/kernel/include/lib/ktrace.h

Reservation encapsulates a pending write to the KTrace buffer.

This class implements the fxt::Writer::Reservation trait, which is required by the FXT

serializer.

It is absolutely imperative that interrupts remain disabled for the lifetime of this class.

Enabling interrupts at any point during the lifetime of this class will break the

single-writer invariant of each per-CPU buffer and lead to subtle concurrency bugs that may

manifest as corrupt trace data. Unfortunately, there is no way for us to programmatically

ensure this, so we do our best by asserting that interrupts are disabled in every method of

this class. It is therefore up to the caller to ensure that interrupts are disabled for the

lifetime of this object.

Public Methods

void ~Reservation ()

Defined at line 846 of file ../../zircon/kernel/include/lib/ktrace.h

void Reservation (const Reservation & )

Disallow copies and move assignment, but allow moves.

Disallowing move assignment allows the saved interrupt state to be const.

Defined at line 850 of file ../../zircon/kernel/include/lib/ktrace.h

Reservation & operator= (const Reservation & )

Defined at line 851 of file ../../zircon/kernel/include/lib/ktrace.h

Reservation & operator= (Reservation && )

Defined at line 852 of file ../../zircon/kernel/include/lib/ktrace.h

void Reservation (Reservation && other)

Defined at line 853 of file ../../zircon/kernel/include/lib/ktrace.h

void WriteWord (uint64_t word)

Defined at line 857 of file ../../zircon/kernel/include/lib/ktrace.h

void WriteBytes (const void * bytes, size_t num_bytes)

Defined at line 862 of file ../../zircon/kernel/include/lib/ktrace.h

void Commit ()

Defined at line 878 of file ../../zircon/kernel/include/lib/ktrace.h

Friends

class KTrace