lkml.org 
[lkml]   [2009]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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



\
 
 \ /
  Last update: 2009-03-04 14:09    [W:0.048 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site