Re: [PATCH] tracing/lockdep: report the time waited for a lock

From: Steven Rostedt
Date: Thu May 28 2009 - 10:32:41 EST




On Mon, 6 Apr 2009, Frederic Weisbecker wrote:
> ---
> include/trace/lockdep_event_types.h | 23 ++++++++++++++++++-----
> kernel/lockdep.c | 8 ++++----
> 2 files changed, 22 insertions(+), 9 deletions(-)
>
> diff --git a/include/trace/lockdep_event_types.h b/include/trace/lockdep_event_types.h
> index adccfcd..863f1e4 100644
> --- a/include/trace/lockdep_event_types.h
> +++ b/include/trace/lockdep_event_types.h
> @@ -32,11 +32,24 @@ TRACE_FORMAT(lock_contended,
> TP_FMT("%s", lock->name)
> );
>
> -TRACE_FORMAT(lock_acquired,
> - TP_PROTO(struct lockdep_map *lock, unsigned long ip),
> - TP_ARGS(lock, ip),
> - TP_FMT("%s", lock->name)
> - );
> +TRACE_EVENT(lock_acquired,
> + TP_PROTO(struct lockdep_map *lock, unsigned long ip, s64 waittime),
> +
> + TP_ARGS(lock, ip, waittime),
> +
> + TP_STRUCT__entry(
> + __field(const char *, name)
> + __field(unsigned long, wait_usec)
> + __field(unsigned long, wait_nsec_rem)
> + ),
> + TP_fast_assign(
> + __entry->name = lock->name;
> + __entry->wait_nsec_rem = do_div(waittime, NSEC_PER_USEC);

I know this is already accepted, but can you move the do_div into the
print section.

Thanks,

-- Steve

> + __entry->wait_usec = (unsigned long) waittime;
> + ),
> + TP_printk("%s (%lu.%03lu us)", __entry->name, __entry->wait_usec,
> + __entry->wait_nsec_rem)
> +);
>
--
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/