This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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?




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]