lkml.org 
[lkml]   [2020]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v8 06/22] perf arm-spe: Refactor printing string to buffer
Em Wed, Nov 11, 2020 at 05:58:27PM +0000, Dave Martin escreveu:
>
> On Wed, Nov 11, 2020 at 05:39:22PM +0000, Arnaldo Carvalho de Melo wrote:
> > Em Wed, Nov 11, 2020 at 03:45:23PM +0000, Andr� Przywara escreveu:
> > > On 11/11/2020 15:35, Arnaldo Carvalho de Melo wrote:
> > > > Isn't this 'ret +=' ? Otherwise if any of these arm_spe_pkt_snprintf()
> > > > calls are made the previous 'ret' value is simply discarded. Can you
> > > > clarify this?

> > > ret is the same as err. If err is negative (from previous calls), we
> > > return that straight away, so it does nothing but propagating the error.

> > Usually the return of a snprintf is used to account for buffer space, ok
> > I'll have to read it, which I shouldn't as snprintf has a well defined
> > meaning...

> > Ok, now that I look at it, I realize it is not a snprintf() routine, but
> > something with different semantics, that will look at a pointer to an
> > integer and then do nothing if it comes with some error, etc, confusing
> > :-/

> Would you be happier if the function were renamed?

> Originally we were aiming for snprintf() semantics, but this still
> spawns a lot of boilerplate code and encourages mistakes in the local
> caller here -- hence the current sticky error approach.

> So maybe the name should now be less "snprintf"-like.

Please, its important to stick to semantics for such well known type of
routines, helps reviewing, etc.

I'll keep the series up to that point and will run my build tests, then
push it publicly to acme/perf/core and you can go from there, ok?

I've changed the BIT() to BIT_ULL() as Andre suggested and I'm testing
it again.

- Arnaldo

\
 
 \ /
  Last update: 2020-11-11 19:02    [W:0.084 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site