mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
linux: pr_debug with CONFIG_DYNAMIC_DEBUG=y
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
. Debugging
|
||||
.. link:hello.c[]
|
||||
.. link:hello2.c[]
|
||||
.. link:printk.c[]
|
||||
. Panic and friends
|
||||
.. link:panic.c[]
|
||||
.. link:oops.c[]
|
||||
|
||||
20
kernel_module/myprintk.c
Normal file
20
kernel_module/myprintk.c
Normal file
@@ -0,0 +1,20 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
|
||||
static int myinit(void)
|
||||
{
|
||||
pr_alert("printk alert\n");
|
||||
pr_crit("printk crit\n");
|
||||
pr_err("printk err\n");
|
||||
pr_warning("printk warning\n");
|
||||
pr_notice("printk notice\n");
|
||||
pr_info("printk info\n");
|
||||
pr_debug("printk debug\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void myexit(void) { }
|
||||
|
||||
module_init(myinit)
|
||||
module_exit(myexit)
|
||||
MODULE_LICENSE("GPL");
|
||||
Reference in New Issue
Block a user