Re: [PATCH] perf trace: Handle legacy syscalls

From: Arnaldo Carvalho de Melo
Date: Fri Mar 20 2015 - 11:46:01 EST


Em Fri, Mar 20, 2015 at 11:40:11AM -0400, Steven Rostedt escreveu:
> On Fri, 20 Mar 2015 12:32:26 -0300
> Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> wrote:
> > Em Thu, Mar 19, 2015 at 12:36:21PM -0600, David Ahern escreveu:
> > > +++ b/tools/lib/traceevent/event-parse.c
> > > @@ -6228,15 +6228,20 @@ void pevent_ref(struct pevent *pevent)
> > > pevent->ref_count++;
> > > }
> > >
> > > +void free_format_field(struct format_field *field)
> > > +{
> > > + free(field->type);
> > > + free(field->name);
> > > + free(field);
> > > +}
> > > +
> > > static void free_format_fields(struct format_field *field)
> > > {
> > > struct format_field *next;
> > >
> > > while (field) {
> > > next = field->next;
> > > - free(field->type);
> > > - free(field->name);
> > > - free(field);
> > > + free_format_field(field);
> > > field = next;
> > > }
> > > }
> > > diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h
> > > index 5b4efc062320..a548fac646f6 100644
> > > --- a/tools/lib/traceevent/event-parse.h
> > > +++ b/tools/lib/traceevent/event-parse.h
> > > @@ -619,6 +619,7 @@ enum pevent_errno pevent_parse_format(struct pevent *pevent,
> > > const char *buf,
> > > unsigned long size, const char *sys);
> > > void pevent_free_format(struct event_format *event);
> > > +void free_format_field(struct format_field *field);
>
> Can we make it "pevent_free_format_field" to keep consistency.
>
> > >
> > > void *pevent_get_field_raw(struct trace_seq *s, struct event_format *event,
> > > const char *name, struct pevent_record *record,
> > > diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
> > > index dcd950ef2fd7..5caeefeda48a 100644
> >
> >
> > Up to here we should have a separate patch, one that I would like to
> > have an Acked-by: Rostedt, ok?
>
> I'm fine with the change if the name of the function is updated.

Ok, so I'll put it in a separate patch, authored by David, with your
Acked-by, it may be useful at some point besides being used in the
libtraceevent internal free_format_fields() static function.

- Arnaldo
--
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/