From 0f953757120102da5daa2502fc9889c44d48d5a2 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 18 Sep 2014 16:05:40 -0400 Subject: [PATCH] show info from current pid from the scheduler --- mod_hello.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mod_hello.c b/mod_hello.c index 4119ca9..02b5b36 100644 --- a/mod_hello.c +++ b/mod_hello.c @@ -1,6 +1,8 @@ #include /* all kernel modules need this */ #include /* provides initialization routines */ +#include + #include #include @@ -47,6 +49,9 @@ static int __init hello_init(void) unsigned long jiffies_start, jiffies_diff; unsigned long sym_addr; + // in linux/sched.h + //struct task_struct *current; + printk("[%s] pid: %d, comm: %s\n", __this_module.name, current->pid, current->comm); hello_print_hello();