class Interface
Defined at line 34 of file ../../zircon/kernel/include/platform/crashlog.h
This is common interface definition for specific implementations of crashlog support.
Depending on the platform, and the resources provided to it, users will end up with
1) A RAM mappable crashlog implementation, where the crashlog RAM is mapped
directly accessible by the CPUs from a mapped virtual address.
2) An EFI capsule based implementation, where crashlogs get stored in an
EFI capsule during a non-spontaneous crash.
3) A trivial, no-op implementation, because the kernel was not provided any
way to store data which could survive a reboot.
Generally speaking, the underlying implementation are not multi-thread
safe, and users should take care to never do something like having multiple
threads calling into Finalize at the same time.
Public Methods
ktl::span<char> GetRenderTarget ()
Returns a span which points to the region which the kernel should render
a crashlog payload to during a non-spontaneous crash.
void Finalize (zircon_crash_reason_t reason, size_t amt)
Finalize a crashlog just before triggering a reboot. |reason| is the SW
reboot reason which will be stored in the crashlog header, while |amt| is
the amount of the render target (see |GetRenderTarget|) which was filled
before calling finalize.
size_t Recover (FILE * tgt)
Attempt to recover any crashlog from platform specific storage, writing
the results to |tgt|. Returns the number of bytes written to |tgt| in
the process. Users may pass nullptr to |tgt| if they wish to simply
measure the size of the crashlog to be recovered.
void EnableCrashlogUptimeUpdates (bool enabled)
Enable periodic updates of the uptime estimate in the crashlog header.
This allows systems with directly mappable crashlog RAM to constantly be
stashing a valid header with an uptime estimate and a reboot reason of
"UNKNOWN" to be recovered in the case of a spontaneous reboot.
Protected Methods
void ~Interface ()
No one should ever be destroying an implementation of the crashlog
interface from an Interface* pointer. Bury the destructor as a
protected, non-virtual destructor to prevent anyone from ever
accidentally attempting to do so.
Defined at line 63 of file ../../zircon/kernel/include/platform/crashlog.h