Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug output for cache misses only #1361

Open
rollysys opened this issue Nov 19, 2023 · 4 comments
Open

Debug output for cache misses only #1361

rollysys opened this issue Nov 19, 2023 · 4 comments
Labels
feature New or improved feature

Comments

@rollysys
Copy link

Actually we have use ccache as a must have component in our jenkins job.
Then I need to monitor all jenkins job's "ccache missing stat data" for enhancing the ccache policy.
So can we only get debug output files for missed object? Because the project is very large.
Thanks!

@rollysys rollysys added the feature New or improved feature label Nov 19, 2023
@jrosdahl jrosdahl changed the title Can we get DEBUG output only for missed object? Debug output for cache misses only Nov 27, 2023
@afbjorklund
Copy link
Contributor

Added a setting to be able to control which cache debug files are left on exit:

(default) debug = false
(default) debug_dir = 
(default) debug_hits = true
(default) debug_level = 2

@afbjorklund
Copy link
Contributor

afbjorklund commented Jan 4, 2024

One drawback with this method (running debug=true in production, for misses) is that you don't get anything to compare with. So you need to keep debug_dir from a build with debug_hits=true, in order to have anything to compare with...

One method of debugging would be to run one build with debug=true debug_dir=d1 debug_hits=true, then do a make clean, run another build with debug=true debug_dir=d2 debug_hits=false, and look for any files in the second dir.

@afbjorklund

This comment was marked as off-topic.

@jrosdahl
Copy link
Member

jrosdahl commented Jan 6, 2024

I'm not fully convinced that just saving debug files for misses is a reasonable use case since (as @afbjorklund says) you often need debug information from hits to compare the misses to.

But if we do want to support it, I'm not sure that adding yet another boolean configuration option would be the way to go – there might be other debug output tweaks that are wanted in the future, necessitating even more configuration options. In retrospect, I think that it was a mistake to accept #1312 in that form.

I'd rather suggest to redesign the configuration options, maybe like this (just a quick sketch):

  • debug = false: Disable debugging (the default).
  • debug = true: Enable full debugging.
  • debug = output:log,input-text: Enable debugging, but only write the .ccache-log and .ccache-input-text files.
  • debug = result:cache_miss,unsupported_*: Enable debugging, but only when one of the results is cache_miss or matches unsupported_*.

These can be combined, e.g. debug = output:log result:cache_miss. debug_level can be removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New or improved feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants