Re: [PATCH 28/30] perf evsel: Provide a new constructor fortracepoints

From: Arnaldo Carvalho de Melo
Date: Tue Sep 25 2012 - 07:28:18 EST


Em Tue, Sep 25, 2012 at 01:26:46PM +0900, Namhyung Kim escreveu:
> On Mon, 24 Sep 2012 12:59:42 -0300, Arnaldo Carvalho de Melo wrote:
> > + if (size == alloc_size) {
> > + alloc_size += BUFSIZ;
> > + nbf = realloc(bf, alloc_size);
> > + if (nbf == NULL)
> > + goto out_free_bf;
> > + bf = nbf;
> > + }
> > +
> > + n = read(fd, bf + size, BUFSIZ);
>
> Wouldn't it be better doing s/BUFSIZ/alloc_size - size/ ? Although
> there'll be no partial reading issue when working on debugfs I guess.

Yeah, don't know if that is worth it :-\

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