标签: linux-kernel linux-device-driver
如何从内核模块获取所有对process_name -> process_pid(用户空间和内核空间)的列表?
process_name -> process_pid
答案 0 :(得分:5)
在您的内核模块中,您可以执行以下操作:
rcu_read_lock(); for_each_process(g) { printk("%s --> %d\n", g->comm, task_tgid_vnr(g)); } rcu_read_unlock();