Re: [PATCH v2 4/4] ftrace: add latecy mesurement feature to workqueue tracer

From: KOSAKI Motohiro
Date: Mon Apr 13 2009 - 22:51:00 EST


> Index: b/include/trace/workqueue_event_types.h
> ===================================================================
> --- a/include/trace/workqueue_event_types.h 2009-04-13 13:58:21.000000000 +0900
> +++ b/include/trace/workqueue_event_types.h 2009-04-13 14:07:14.000000000 +0900
> @@ -43,6 +43,8 @@ TRACE_EVENT(workqueue_handler_entry,
> __field(pid_t, thread_pid)
> __field(struct work_struct *, work)
> __field(work_func_t, func)
> + __field(unsigned long, expected_time)
> + __field(unsigned long, actual_time)
> ),
>
> TP_fast_assign(
> @@ -50,10 +52,14 @@ TRACE_EVENT(workqueue_handler_entry,
> __entry->thread_pid = wq_thread->pid;
> __entry->work = work;
> __entry->func = work->func;
> + __entry->expected_time = work->expected_time;
> + __entry->actual_time = jiffies;
> ),

Oops, that's my fault.
There is work->expected_time only if CONFIG_WORKQUEUE_TRACER is on.


>
> - TP_printk("thread=%s:%d func=%pF", __entry->thread_comm,
> - __entry->thread_pid, __entry->func)
> + TP_printk("thread=%s:%d latency=%lums func=%pF", __entry->thread_comm,
> + __entry->thread_pid,
> + jiffies_to_msecs(__entry->actual_time-__entry->expected_time),
> + __entry->func)
> );



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