Re: [PATCH] tools lib traceevent: Handle dynamic array's elementsize properly

From: Jiri Olsa
Date: Tue Jan 22 2013 - 08:16:55 EST


On Mon, Jan 21, 2013 at 11:45:42PM -0500, Steven Rostedt wrote:
> On Mon, 2013-01-21 at 13:44 +0100, Jiri Olsa wrote:

SNIP

> > + for (i = 0; table[i].type; i++) {
> > + if (!strcmp(table[i].type, field->type_dyn))
> > + return table[i].size;
> > + }
> > +
> > + return 0;
> > +}
> > +
> > static int event_read_fields(struct event_format *event, struct format_field **fields)
> > {
> > struct format_field *field = NULL;
> > @@ -1390,7 +1418,7 @@ static int event_read_fields(struct event_format *event, struct format_field **f
> > field->type = new_type;
> > strcat(field->type, " ");
> > strcat(field->type, field->name);
> > - free_token(field->name);
> > + field->type_dyn = field->name;
>
> This is only used in this function (the field_dynamic_elem_size() is
> only called here). Can we not add the field->type_dyn, and just use a
> local variable here. You just need to make sure you free it correctly.

ook, will send v2

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/