Skip to main content

Module dmesg

Module dmesg 

Source
Expand description

Linux kernel dmesg ring buffer extraction.

Extracts the kernel log ring buffer (log_buf) from memory. The kernel stores dmesg messages in a circular buffer pointed to by the log_buf symbol with length log_buf_len.

Each log record (struct printk_log / log) has:

  • len (u16) — total record length including text+dict
  • text_len (u16) — length of the text message
  • dict_len (u16) — length of the dict (key=value facility info)
  • facility (u8) — syslog facility
  • level (u8) — log level (0=EMERG..7=DEBUG)
  • ts_nsec (u64) — timestamp in nanoseconds since boot
  • Text immediately follows the 16-byte header

Structs§

DmesgEntry
A single parsed dmesg log entry from the kernel ring buffer.

Functions§

extract_dmesg
Extract dmesg entries from the kernel ring buffer.