[Mesa-dev] [PATCH v3 2/3] egl: introduce a log level getter function

Emil Velikov emil.l.velikov at gmail.com
Mon Jan 14 19:55:07 UTC 2019


On Mon, 14 Jan 2019 at 18:20, Emil Velikov <emil.l.velikov at gmail.com> wrote:
>
> On 2019/01/11, Silvestrs Timofejevs wrote:
> > Being able to retrieve the log level can be useful to enable/disable
> > debug code. The alternative, which is calling 'getenv' function every
> > time to retrieve the log level, is more "expensive".
> >
> > Signed-off-by: Silvestrs Timofejevs <silvestrs.timofejevs at imgtec.com>
> > Reviewed-by: Eric Engestrom <eric.engestrom at intel.com>
> > ---
> >  src/egl/main/egllog.c | 9 +++++++++
> >  src/egl/main/egllog.h | 4 ++++
> >  2 files changed, 13 insertions(+)
> >
> > diff --git a/src/egl/main/egllog.c b/src/egl/main/egllog.c
> > index c223f49..42bae01 100644
> > --- a/src/egl/main/egllog.c
> > +++ b/src/egl/main/egllog.c
> > @@ -133,6 +133,15 @@ _eglInitLogger(void)
> >     }
> >  }
> >
> > +/**
> > + * Return the log level.
> > + */
> > +EGLint
> > +_eglGetLogLevel(void)
> > +{
> > +   return logging.level;
> > +}
> > +
> Any particular reason why are not using _eglLog()? It does not log level
> and VA handling for us.
>
Right, _eglLog is being used... silly me. I've got confused by the
mention of getenv and expensive.
Currently the getenv() call is a once-off thing.

I'd imagine when this work originates, when that wasn't the case.
Hence we no longer need this micro optimisation?

-Emil


More information about the mesa-dev mailing list