跟踪正在运行的进程对 pull_task() 的调用
我正在尝试计算系统中进程调用 pull_task() 的次数。 pull_task() 是一个调度函数,它将任务从繁忙 CPU 的运行队列移动到空闲 CPU 的运行队列。 我找不到任何简单的机制(包括 perf top)来找出这个问题。
系统中有一个名为migration的根进程,我预感这个进程可能负责调用pull_task()。但我也无法将 strace 附加到此进程,它会引发以下错误:
Attach: ptrace(PTRACE_ATTACH, ...): 不允许操作。
进程“迁移”的优先级是实时的。也许这就是 strace 无法附加到它的原因?
请指教。谢谢。
I am trying to count the number of times pull_task() is called by processes in my system. pull_task() is a scheduling function that moves a task from runqueue of a busy CPU to the runqueue of an idle CPU.
I could not find any simple mechanism (inclunding perf top) to find this out.
There is a root process called migration in the system, I have a hunch that this process might be responsible for calling pull_task(). But I also cannot attach strace to this process, it throws the following error:
attach: ptrace(PTRACE_ATTACH, ...): Operation not permitted.
The priority of the process 'migration' is realtime. Perhaps that is the reason why strace cannot attach to it?
Kindly advise. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你需要看看Ftrace。这将给出一段时间内系统中发生的所有内核函数调用的完整列表。
像这样打开函数跟踪器...
查看跟踪
cat /sys/kernel/debug/tracing/trace
这些文章应该有所帮助:
使用 Ftrace 进行调试第一个
< a href="http://lwn.net/Articles/366796/" rel="nofollow">使用 Ftrace 进行调试第二部分
You need to look at Ftrace. This will give a complete listing of all kernel function calls occurring in your system for some time period.
Turn on the function tracer like so...
View the trace by
cat /sys/kernel/debug/tracing/trace
These articles should help:
Debugging with Ftrace part one
Debugging with Ftrace part two