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

From: Xiao Guangrong
Date: Tue Jul 14 2009 - 21:33:47 EST


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@xxxxxxxxx>. 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/