Re: [PATCH v6 5/9] vsprintf: Factor out %pV handler as va_format()

From: Steven Rostedt
Date: Tue Feb 12 2019 - 09:32:17 EST


On Tue, 12 Feb 2019 14:00:30 +0100
Petr Mladek <pmladek@xxxxxxxx> wrote:

> On Fri 2019-02-08 09:11:17, Joe Perches wrote:
> > On Fri, 2019-02-08 at 16:23 +0100, Petr Mladek wrote:
> > > Move the code from the long pointer() function. We are going to improve
> > > error handling that will make it more complicated.
> > >
> > > This patch does not change the existing behavior.
> >
> > But doesn't this increase stack use?
> > %pV is recursive and increasing the stack is undesired
> > for this use.
>
> %pV handler is stack sensitive because the entire vsnprintf()
> machinery is called recursively. This one extra call does
> not make it much worse.
>

Not to mention that if it is the only static call, gcc will most likely
just keep it inlined. Could add an inline annotation just to be
paranoid.

-- Steve