Re: [PATCH tip 0/3] Improvements of scheduler related Tracepoints

From: Peter Zijlstra
Date: Fri Dec 15 2017 - 04:53:26 EST


On Fri, Dec 15, 2017 at 08:53:30AM +0000, Teng Qin wrote:
> To have access to related task_struct is one of the main purposes of these
> patches. Take sched_switch as an example. We depend on the implementation
> of the Tracepoint is called from prev or next (which could, although unlikedly,
> change) and use current to get that task_struct, which feels, correct
> me if I'm wrong, kind of defeating the purpose of Tracepoints being more
> implementation-independent than kprobes. Then we have to figure out another
> Tracepoint or most likely a kprobe function to get the other (prev or next)
> task_struct.

Go read how tracepoints work. The tracepoint_probe things get you
exactly what you want.