在内核中,如何使用可加载的内核模块来 Hook 进程调度程序以添加 Hook 每个进程切换?
我想确定和分析操作系统中进程/线程切换的每个事件。
最佳答案
如果要分析,已经存在:https://perf.wiki.kernel.org/index.php/Tutorial#Events
如果您对实现感兴趣,可以引用 perf 工具调用的用于监控上下文切换事件的代码。
关于linux-kernel - 在 Linux 中动态添加 Hook 到进程切换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34526472/