拦截V4L2 IOCTL系统调用
我有一个正常工作的参考程序,我正在尝试调试为什么我的程序无法正常工作。该程序对v4l2_ioctl()
进行了一系列调用,我想将每个调用的参数打印为v4l2_ioctl()
。有没有办法拦截这些电话而不必重新编译内核?
我尝试使用GDB,但是因为我没有讨论符号,所以我无法阅读参数。
有没有一种方法可以创建一个将转发到真实设备的虚拟设备,但在过程中登录?
我正在使用嵌入式设备上工作,因此内核有点……在功能上受到限制。
I have a reference program that's working correctly and I'm trying to debug why my program doesn't work correctly. The program makes a series of calls to v4l2_ioctl()
and I'd like to print out the arguments to each call to v4l2_ioctl()
. Is there a way to intercept these calls without having to recompile the kernel?
I've tried using gdb, however because I don't have debug symbols I cannot read the arguments.
Is there a way to create a virtual device that forwards to the real device, but logs in the process?
I'm working on an embedded device, so the kernel is a bit... constrained on features.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您的内核构建中支持了可加载的内核模块(LKM)。您可以利用LKM作为rootkit来连接特定的 ftracable 内核函数。
检查此链接: linux root 2 part 2:ftrace and function and function hooking 。
Suppose a loadable kernel module(LKM) is supported in your kernel build. You may leverage an LKM as a rootkit to hook a specific ftraceable kernel function.
Check this link out: Linux Rootkits Part 2: Ftrace and Function Hooking.