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

Thomas Gleixner
2009-07-06T20:13:18Z

On Mon, 6 Jul 2009, Xiao Guangrong wrote:
> +TRACE_EVENT(hrtimer_expire,
> +
> + TP_PROTO(struct hrtimer *timer, s64 now),
> +
> + TP_ARGS(timer, now),
> +
> + TP_STRUCT__entry(
> + __field( void *, timer )
> + __field( void *, function )

Again, function is not necessary here.

> + __field( s64, now )
> + ),
> +
> + TP_fast_assign(
> + __entry->timer = timer;
> + __entry->function = timer->function;
> + __entry->now = now;
> + ),
> +
> + TP_printk("timer=%p func=%pf now=%llu", __entry->timer, __entry->function,
> + (unsigned long long)__entry->now)
> +);
> +
> +TRACE_EVENT(hrtimer_cancel,
> +
> + TP_PROTO(struct hrtimer *timer),
> + TP_ARGS(timer),
> + TP_STRUCT__entry(
> + __field( void *, timer )
> + __field( void *, function )

Ditto.

> +static inline void debug_and_trace_hrtimer_expire(struct hrtimer *timer,
> + s64 now)

Technically not necessary.

>
> + debug_and_trace_hrtimer_expire(timer, basenow.tv64);
> __run_hrtimer(timer);

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

> }
> spin_unlock(&cpu_base->lock);
> @@ -1436,6 +1463,7 @@ void hrtimer_run_queues(void)
> hrtimer_get_expires_tv64(timer))
> break;
>
> + debug_and_trace_hrtimer_expire(timer, base->softirq_time.tv64);
> __run_hrtimer(timer);

Ditto.

Thanks,

tglx