STRUCT PRINTK_MESSAGE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– STRUCT PRINTK_MESSAGE(9) πŸ’–

ok so this is a page from the Kernel API Manual β€” that's the manual name bestie, we're in the kernel docs now β€” and today's main character is struct printk_message, a whole container for a printk message that's already been prepped and is ready to go out into the world. ✨


🌸 NAME 🌸

struct printk_message β€” literally a container for a prepared printk message. that's it, that's the vibe.


πŸŽ€ SYNOPSIS πŸŽ€

struct printk_message {
    struct printk_buffers   *pbufs;
    unsigned int            outbuf_len;
    u64 seq;
    unsigned long           dropped;
  #ifdef CONFIG_PRINTK_EXECUTION_CTX;
    int cpu;
    pid_t pid;
    char comm[TASK_COMM_LEN];
  #endif;
 };

like yes, it's giving struct, it's giving #ifdef, it's giving conditional members. we love a flexible icon. πŸ’…


πŸ¦‹ Members πŸ¦‹

okay let's go member by member because every single one of them matters, no skips:

  • pbufs β€” the printk buffers used to prepare the message. this is where the whole thing gets assembled, bestie. 🫢
  • outbuf_len β€” the length of the prepared text in pbufs->outbuf that you're gonna output. 🎯 important detail: this does not count the terminator. and a value of 0 means there's nothing to output and this record should be skipped. zero = ghost, we move on.
  • seq β€” the sequence number of the record used for pbufs->outbuf. it's the receipt, the tracking number, the iykyk. πŸ”₯
  • dropped β€” the number of dropped records from reading seq. yes, some got away 😭, this is how many.
  • cpu β€” the CPU on which the message was generated. main character CPU energy πŸ‘‘
  • pid β€” the PID of the task that generated the message. we know exactly who did this.
  • comm β€” the name of the task that generated the message. char comm[TASK_COMM_LEN] β€” the name, in all its task-name-sized glory. πŸ’œ
lowkey note: cpu, pid, and comm live inside that #ifdef CONFIG_PRINTK_EXECUTION_CTX; block up in the synopsis β€” so they're conditional members, not always along for the ride.

🌈 SEE ALSO 🌈

go touch some related docs, they're all linked:

  • Kernel file ./kernel/printk/internal.h β€” the file where the real ones live
  • nbcon_kthread_wake(9)
  • struct console_flush_type(9)
  • struct printk_buffers(9)

and that's the whole page, bestie β€” that's the tea, that's the lore. πŸ“

this lil gem comes to you from the kernel source at ./kernel/printk, dated October 2026, and it's been struct printk_message(9) the whole time. periodt. πŸ’…βœ¨πŸ§š

πŸ“¦ where this page comes from