lkml.org 
[lkml]   [2009]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tracing/lockdep: report the time waited for a lock


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)
> +);
>


\
 
 \ /
  Last update: 2009-05-28 16:35    [W:1.172 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site