Skip to main content

parse_printk_record

Function parse_printk_record 

Source
pub fn parse_printk_record(
    data: &[u8],
    offset: usize,
) -> Option<(KmsgEntry, usize)>
Expand description

Parse raw printk_log record bytes into a KmsgEntry.

printk_log header layout (kernel 3.x+, matches struct printk_log): +0: ts_nsec (u64) — timestamp in nanoseconds since boot +8: len (u16) — total record length including header +10: text_len (u16) — byte length of the text +12: dict_len (u16) — byte length of the dict +14: facility (u8) +15: level (u8) — log level (0=EMERG..7=DEBUG)

Text immediately follows the 16-byte header.