Messages in this thread | | | Date | Wed, 4 Mar 2009 08:07:02 -0500 (EST) | From | Steven Rostedt <> | 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
| |