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]

Re: Instrumenting context-switching


Mike Mason wrote:
> The scheduler tapset probes context_switch() on x86_64, but that doesn't 
> help much.  context_switch() is an inline and, thus, the entry parameters 
> prev and next aren't accessible via SystemTap.

You can still effectively get prev and next if you use a pair of probes.
A probe at the beginning of context_switch is still on the old thread,
so current == prev.  A probe on finish_task_switch is in the context of
the new thread, so current == next.  You can access various fields in
current by using the context.stp tapset, or use task_current() to get
the actual task_struct pointer.

These functions are used for scheduler.cpu_off and scheduler.cpu_off,
since they are architecture-independent locations in the scheduler.


Josh


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