This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
probe the cpu idle event
- From: "Li Guanglei" <guanglei at cn dot ibm dot com>
- To: <systemtap at sources dot redhat dot com>
- Date: Fri, 6 Jan 2006 17:52:42 +0800
- Subject: probe the cpu idle event
Hi folks,
In my tapsets, I tried to probe cpu idle event(on SMP):
probe addevent.backtrace.cpuidle
= kernel.inline("idle_balance")
But if idle_balance successfully pulled tasks from other CPUs onto
current CPU, the scheduler will choose the newly migrated task to run
instead of idle task. So this probe definition is not accurate.
It seems that the following probe will correctly reflect the idle
event:
probe addevent.backtrace.cpuidle
= kernel.inline("idle_balance").return
{
if(! runqueue->nr_running) //pseudo code
then scheduler will pick idle task to run
}
But currently systemtap doesn't support return of inline function.
Another way is to probe __switch_to to check if next->pid is zero.
But put a probe handler onto __switch_to is more expensive than onto
idle_balance.
So anybody has some good ideas of catching the cpu idle events? Or is
there a plan to implement the return of inline function?