linux: pr_debug with CONFIG_DYNAMIC_DEBUG=y

This commit is contained in:
Ciro Santilli
2018-04-14 21:21:51 +01:00
parent a08a87dc0f
commit f33dab4a1c
4 changed files with 129 additions and 5 deletions

View File

@@ -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
View 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");