Re: [PATCH v2 2/3] ftrace: add tracepoint for hrtimer

Xiao Guangrong
2009-07-15T01:33:32Z

Hi Thomas,

Thomas Gleixner wrote:
>
> Here I'd like to see a callback_done entry as well, so we can check
> for long lasting callbacks.
>

I am trying to address your comment that move trace_timer_expires()
form hrtimer_interrupt()/hrtimer_run_queues() to __run_hrtimer() to
trace the execution time of hrtimer's callback, like below:

__run_hrtimer()
{
.....
+ trace_hrtimer_expires();
restart = fn(timer);
+ trace_hrtimer_callback_done();
......
}

But I meet a problem here that I can't get the timestamps when hrtimer
expires in __run_hrtimer(), which is used to calculate the latency of
hrtimer. I think it's Ok to not move trace_hrtimer_expires(), that is:

hrtimer_interrupt()
{
......
+ trace_hrtimer_expires();
__run_hrtimer(timer);
......
}

__run_hrtimer()
{
......
restart = fn(timer);
+ trace_hrtimer_callback_done();
......
}

But if more accurate execution time is a require, we'd better use the
tracepoints added by Anton Blanchard <anton@samba.org>. That is:

hrtimer_interrupt()
{
......
+ trace_hrtimer_expires();
__run_hrtimer(timer);
......
}

__run_hrtimer()
{
......
+ trace_hrtimer_callback_entry()
restart = fn(timer);
+ trace_hrtimer_callback_exit();
......
}

Thanks,
Xiao