Messages in this thread | | | Date | Tue, 22 Jan 2013 14:16:47 +0100 | From | Jiri Olsa <> | Subject | Re: [PATCH] tools lib traceevent: Handle dynamic array's element size properly |
| |
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
| |