How to check which calls to ccache were uncacheable

898 Views Asked by At

I have a cmake/C++/Qt project which I've started to onboard onto ccache. For that, I installed ccache with homebrew, set the build system generator as ninja, and added -DCMAKE_CXX_COMPILER_LAUNCHER=ccache to the project.

and in the first test run I've got the following stats:

~$ ccache -s
Cacheable calls:    200 /  623 (32.10%)
  Hits:              56 /  200 (28.00%)
    Direct:          56 /   56 (100.0%)
    Preprocessed:     0 /   56 ( 0.00%)
  Misses:           144 /  200 (72.00%)
Uncacheable calls:  423 /  623 (67.90%)
Local storage:
  Cache size (GB): 0.01 / 5.00 ( 0.20%)

I wasn't counting such a high volume of uncacheable calls, and I wanted to take a look at which calls were uncacheable to see if there is something I can do about it.

Does anyone know if it's possible to troubleshoot calls to ccache to see which calls were deemed uncacheable?

1

There are 1 best solutions below

0
On

The first thing you can do is to add -v or --verbose when running ccache -s. Then you'll see what type those uncacheable calls are.

However, you won't see which exact calls were uncacheable. To do that, you'll have to either enable logging or enable the debug mode to get per-object log files. In the log file(s) you can see which commands were executed and why ccache considers some of them to be uncacheable.