Commit 1d3f9427 authored by Christian Dietrich's avatar Christian Dietrich
Browse files

log the ccache output

parent 31154fce
Pipeline #3105 failed with stage
in 0 seconds
...@@ -107,11 +107,11 @@ class ClangHashHelper: ...@@ -107,11 +107,11 @@ class ClangHashHelper:
ccache_hits += int(line[line.index(")")+1:].strip()) ccache_hits += int(line[line.index(")")+1:].strip())
if "cache miss" in line: if "cache miss" in line:
ccache_misses += int(line[line.index("miss")+4:].strip()) ccache_misses += int(line[line.index("miss")+4:].strip())
return ccache_hits, ccache_misses return ccache_hits, ccache_misses, "\n".join(lines)
def rebuild(self, path, info, fail_ok=False): def rebuild(self, path, info, fail_ok=False):
if "ccache" in self.mode.value: if "ccache" in self.mode.value:
old_ccache_hits, old_ccache_misses = self.ccache_hits() shell("ccache --zero-stats")
if "clang-hash" in self.mode.value: if "clang-hash" in self.mode.value:
hash_log = tempfile.NamedTemporaryFile() hash_log = tempfile.NamedTemporaryFile()
...@@ -135,9 +135,10 @@ class ClangHashHelper: ...@@ -135,9 +135,10 @@ class ClangHashHelper:
# Record Cache misses and hits # Record Cache misses and hits
if "ccache" in self.mode.value: if "ccache" in self.mode.value:
ccache_hits, ccache_misses = self.ccache_hits() ccache_hits, ccache_misses, log = self.ccache_hits()
info['ccache-hits'] = ccache_hits - old_ccache_hits info['ccache-log'] = log
info['ccache-misses'] = ccache_misses - old_ccache_misses info['ccache-hits'] = ccache_hits
info['ccache-misses'] = ccache_misses
if "clang-hash" in self.mode.value: if "clang-hash" in self.mode.value:
log = hash_log.read() log = hash_log.read()
...@@ -146,6 +147,7 @@ class ClangHashHelper: ...@@ -146,6 +147,7 @@ class ClangHashHelper:
info['clang-hash-misses'] = log.count("M") info['clang-hash-misses'] = log.count("M")
hash_log.close() hash_log.close()
logging.info("Rebuild done[%s]: %s s; failed=%s", logging.info("Rebuild done[%s]: %s s; failed=%s",
info.get("filename") or info.get("commit"), info.get("filename") or info.get("commit"),
build_time / 1e9, build_time / 1e9,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment