class DLog

Defined at line 39 of file ../../zircon/kernel/lib/debuglog/debuglog_internal.h

Public Methods

void DLog ()

Defined at line 41 of file ../../zircon/kernel/lib/debuglog/debuglog_internal.h

void ~DLog ()

Defined at line 43 of file ../../zircon/kernel/lib/debuglog/debuglog_internal.h

bool ShutdownFinished ()

Returns true iff we have finished shutting down this instance.

Defined at line 55 of file ../../zircon/kernel/lib/debuglog/debuglog_internal.h

void StartThreads ()

The debuglog maintains a circular buffer of debuglog records,

consisting of a common header (dlog_header_t) followed by up

to 224 bytes of textual log message. Records are aligned on

uint32_t boundaries, so the header word which indicates the

true size of the record and the space it takes in the fifo

can always be read with a single uint32_t* read (the header

or body may wrap but the initial header word never does).

The ring buffer position is maintained by continuously incrementing

head and tail pointers (type size_t, so uint64_t on 64bit systems),

This allows readers to trivial compute if their local tail

pointer has "fallen out" of the fifo (an entire fifo's worth

of messages were written since they last tried to read) and then

they can snap their tail to the global tail and restart

Tail indicates the oldest message in the debuglog to read

from, Head indicates the next space in the debuglog to write

a new message to. They are clipped to the actual buffer by

DLOG_MASK.

T T

[....XXXX....] [XX........XX]

H H

Defined at line 74 of file ../../zircon/kernel/lib/debuglog/debuglog.cc

zx_status_t Shutdown (zx_instant_mono_t deadline)

Mark this DLog as shutting down, then shutdown all threads. Once called, subsequent |write|

operations will fail, but already-queued messages will continue to be processed/emitted.

Defined at line 93 of file ../../zircon/kernel/lib/debuglog/debuglog.cc

void PanicStart ()

See |dlog_panic_start|.

Defined at line 152 of file ../../zircon/kernel/lib/debuglog/debuglog.cc

void BluescreenInit ()

See |dlog_bluescreen_init|.

Defined at line 157 of file ../../zircon/kernel/lib/debuglog/debuglog.cc

size_t RenderToCrashlog (ktl::span<char> target)

See "dlog_render_to_crashlog" in include/lib/debuglog.h

Defined at line 274 of file ../../zircon/kernel/lib/debuglog/debuglog.cc

zx_status_t Write (uint32_t severity, uint32_t flags, ktl::string_view str)

Defined at line 172 of file ../../zircon/kernel/lib/debuglog/debuglog.cc

Protected Methods

void OutputLogMessage (ktl::string_view log)

Methods that can be overridden for tests.

Defined at line 360 of file ../../zircon/kernel/lib/debuglog/debuglog.cc

Friends

class DlogReader
class DebuglogTests