show info from current pid from the scheduler

This commit is contained in:
Vincent Batts 2014-09-18 16:05:40 -04:00
parent 05c5575fd3
commit 0f95375712
1 changed files with 5 additions and 0 deletions

View File

@ -1,6 +1,8 @@
#include <linux/module.h> /* all kernel modules need this */
#include <linux/init.h> /* provides initialization routines */
#include <linux/sched.h>
#include <linux/kallsyms.h>
#include <linux/string.h>
@ -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();