[igt-dev] [PATCH i-g-t 05/13] lib: Add GPU power measurement

Chris Wilson chris at chris-wilson.co.uk
Tue Feb 5 15:09:47 UTC 2019


Quoting Ville Syrjälä (2019-02-05 14:41:10)
> On Mon, Feb 04, 2019 at 10:25:19AM +0000, Chris Wilson wrote:
> > Quoting Katarzyna Dec (2019-02-04 10:05:36)
> > > On Mon, Feb 04, 2019 at 08:36:06AM +0000, Chris Wilson wrote:
> > > > +     oldlocale = setlocale(LC_ALL, "C");
> > > > +     v = strtod(buf, NULL);
> > > > +     setlocale(LC_ALL, oldlocale);
> > > Why we are first setting "C" locale and then restoring it? Is there a moment
> > > during mesurement when it is changed?
> > 
> > No, but it may be set in the environment for pretty-printing of output.
> > Thread-safety not guaranteed.
> 
> uselocale() ?

Seems viable. TIL.
-Chris


More information about the igt-dev mailing list