diff --git a/kernel_module/dep.c b/kernel_module/dep.c index 8e4d070..d2de568 100644 --- a/kernel_module/dep.c +++ b/kernel_module/dep.c @@ -57,7 +57,7 @@ static struct task_struct *kthread; static int work_func(void *data) { while (!kthread_should_stop()) { - printk(KERN_INFO "%d\n", lkmc_dep); + pr_info("%d\n", lkmc_dep); usleep_range(1000000, 1000001); } return 0; diff --git a/kernel_module/kthread.c b/kernel_module/kthread.c index 22a092f..fe0247b 100644 --- a/kernel_module/kthread.c +++ b/kernel_module/kthread.c @@ -22,7 +22,7 @@ static int work_func(void *data) { int i = 0; while (!kthread_should_stop()) { - printk(KERN_INFO "%d\n", i); + pr_info("%d\n", i); usleep_range(1000000, 1000001); i++; if (i == 10) diff --git a/kernel_module/kthreads.c b/kernel_module/kthreads.c index 690b342..e480671 100644 --- a/kernel_module/kthreads.c +++ b/kernel_module/kthreads.c @@ -15,7 +15,7 @@ static int work_func1(void *data) { int i = 0; while (!kthread_should_stop()) { - printk(KERN_INFO "1 %d\n", i); + pr_info("1 %d\n", i); usleep_range(1000000, 1000001); i++; if (i == 10) @@ -28,7 +28,7 @@ static int work_func2(void *data) { int i = 0; while (!kthread_should_stop()) { - printk(KERN_INFO "2 %d\n", i); + pr_info("2 %d\n", i); usleep_range(1000000, 1000001); i++; if (i == 10) diff --git a/kernel_module/module_init.c b/kernel_module/module_init.c index 0f880ad..9d932ca 100644 --- a/kernel_module/module_init.c +++ b/kernel_module/module_init.c @@ -17,11 +17,11 @@ MODULE_LICENSE("GPL"); int init_module(void) { - printk(KERN_INFO "init_module\n"); + pr_info("init_module\n"); return 0; } void cleanup_module(void) { - printk(KERN_INFO "cleanup_module\n"); + pr_info("cleanup_module\n"); } diff --git a/kernel_module/panic.c b/kernel_module/panic.c index a0f0ff9..c3ddef2 100644 --- a/kernel_module/panic.c +++ b/kernel_module/panic.c @@ -15,14 +15,14 @@ The alternative is to get the serial data out streamed to console or to a file: static int myinit(void) { - printk(KERN_INFO "panic init\n"); + pr_info("panic init\n"); panic("hello panic"); return 0; } static void myexit(void) { - printk(KERN_INFO "panic cleanup\n"); + pr_info("panic cleanup\n"); } module_init(myinit) diff --git a/kernel_module/sleep.c b/kernel_module/sleep.c index 2fc2909..0925cd0 100644 --- a/kernel_module/sleep.c +++ b/kernel_module/sleep.c @@ -24,7 +24,7 @@ static void work_func(struct work_struct *work) { int i = 0; while (atomic_read(&run)) { - printk(KERN_INFO "%d\n", i); + pr_info("%d\n", i); usleep_range(1000000, 1000001); i++; if (i == 10) diff --git a/kernel_module/work_from_work.c b/kernel_module/work_from_work.c index 017b9b2..d144e4c 100644 --- a/kernel_module/work_from_work.c +++ b/kernel_module/work_from_work.c @@ -18,7 +18,7 @@ DECLARE_WORK(work, work_func); static void work_func(struct work_struct *work) { - printk(KERN_INFO "%d\n", i); + pr_info("%d\n", i); i++; queue_delayed_work(queue, &next_work, HZ); } diff --git a/kernel_module/workqueue_cheat.c b/kernel_module/workqueue_cheat.c index ab6e32d..52aef8c 100644 --- a/kernel_module/workqueue_cheat.c +++ b/kernel_module/workqueue_cheat.c @@ -27,7 +27,7 @@ static struct workqueue_struct *queue; static void work_func(struct work_struct *work) { - printk(KERN_INFO "worker\n"); + pr_info("worker\n"); } DECLARE_WORK(work, work_func);