Skip to content

Add support to standard dmesg command for the optional Linux Kernel debug CONFIG option PRINTK_CALLER field #2609

@egchron

Description

@egchron

Add support to standard dmesg command for the optional Linux Kernel debug CONFIG option PRINTK_CALLER field:

The printk caller field adds an optional dmesg field that contains the Thread Id or CPU Id that is issuing the printk to add the message to the kernel ring buffer. This makes debugging simpler as dmesg entries for a specific thread or CPU can be recognized.

The dmesg -S using the old syslog interface supports printing the PRINTK_CALLER field but currently standard dmesg does not support printing the field if present. There are utilities that use dmesg and so it would be optimal if dmesg supported PRINTK_CALLER as well.

The additional field provided by PRINTK_CALLER is only present if it was configured for the Linux kernel where the dmesg command is run. It is a debug option and not configured by default so the dmesg output will only change for those kernels where the option was configured when the kernel was built. For users who went to the trouble to configure PRINTK_CALLER and have the extra field available for debugging, having dmesg print the field is very helpful.

I'm attaching a gzip'ed patch file that adds support for dmesg and works with all dmesg options including -J to produce JSON output if the website allows this (says it is a supported file type). I will add the incident number that is assigned here into the patch header.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions