probe the cpu idle event

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view

probe the cpu idle event

Li Guanglei
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
   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

So anybody has some good ideas of catching the cpu idle events? Or is
there a plan to implement the return of inline function?

Reply | Threaded
Open this post in threaded view

Re: probe the cpu idle event

Roland McGrath
A return probe for an inline function is in general not possible to define.