0
我有一个愚蠢的问题, 我想通过系统tap来了解源代码流,因为我试图使用内核访问本地变量。语句探测函数,它会显示除指针之外的所有其他变量。systemtap:能够访问本地变量,但不能访问本地指针
probe module("Module_Path/proc_rw.ko").statement("[email protected] Src Path/proc_rw.c+9")
{
printf("local = %s\n", $$locals)
}
Module Code :
static ssize_t my_write(struct file *f, const char __user *buf, size_t len, loff_t *off)
{
pid_t pid;
int ret;
struct task_struct *task_local;
int *i;
ret=copy_from_user(c, buf, len);
i=&ret;
pid=simple_strtol(buf, NULL, 10);
task_local=pid_task(find_vpid(pid), PIDTYPE_PID);
return len;
}
在i执行上述STAP代码,就返回,
本地= PID = 0xf98 RET =为0x0 task_local =?我=?
任何有助于理解为什么task_local和i值不打印的将有所帮助。
Regards, Yash。