Messages in this thread | | | Subject | Re: [PATCH -v2] tracing: lockdep tracepoints | From | Peter Zijlstra <> | Date | Wed, 04 Mar 2009 14:01:42 +0100 |
| |
On Wed, 2009-03-04 at 13:12 +0100, 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"); > );
As discussed on IRC, that won't actually work. In generic, you cannot assume the string is stable, in my particular case it would work, since lock->name is a compile time constant, except for modules, who will still ruin that.
So I think something like TRACE_FIELD_STRING() is called for. Not sure how to integrate a variable length field like that with the static format description though. Maybe use offsets from the start of the object as string pointers, so you can place the variable sized bits after the static bits.
| |