Printing from Rust Kernel Code and Finding the Output
Rust kernel code prints with macros that mirror the kernel's C printing functions, one per severity level, and the text appears in the kernel log tagged with the module's name. Knowing the tag and the level lets you filter thousands of unrelated lines down to your own. This is the simplest debugging tool in the kernel and the one you will use most. Prints that you cannot find are almost always prints at a level your console is filtering out.
Questions this Concept answers
- Why do prints from a Rust kernel module appear in the log carrying the module's name?
Debugging Linux Kernel Modules with printk and Remote GDB/OpenOCD
Kernel module debugging relies on two complementary approaches because user-space debugging tools and standard libraries are unavailable in the privileged kernel environment: printk, a non-interactiv…