Re: [ccache] does ccache include source code modified time into hash?

2014-11-13 Thread Egmont Koblinger
On Thu, Nov 13, 2014 at 2:27 PM, Andrew Stubbs a...@codesourcery.com wrote:

  Probably there was a timestamp in a generated header somewhere.


Another similar issue might be if you embed the build ID (the git commit
ID) in some weird way, like e.g. midnight commander does, so that every
tiny git commit causes a total loss of the cache.

e.
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


Re: [ccache] does ccache include source code modified time into hash?

2014-11-12 Thread Joel Rosdahl
Hi Makson,

Since the manual wasn't clear enough, what kind of information do you think
would be good to add to the How ccache works section? Suggestions are
very welcome.

-- Joel

On 12 November 2014 02:26, Makson Lee cdlee...@gmail.com wrote:

 Hi Guys,

 Yes, it did help, thanks for the detailed explanation.

 2014-11-12 1:33 GMT+08:00 Andrew Stubbs a...@codesourcery.com:

  On 11/11/14 15:11, Makson Lee wrote:
 
  i am not sure that whether ccache will re-compile source code if we just
  change the modified time of it, can not find much about the details of
  how
  ccache works, in the manual, it just says that ccache will hash the
  source
  code, but what kinds of information of source code are hashed?
 
 
  Ccache has two modes: direct mode and preprocessor mode. It tries
  both, in that order.
 
  Preprocessor mode is the slower, older mode. This does not pay any
  attention to the file stats. It simply runs the compiler preprocessor and
  sees if the MD4 hash of the output matches something it has seen before.
 In
  theory, you can even edit the comments and macro text, to some degree,
 and
  still get a cache hit.
 
  Direct mode is much faster, but less tolerant of irrelevant changes. In
  this mode, ccache keeps a cache (manifest) of every source file used
 by a
  compile, including times, size, and an MD4 hash. It then tries to match
  each file and determine if the source matches without calling the
 compiler
  at all. Ordinarily, it uses only the MD4 hash to determine this, so
  changing the mtime will have no effect.
 
  However, if you set CACHE_SLOPPINESS=file_stat_matches then direct mode
  will ignore the contents of the source files, and determine similarity
  using only the ctime, mtime, and size attributes. In this case, changing
  the mtime will cause a direct mode cache miss. Ccache will then fall-back
  to preprocessor mode, and you should still get a cache hit that way,
 albeit
  slower. The cached manifest will be updated, and the next time you build
  you will get a direct mode cache hit again, unless the mtime changes
 again.
 
  Hope that helps
 
  Andrew
 
 ___
 ccache mailing list
 ccache@lists.samba.org
 https://lists.samba.org/mailman/listinfo/ccache

___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


Re: [ccache] does ccache include source code modified time into hash?

2014-11-12 Thread Andrew Stubbs

On 12/11/14 20:22, Joel Rosdahl wrote:

Since the manual wasn't clear enough, what kind of information do you
think would be good to add to the How ccache works section?
Suggestions are very welcome.


FWIW, I think that any detailed description is too much for the user manual.

However, it might appropriate to list the factors that can lead to a 
cache miss, and mention some of the factors that explicitly do not cause 
a miss.


Andrew
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


Re: [ccache] does ccache include source code modified time into hash?

2014-11-12 Thread Makson Lee
2014-11-13 4:44 GMT+08:00 Andrew Stubbs a...@codesourcery.com:

 However, it might appropriate to list the factors that can lead to a cache
 miss, and mention some of the factors that explicitly do not cause a miss.


Yes, i think the factors that can lead to a cache miss would be enough,
currently, we are using some kind of version control tool, each time we
reload the same code and recompile it, we get lots of cache miss, so we
need that information to find out why cache miss happens, in direct mode,
maybe a tool can show us all the factors for a source file before compile
would be help too.
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache