[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.0903040801580.7995@gandalf.stny.rr.com>
Date: Wed, 4 Mar 2009 08:07:02 -0500 (EST)
From: Steven Rostedt <rostedt@...dmis.org>
To: Frederic Weisbecker <fweisbec@...il.com>
cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...e.hu>,
Török Edwin <edwintorok@...il.com>,
Jason Baron <jbaron@...hat.com>,
lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -v2] tracing: lockdep tracepoints
On Wed, 4 Mar 2009, Frederic Weisbecker wrote:
> >
>
>
> The TRACE_FIELD_SPECIAL is only used in case of complex assignment,
> those that can't be done in a simple "=" expression.
>
> All you need is simply:
>
> TRACE_FORMAT(lock_contended,
> TPPROTO(struct lockdep_map *lock, unsigned long ip),
> TPARGS(lock, ip),
> TPFMT("%s", lock->name)
> TRACE_STRUCT(
> TRACE_FIELD(char *, name, lock->name)
> )
> TPRAWFMT("%s");
> );
Nope, that wont work :-( If this is saved to userspace, all the user
would have is some hex value. If they have a copy of the vmlinux image,
then they could probably translate that value, unless it was a module.
Perhaps something like:
TRACE_EVENT_FORMAT(lock_contended,
TPPROTO(struct lockdep_map *lock, unsigned long ip),
TPARGS(lock, ip),
TPFMT("%s", lock->name);
TRACE_STRUCT(
TRACE_FIELD_SPECIAL(char name[16], name,
strncpy(name, lock->name, 16));
),
TPRAWFMT("%s")
);
This would require those 16 bytes to be copied with the raw format, but
then we would always have the name (first 16 bytes anyway) for later use.
-- Steve
--
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