[ccache] Support for -fprofile-generate, -fprofile-use, -fprofile-arcs

Justin Lebar justin.lebar at gmail.com
Mon Aug 8 08:06:26 MDT 2011


On Mon, Aug 8, 2011 at 9:58 AM, Chris AtLee <chris at atlee.ca> wrote:
> Any thoughts on if caching the .gcda files is useful? Maybe have
> another environment variable that switches it on?

What do you mean?  These files aren't generated until the program is
run, right?  So I guess what you're suggesting is that on the
-fprofile-use pass, we'd remember the gcda file that was there.  Then
on a later -fprofile-generate pass, if we have a cache hit, we'd
restore both the object and the gcda file that object eventually
created when it ran.

I'm not sure would be useful, particularly because gcda files are (in
theory -- I haven't tested) cumulative.  So if ccache restores the
gcda file and I then run the -fprofile-generate build, I'm going to
accumulate data into the file ccache restored.  Now some of my gcda
files have data from one run and some have data from two runs,
depending on whether ccache had a cache hit.

-Justin

> Other than that, are there any other concerns with the new code?
>
> Cheers,
> Chris
>
> On Tue, Aug 2, 2011 at 12:05 PM, Chris AtLee <chris at atlee.ca> wrote:
>> If you use the same .gcda files with -fprofile-use, then you do get
>> cache hits. However, running even a simple program with no loops or
>> branches twice in a row generates different .gcda files, which then
>> results in cache misses. So I'm not sure how useful the -fprofile-use
>> side of things is in general.
>>
>> On Tue, Aug 2, 2011 at 11:17 AM, Justin Lebar <justin.lebar at gmail.com> wrote:
>>> Catlee,
>>>
>>> Have you done any experiments to determine whether this actually gets
>>> cache hits with -fprofile-use?  That is, do you ever get identical
>>> .gcda files?  They could have a timestamp or something inside...
>>>
>>> -Justin
>>>
>>> On Mon, Aug 1, 2011 at 9:52 PM, Chris AtLee <chris at atlee.ca> wrote:
>>>> Thanks again for all your feedback.
>>>>
>>>> My latest code on github should address all the comments so far:
>>>> https://github.com/catlee/ccache/compare/jrosdahl:master...catlee:profile
>>>>
>>>> Keep the feedback coming!
>>>>
>>>> Cheers,
>>>> Chris
>>>>
>>>
>>
>


More information about the ccache mailing list