Re: [PATCH 1/2] perf: convert: fix duplicate field names and avoid reserved keywords.

From: Jiri Olsa
Date: Wed Jan 21 2015 - 09:20:09 EST


On Wed, Jan 21, 2015 at 07:16:39PM +0800, Wang Nan wrote:
> Hi Jiri,
>
> I found that only this patch is not enough. When converting such tracepoints,
> it uses add_tracepoint_fields_values(..., struct format_field *fields ...),
> and fields->name is still the original one.
>
> If 'struct format_field' has a field like 'dup_name' we can make things simpler.
> However, struct format_field is part of traceevent, not only used by perf.
>
> I have no enough time to think on it. Jiri, could you please give me some hints
> so I can implement another patch tomorrow?

yea, looks like we either need to add 'void *priv' into 'struct format_field'
or if Steven doesn't like it, we'd need to save 'our' field name in some way
so it's reachable via format_field::name string.

Steven,
we need to use changed format_field::name to interface babeltrace
library, because it has restriction that fields within tracepoint
should have unique names.

Any chance we could introduce 'void *priv' member to format_field::name ?
Maybe with 'destroy_priv' callback to be called when the field is destroyed.

I can provide patch, just wanted to know first if you're not strictly against ;-)

thanks,
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/