Records

Functions

  • bool HasPagerBackedCode (const zx::process & process)

    Whether |process| runs any code from a pager-backed VMO (a package blob rather than bootfs).

    Defined at line 550 of file ../../src/bringup/bin/critical-services/storage-watchdog/wedge_dump.cc

  • void DumpWedgeDiagnosticsAndReboot (std::string_view reason, zx::job root_job)

    Writes |reason| and backtraces of the storage stack (fxfs, busy driver host and Starnix threads,

    and every thread blocked on a pager) to the debuglog as symbolizer markup. Then dies as

    a process critical to |root_job|: the kernel reboots with USERSPACE ROOT JOB TERMINATION, which

    keeps the debuglog in the crashlog, and feedback files the reboot as

    fuchsia-reboot-storage-watchdog-terminated.

    Nothing here waits on storage without a timeout, and a separate thread reboots after 60 s

    however far the dump got.

    Defined at line 554 of file ../../src/bringup/bin/critical-services/storage-watchdog/wedge_dump.cc

  • ArchivistSnapshots TakeArchivistSnapshots (zx::time deadline)

    Takes snapshots of the system log tail and of storage Inspect data from Archivist (which runs

    from bootfs and keeps logs in RAM). Each is fetched on its own thread, which is abandoned at

    |deadline| in case Archivist, or a component it asks for Inspect data, is stuck.

    Defined at line 136 of file ../../src/bringup/bin/critical-services/storage-watchdog/archivist_snapshot.cc

  • void Arm ()

    Arms the watchdog. Gets the root job now, while the system is healthy.

    Test only: with the boot argument storage-watchdog.simulate-stall-secs=

    <n

    > (e.g. on the assembly

    kernel command line), a thread named like fxfs's makes a backtrace request after n seconds.

    That reboots every boot, so remove it once done.

    Defined at line 107 of file ../../src/bringup/bin/critical-services/storage-watchdog/storage_watchdog.cc

  • bool OnBacktraceRequest (const zx::process & process, std::string_view thread_name)

    Called for every backtrace request with the requesting process and thread name. If the watchdog

    is armed, the thread name starts with kTriggerThreadPrefix, and the process is fxfs (or

    critical-services itself during SimulateStall), starts the dump and reboot on another thread,

    once, and returns true; the caller should just resume the requesting thread.

    Defined at line 133 of file ../../src/bringup/bin/critical-services/storage-watchdog/storage_watchdog.cc

  • bool OnPagerTimeout (const zx::process & process)

    Called for every fatal page fault that failed with ZX_ERR_TIMED_OUT, i.e. the kernel stopped

    waiting for a pager. If the watchdog is armed and the process is fxfs, starts the dump and reboot

    on another thread, once, and returns true; the caller should keep the exception until the reboot.

    Defined at line 141 of file ../../src/bringup/bin/critical-services/storage-watchdog/storage_watchdog.cc

  • std::vector<std::string> InspectLines (std::span<const std::string> batches, size_t max_bytes_per_component, size_t max_bytes)

    Formats the components in Inspect JSON batches from fuchsia.diagnostics/ArchiveAccessor as

    "inspect <moniker>: <payload as compact JSON>", without histograms or empty trees, split into

    lines of kMaxLineLength. Each component gets at most |max_bytes_per_component|, and all of them

    together |max_bytes|. power-broker goes last, cut down to its leases and the elements that are

    changing level or have leases.

    Defined at line 243 of file ../../src/bringup/bin/critical-services/storage-watchdog/diagnostics_text.cc

  • size_t DebuglogCost (std::span<const std::string> lines)

    The debuglog ring space that writing |lines| takes.

    Defined at line 287 of file ../../src/bringup/bin/critical-services/storage-watchdog/diagnostics_text.cc

  • std::span<const std::string> NewestWithinBudget (std::span<const std::string> lines, size_t budget)

    The newest |lines| that fit in |budget| bytes of debuglog ring.

    Defined at line 295 of file ../../src/bringup/bin/critical-services/storage-watchdog/diagnostics_text.cc

Variables

const std::string_view kTriggerThreadPrefix

Defined at line 31 of file ../../src/bringup/bin/critical-services/storage-watchdog/storage_watchdog.h