Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

针对FindFilterFunction适配内核未开启DEBUG_FS的情况 #30

Closed
SeeFlowerX opened this issue Apr 12, 2023 · 4 comments · Fixed by #31
Closed

针对FindFilterFunction适配内核未开启DEBUG_FS的情况 #30

SeeFlowerX opened this issue Apr 12, 2023 · 4 comments · Fixed by #31
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@SeeFlowerX
Copy link

在Android上,如果内核未开启DEBUG_FS的时候,没有/sys/kernel/debug目录,如果使用ebpfmanager编写程序,那么将无法运行任何kretprobe/kprobe程序

同时内核未开启DEBUG_FS的时候,/sys/kernel/tracing下面也没有名为available_filter_functions的文件

可以考虑通过读取/proc/kallsyms来作为fallback方案获取信息?

@SeeFlowerX
Copy link
Author

SeeFlowerX commented Apr 12, 2023

其实是有读取/proc/kallsyms的,但是在没有上面的debug目录的时候,提前返回了

return err

@cfc4n cfc4n added bug Something isn't working help wanted Extra attention is needed labels Apr 14, 2023
@cfc4n
Copy link
Member

cfc4n commented Apr 21, 2023

感谢反馈,我近期看下二者之间的差异。

你测试过在未开启DEBUG_FS下,自己改为/proc/kallsyms的效果吗?

@SeeFlowerX
Copy link
Author

我没有做什么修改,仅仅是将上面那一行return err注释调,然后编译使用,没有什么问题。

不过我仍然在使用ebpfmanager v0.3.0,没有在最新版上测试过。

@cfc4n
Copy link
Member

cfc4n commented Apr 26, 2023

pr里提了,辛苦试试。

@cfc4n cfc4n closed this as completed in #31 Apr 28, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants