Skip to content

Conversation

afbjorklund
Copy link
Contributor

@afbjorklund afbjorklund commented Jun 25, 2018

By setting $CCACHE_TRACEFILE, one can obtain a trace of an individual compile.

Setting a unique file per compile, there is a script to combine them all into one trace...

This trace can then be loaded into the chrome://tracing page of Chromium/Chrome:

ccache-tracing-miss

ccache-tracing-hit

Currently there are 7 main event categories: config, main, hash, manifest, cache, file, execute

The regular path (for performance) would be:
- set compiler argument to an absolute path
- use an external tempdir, clean elsewhere
- disable logging, i.e. don't use a logfile
In order to trace "config", we need to start tracing before
logging - since that requires that we have completed config.

Currently config takes about 10% (!) of the total time of a
cache hit, or about 100 us. For a best case, total of 1 ms.
Try to wrap the actual function call
Note in the log file if trying to trace,
without tracing being enabled in ccache.

Since there is some (minor) overhead, by
default the minitrace code is not enabled.
@jrosdahl jrosdahl added the feature New or improved feature label Aug 8, 2018
@jrosdahl jrosdahl added this to the 3.5 milestone Aug 8, 2018
Copy link
Member

@jrosdahl jrosdahl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

@afbjorklund
Copy link
Contributor Author

Travis seems to have given up on this

@afbjorklund
Copy link
Contributor Author

@jrosdahl : suggestions look good, haven't had time to implement yet

@jrosdahl
Copy link
Member

jrosdahl commented Jan 3, 2019

@afbjorklund: I merged latest master into your branch for your convenience. However, I'm moving this feature out of 3.6 since it doesn't feel quite ready yet, mainly documentation. If you want to work on it near term, I'll happily move it back.

@jrosdahl jrosdahl modified the milestones: 3.6, 3.7 Jan 3, 2019
@afbjorklund
Copy link
Contributor Author

afbjorklund commented Jan 3, 2019

Will merge master and try again

Interestingly, it had already been merged to my fork (guess that is what you wrote above).

@afbjorklund
Copy link
Contributor Author

afbjorklund commented Jan 3, 2019

Hmm, seems like support for old clang is broken on master ?

error: macro name is a reserved identifier [-Werror,-Wreserved-id-macro]

Fixed in #343

@jrosdahl
Copy link
Member

jrosdahl commented Jan 3, 2019

Interestingly, it had already been merged to my fork (guess that is what you wrote above).

Yes, GitHub by default allows maintainers to push to the pull request branch. I intend to make use of that feature to make minor fixes directly on the pull request branch instead of making review change requests since they tend to stall very often.

@afbjorklund
Copy link
Contributor Author

Confusing with all the extra warnings, only for clang ? Especially when happending to third parties.

@jrosdahl
Copy link
Member

Confusing with all the extra warnings, only for clang ? Especially when happending to third parties.

I agree. How about only passing @more_warnings@ to $(non_3pp_sources)?

@jrosdahl
Copy link
Member

jrosdahl commented Feb 3, 2019

I agree. How about only passing @more_warnings@ to $(non_3pp_sources)?

Done in 39c531f.

@afbjorklund afbjorklund requested a review from jrosdahl April 21, 2019 13:59
@jrosdahl jrosdahl merged commit 00c6b35 into ccache:master Apr 21, 2019
@jrosdahl
Copy link
Member

Thanks!

@afbjorklund
Copy link
Contributor Author

Unfortunately the tracefiles were lost in all the refactoring, they remain in the tmp directory...

Will submit a patch to fix it.

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 this pull request may close these issues.

2 participants