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

2013-01-24 Thread Ingo Molnar
* Arnaldo Carvalho de Melo wrote: > Em Tue, Jan 22, 2013 at 02:16:47PM +0100, Jiri Olsa escreveu: > > On Mon, Jan 21, 2013 at 11:45:42PM -0500, Steven Rostedt wrote: > > > This is only used in this function (the field_dynamic_elem_size() is > > > only called here). Can we not add the

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

2013-01-24 Thread Arnaldo Carvalho de Melo
Em Tue, Jan 22, 2013 at 02:16:47PM +0100, Jiri Olsa escreveu: > On Mon, Jan 21, 2013 at 11:45:42PM -0500, Steven Rostedt wrote: > > 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

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

2013-01-24 Thread Arnaldo Carvalho de Melo
Em Tue, Jan 22, 2013 at 02:16:47PM +0100, Jiri Olsa escreveu: On Mon, Jan 21, 2013 at 11:45:42PM -0500, Steven Rostedt wrote: 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

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

2013-01-24 Thread Ingo Molnar
* Arnaldo Carvalho de Melo a...@redhat.com wrote: Em Tue, Jan 22, 2013 at 02:16:47PM +0100, Jiri Olsa escreveu: On Mon, Jan 21, 2013 at 11:45:42PM -0500, Steven Rostedt wrote: This is only used in this function (the field_dynamic_elem_size() is only called here). Can we not add the

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

2013-01-22 Thread Jiri Olsa
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; > > + } > > + > > +

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

2013-01-22 Thread Jiri Olsa
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; +}

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

2013-01-21 Thread Steven Rostedt
On Mon, 2013-01-21 at 13:44 +0100, Jiri Olsa wrote: > Fixing the dynamic array format field parsing. > > Currently the event_read_fields function could segfault while parsing > dynamic array other than string type. The reason is the event->pevent > does not need to be set and gets dereferenced

[PATCH] tools lib traceevent: Handle dynamic array's element size properly

2013-01-21 Thread Jiri Olsa
Fixing the dynamic array format field parsing. Currently the event_read_fields function could segfault while parsing dynamic array other than string type. The reason is the event->pevent does not need to be set and gets dereferenced unconditionaly. Also adding proper initialization of

[PATCH] tools lib traceevent: Handle dynamic array's element size properly

2013-01-21 Thread Jiri Olsa
Fixing the dynamic array format field parsing. Currently the event_read_fields function could segfault while parsing dynamic array other than string type. The reason is the event-pevent does not need to be set and gets dereferenced unconditionaly. Also adding proper initialization of

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

2013-01-21 Thread Steven Rostedt
On Mon, 2013-01-21 at 13:44 +0100, Jiri Olsa wrote: Fixing the dynamic array format field parsing. Currently the event_read_fields function could segfault while parsing dynamic array other than string type. The reason is the event-pevent does not need to be set and gets dereferenced