[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.0905281032010.27708@gandalf.stny.rr.com>
Date: Thu, 28 May 2009 10:32:31 -0400 (EDT)
From: Steven Rostedt <rostedt@...dmis.org>
To: Frederic Weisbecker <fweisbec@...il.com>
cc: Ingo Molnar <mingo@...e.hu>, LKML <linux-kernel@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [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)
> +);
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists