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

From: Thomas Gleixner
Date: Tue May 26 2009 - 17:44:38 EST


On Fri, 22 May 2009, Xiao Guangrong wrote:
> +TRACE_EVENT(hrtimer_start,
> +
> + TP_PROTO(struct hrtimer *timer),
> +
> + TP_ARGS(timer),
> +
> + TP_STRUCT__entry(
> + __field( void *, timer )
> + __field( void *, function )
> + __field( s64, expires )
> + __field( s64, softexpires )
> + ),
> +
> + TP_fast_assign(
> + __entry->timer = timer;
> + __entry->function = timer->function;
> + __entry->expires = ktime_to_ns(hrtimer_get_expires(timer));
> + __entry->softexpires = ktime_to_ns(hrtimer_get_softexpires(timer));
> + ),

Yuck, we really do not want expensive conversions in the fast
path. This can be done by printk or user space tools.

> @@ -1119,6 +1122,7 @@ void hrtimer_init(struct hrtimer *timer, clockid_t clock_id,
> {
> debug_hrtimer_init(timer);
> __hrtimer_init(timer, clock_id, mode);
> + trace_hrtimer_init(timer, clock_id, mode);

The comments I made about the timer.c tracepoints vs. debugobjects
apply here as well.

Thanks,

tglx
--
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/