Re: [PATCH] perf bench: add benchmark for evlist open/close operations

From: Arnaldo Carvalho de Melo
Date: Tue Aug 10 2021 - 10:07:53 EST


Em Tue, Aug 10, 2021 at 11:03:22AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Tue, Aug 10, 2021 at 12:31:55PM +0200, Riccardo Mancini escreveu:
> > Unrelated to this small issue, I noticed I forgot to check the return of
> > bench__create_evlist. Would you like me to send a v2 fixing both issues or are
> > you able to apply this other small change yourself?

> Nah, as this is the HEAD right now in my local branch, I'll apply it
> myself, thanks!

Also you forgot another check for this same function
(bench__create_evlist()), before that loop. I'm fixing that as well.

> - Arnaldo
>
> > diff --git a/tools/perf/bench/evlist-open-close.c b/tools/perf/bench/evlist-open-close.c
> > index 40bce06f5ca7bef3..f0b9c330f34f2984 100644
> > --- a/tools/perf/bench/evlist-open-close.c
> > +++ b/tools/perf/bench/evlist-open-close.c
> > @@ -168,7 +168,11 @@ static int bench_evlist_open_close__run(char *evstr)
> >
> > for (i = 0; i < iterations; i++) {
> > pr_debug("Started iteration %d\n", i);
> > +
> > evlist = bench__create_evlist(evstr);
> > + if (!evlist)
> > + return -ENOMEM;
> > +
> > gettimeofday(&start, NULL);
> > err = bench__do_evlist_open_close(evlist);