http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54487

--- Comment #21 from davidxl at google dot com 2012-09-11 18:08:26 UTC ---
Assuming the size of histogram for the same file does not vary that
much, is it better to round the size to the next power of 2 -- 60
entries will need print out 64 etc?

David

On Tue, Sep 11, 2012 at 11:04 AM, Teresa Johnson <tejohn...@google.com> wrote:
> On Tue, Sep 11, 2012 at 10:44 AM, Xinliang David Li <davi...@google.com> 
> wrote:
>> How much saving do we get by not writing out the 0 entries? With the
>> proposed change, how less frequent is the problem occuring?
>
> Let me get back with some stats. Each histogram entry requires 5
> words, and there are a max of 252 entries. In the few cases I checked
> just now, we were printing about 60 entries per summary, with 3
> summaries per gcda file. So printing the whole thing in these cases
> would require 5*(252-60)*3 = 2880 extra words, or 11520 bytes.
> Unfortunately, that is a significant increase over the current sizes
> of those files, which are currently only double or triple that.
>
> I also need to verify that changing this would reduce the frequency.
>
> A couple other possibilities since this is not frequent:
> - change the existing error to a warning (as we do under
> flag_profile_correction)
> - after finishing reading the counts, re-read the tag as I am doing in
> my debugging, and if it is no longer valid, throw everything away and
> re-read the file.
> - check the counters after reading each one, and if it is > sum_max,
> ignore it and abort the profile read with a warning but continue
> compiling.
>
> Obviously the best solution would be to figure out how the lock is
> being lost/ignored and fix that, but that may take some time.
>
> Teresa
>
>>
>> David
>>
>> On Tue, Sep 11, 2012 at 10:38 AM, Teresa Johnson <tejohn...@google.com> 
>> wrote:
>>> On Tue, Sep 11, 2012 at 10:29 AM, hjl.tools at gmail dot com
>>> <gcc-bugzi...@gcc.gnu.org> wrote:
>>>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54487
>>>>
>>>> --- Comment #17 from H.J. Lu <hjl.tools at gmail dot com> 2012-09-11 
>>>> 17:29:15 UTC ---
>>>> Thanks for looking into it.  This is a long standing problem.
>>>> I have seen random profiledbootstrap failures for a long time.
>>>
>>> Thanks for confirming that this has happened prior. Unfortunately the
>>> addition of the histogram is likely making this more frequent, due to
>>> the changing summary sizes after merging. One way to deal with this
>>> for now might be to write all histogram entries (even the 0 ones) into
>>> the summary to keep the size static.
>>>
>>> Honza, what do you think?
>>>
>>> Teresa
>>>
>>>>
>>>> --
>>>> Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email
>>>> ------- You are receiving this mail because: -------
>>>> You are on the CC list for the bug.
>>>
>>>
>>>
>>> --
>>> Teresa Johnson | Software Engineer | tejohn...@google.com | 408-460-2413
>
>
>
> --
> Teresa Johnson | Software Engineer | tejohn...@google.com | 408-460-2413

Reply via email to