Re: [PATCH v2 next 03/11] tools/nolibc/printf: Add buffering to vfprintf() callback.

From: Thomas Weißschuh

Date: Mon Feb 16 2026 - 14:07:55 EST


On 2026-02-07 23:36:51+0000, David Laight wrote:
> On Sat, 7 Feb 2026 20:29:34 +0100
> Willy Tarreau <w@xxxxxx> wrote:
>
> > On Fri, Feb 06, 2026 at 07:11:13PM +0000, david.laight.linux@xxxxxxxxx wrote:
> > > From: David Laight <david.laight.linux@xxxxxxxxx>
> > >
> > > Add per-call buffering to the vprintf() callback.
> > > While this adds some extra code it will speed things up and
> > > makes a massive difference to anyone looking at strace output.
> >
> > This patch alone adds more than 200 extra bytes to the smallest binary
> > for something that was never expressed as a need by users:
> >
> > $ size hello-patch*
> > text data bss dec hex filename
> > 1859 48 24 1931 78b hello-patch1
> > 2071 48 24 2143 85f hello-patch2
> >
> > I doubt it would make sense to have a build option to choose this.
> > Or alternately one could decide do disable it when __OPTIMIZE_SIZE__
> > is defined. I just tried quickly and it does the job:
>
> That probably makes sense.
> For anything non-trivial the extra size is noise.
> Actually is would be easier to read with a single #if covering the
> whole lot.

While I like the slimmer strace output, the added complexity, including
a different implementation for __OPTIMIZE_SIZE__ is a bit scary.
Could we leave this out for now and work on it on its own?


Thomas