Re: [PATCH 1/2] mm: page_alloc.c: Add tracepoints for slowpath

From: Janani Ravichandran
Date: Sun Aug 07 2016 - 06:36:44 EST



> On Aug 5, 2016, at 10:00 PM, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
>>
>
> You probably want to clear the trace here, or set function_graph here
> first. Because the function graph starts writing to the buffer
> immediately.
>

I did that, just didnât include it here :)
>>
>
> When threshold is set, the entry is not recorded, because it is only
> showing the exit and the time it took in that function:
>
> 0) kswapd0-52 | + 54.141 us | } /* shrink_zone */
>
> shrink_zone() took 54.141us.
>
> The reason it doesn't record the entry is because it would fill the
> entire buffer, if the threshold is never hit. One can't predict the
> time in a function when you first enter that function.

Right!
>
>>
>
> You need your own interpreter here. Perhaps a module that either reads
> the tracepoints directly and registers a function graph tracer itself.
> The trace events and function tracers are plugable. You don't need to
> use the tracing system to use them. Just hook into them directly.
>
> Things like the wakeup latency tracer does this. Look at
> kernel/trace/trace_sched_wakeup.c for an example. It hooks into the
> sched_wakeup and sched_switch tracepoints, and also has a way to use
> function and function_graph tracing.
>
>

I will look at that file. Thanks!
>
>>
>
> Great! And note, even if you add extra tracepoints, you can hook
> directly into them too. Again, see the trace_sched_wakeup.c for
> examples.

Alright. Thanks for all the help! :)

Janani.
>
> -- Steve