开发者

Trace the calls to pull_task() for running processes

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. Perha开发者_如何学编程ps that is the reason why strace cannot attach to it?

Kindly advise. Thanks.


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...

echo function > /sys/kernel/debug/tracing/current_tracer

View the trace by cat /sys/kernel/debug/tracing/trace

These articles should help:

Debugging with Ftrace part one

Debugging with Ftrace part two

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜