kmsg_dump_register(9)
π kmsg_dump_register(9) π
Okay bestie, so this one lives in the Kernel API Manual, and it is exactly what it sounds like: registering a kernel log dumper. Like, the kernel keeps a diary (the log), and this is how you sign up a little helper that gets to read it out loud when things go π. Iconic behaviour, honestly.
β¨ NAME β¨
kmsg_dump_register β register a kernel log dumper.
π«Ά SYNOPSIS π«Ά
int kmsg_dump_register (struct kmsg_dumper *dumper );
π ARGUMENTS π
dumperβ a pointer to thekmsg_dumperstructure. That's your little registration form, basically. Fill it in, hand it over. π¦
π₯ DESCRIPTION π₯
So what this does: it adds a kernel log dumper to the system. That's the whole vibe check. β
And here's the important part, bestie, so listen β the dump callback inside that structure will be called when the kernel oopses or panics, and it must be set. Like, not optional. If it's not set, that's a problem. No cap. π
Return value? It returns zero on success and -EINVAL or -EBUSY otherwise. So zero = slay, anything else = check yourself before you wreck yourself. π
π SEE ALSO π
The kernel file ./kernel/printk/printk.c is where the lore lives, and the whole printk console squad is linked here β honestly an entire friend group:
console_list_lock(9),console_list_unlock(9),console_srcu_read_lock(9),console_srcu_read_unlock(9)console_lock_spinning_enable(9),console_lock_spinning_disable_and_check(9),console_trylock_spinning(9)printk_parse_prefix(9),add_preferred_console(9),match_devname_and_update_preferred_console(9)console_suspend_all(9),console_cpu_notify(9)console_lock(9),console_trylock(9),console_unlock(9),console_flush_on_panic(9)printk_kthreads_shutdown(9),console_force_preferred_locked(9)pr_flush(9),wake_up_klogd(9),defer_console_output(9),printk_trigger_flush(9),printk_timed_ratelimit(9)kmsg_dump_unregister(9),kmsg_dump_desc(9),kmsg_dump_get_line(9),kmsg_dump_get_buffer(9),kmsg_dump_rewind(9)console_try_replay_all(9)__printk_cpu_sync_wait(9),__printk_cpu_sync_try_get(9),__printk_cpu_sync_put(9)
Like, the whole extended cast. Go read them, iykyk. πβ¨
Fr fr though β that callback must be set before you register. The kernel does not do "oops, forgot it" energy. π
Mwah, that's the page! π This little gem ships from ./kernel/printk, dated October 2026, and it's giving very much "printk bestie" main character energy the whole way through. Catch you on the next man page! ππ§
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms