进程使用proc导出信息
时间:2010-09-16 来源:letmego163
STEP 1: Add a field named can_pick in task_struct. Now we want to export it to user space by proc file system.
STEP 2: change to kernel source tree, in fs/proc/base.c, add following code at proper line.
and,
STEP 3: compile kernel. cat /proc/xxx/can_pick.
struct task_struct{ |
STEP 2: change to kernel source tree, in fs/proc/base.c, add following code at proper line.
2633 INF("can_pick", S_IRUGO, proc_pid_can_pick), |
and,
367 static int proc_pid_src_cpu(struct task_struct *task, char *buffer) |
STEP 3: compile kernel. cat /proc/xxx/can_pick.
相关阅读 更多 +