[PATCH] Relax invalidation of TOP N counters in PGO.

Jan Hubicka hubicka@ucw.cz
Tue Jan 7 10:09:00 GMT 2020


> On 1/6/20 8:03 PM, Jan Hubicka wrote:
> > > > > OK
> > > > Actually I am not so sure about this patch - how do we ensure
> > > > reproducibility in this case?
> > > ISTM that anyone trying to have reproducible builds shouldn't be using
> > > PGO based optimizations.
> > 
> > OpenSUSE does that. Builds are supposed to be reproducible + PGO is used
> > for number of core packages (like GCC itself).  This was motivation of
> > original Martin's change to drop TOPN values from profile more
> > agressively.
> 
> I agree with Honza that we should provide as reproducible builds as possible.
> On the other hand, we should not be rigid and allow a reasonable sample loss.
> That's why I added a parameter that be tweaked at openSUSE side.
> 
> Note that original motivation for the patch was your PR :) So that I'm surprised
> I don't like the patch much.

I know. However I wonder if this can be done in reproducible way.
Problem is that small values from profile run polutes the on-disk
counter and eventually renders it invalid.  If libgcov before meerging
or streaming dropped alues smaller than TOTAL_COUNT/N from the histogram
it may be enough to fit in the number of entires? (at least in the
testcase they seem very dominated by one value).

We could also have more values on disk than used by gcov counter.
But I see it is hard to get with current way libgcov is done.

Honza



More information about the Gcc-patches mailing list