Documentation ¶
Overview ¶
The pstore package provides functions for interfacing with the Linux kernel's pstore (persistent storage) system. Documentation for pstore itself can be found at https://docs.kernel.org/admin-guide/abi-testing.html#abi-sys-fs-pstore.
Index ¶
Constants ¶
const CanonicalMountPath = "/sys/fs/pstore"
CanonicalMountPath contains the canonical mount path of the pstore filesystem
Variables ¶
This section is empty.
Functions ¶
func ClearAll ¶
func ClearAll() error
ClearAll clears out all existing entries from the pstore. This should be done after every start (after the relevant data has been read out) to ensure that there is always space to store new pstore entries and to minimize the risk of breaking badly-programmed firmware.
func GetPmsgDump ¶
GetPmsgDump returns lines written into /dev/pmsg0
Types ¶
type KmsgDump ¶
type KmsgDump struct { // The reason why the dump was created. Common values include "Panic" and // "Oops", but depending on the setting `printk.always_kmsg_dump` and // potential future reasons this is likely unbounded. Reason string // The CLOCK_REALTIME value of the first entry in the dump (which is the // closest to the actual time the dump happened). This can be zero or // garbage if the RTC hasn't been initialized or the system has no working // clock source. OccurredAt time.Time // A counter counting up for every dump created. Can be used to order dumps // when the OccurredAt value is not usable due to system issues. Counter uint64 // A list of kernel log lines in oldest-to-newest order, i.e. the oldest // message comes first. The actual cause is generally reported last. Lines []string }
KmsgDump reassembled a kernel message buffer dump from pstore.
func GetKmsgDumps ¶
GetKmsgDumps returns a list of events where the kernel has dumped its kmsg (kernel log) buffer into pstore because of a kernel oops or panic.