Re: [PATCH] perf tools: report initial event parsing error

From: Ian Rogers
Date: Sat Nov 16 2019 - 02:51:47 EST


On Mon, Nov 11, 2019 at 4:02 AM Jiri Olsa <jolsa@xxxxxxxxxx> wrote:
>
> On Fri, Nov 08, 2019 at 10:15:33AM -0800, Ian Rogers wrote:
>
> SNIP
>
> > diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
> > index 43c05eae1768..46a72ecac427 100644
> > --- a/tools/perf/builtin-trace.c
> > +++ b/tools/perf/builtin-trace.c
> > @@ -3016,11 +3016,18 @@ static bool evlist__add_vfs_getname(struct evlist *evlist)
> > {
> > bool found = false;
> > struct evsel *evsel, *tmp;
> > - struct parse_events_error err = { .idx = 0, };
> > - int ret = parse_events(evlist, "probe:vfs_getname*", &err);
> > + struct parse_events_error err;
> > + int ret;
> >
> > - if (ret)
> > + bzero(&err, sizeof(err));
>
> hum, what's the problem with the zero init above?

There are 3 patterns for initializing parse_events_error in the code,
bzero, memset and {.idx =0,}. I made all instances use bzero for
consistency.

Thanks,
Ian

> jirka
>