Running process details in linux kernel

#include<linux/init.h> #include<linux/module.h> #include<linux/sched.h> static int processdetails_init(void) { struct task_struct *task; for_each_process(task) { printk("ProcessName %s\t Pid:%d\t state:%ld\n",task->comm, task->pid, task->state); } return 0; } static void processdetails_exit(void) { } module_init(processdetails_init); module_exit(processdetails_exit);
This is a sample code to get details of running processes in system from linux kernel mod

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.