我按照这个文档:http : //www-users.cs.umn.edu/~boutcher/kprobes/kprobes.txt.html 来了解kprobe。
如文档中所述,我创建了 kprobe_example.c 和 Makefile。(这两个文件的代码都在文档中给出。我做了一个复制粘贴,没有别的)
当我使用“make”命令编译 Makefile 时,我收到了这个错误:
kprobe_example.c:15:16: error: ‘struct pt_regs’ has no member named ‘eip’
p->addr, regs->eip, regs->eflags);
^
我还在 kprobe_example.c 中包含了 ptrace.h 头文件,但我仍然无法解决该错误。非常感谢您对此的任何帮助。