show info from current pid from the scheduler
This commit is contained in:
parent
05c5575fd3
commit
0f95375712
1 changed files with 5 additions and 0 deletions
|
@ -1,6 +1,8 @@
|
||||||
#include <linux/module.h> /* all kernel modules need this */
|
#include <linux/module.h> /* all kernel modules need this */
|
||||||
#include <linux/init.h> /* provides initialization routines */
|
#include <linux/init.h> /* provides initialization routines */
|
||||||
|
|
||||||
|
#include <linux/sched.h>
|
||||||
|
|
||||||
#include <linux/kallsyms.h>
|
#include <linux/kallsyms.h>
|
||||||
#include <linux/string.h>
|
#include <linux/string.h>
|
||||||
|
|
||||||
|
@ -47,6 +49,9 @@ static int __init hello_init(void)
|
||||||
unsigned long jiffies_start, jiffies_diff;
|
unsigned long jiffies_start, jiffies_diff;
|
||||||
unsigned long sym_addr;
|
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();
|
hello_print_hello();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue