]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Log incremented statistics counters as "result"
authorJoel Rosdahl <joel@rosdahl.net>
Thu, 2 Sep 2010 20:16:45 +0000 (22:16 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 2 Sep 2010 20:16:45 +0000 (22:16 +0200)
stats.c

diff --git a/stats.c b/stats.c
index b0fc9b792c0032f71dc62f144ddebfec2829ba52..c2261419925568a7a3b9bd47ee2528ca82426295 100644 (file)
--- a/stats.c
+++ b/stats.c
@@ -196,6 +196,7 @@ stats_flush(void)
        bool need_cleanup = false;
        bool should_flush = false;
        int i;
+       extern char *cache_logfile;
 
        if (getenv("CCACHE_NOSTATS")) return;
 
@@ -234,6 +235,15 @@ stats_flush(void)
        stats_write(stats_file, counters);
        lockfile_release(stats_file);
 
+       if (cache_logfile) {
+               for (i = 0; i < STATS_END; ++i) {
+                       if (counter_updates->data[stats_info[i].stat] != 0
+                           && !(stats_info[i].flags & FLAG_NOZERO)) {
+                               cc_log("Result: %s", stats_info[i].message);
+                       }
+               }
+       }
+
        if (counters->data[STATS_MAXFILES] != 0 &&
            counters->data[STATS_NUMFILES] > counters->data[STATS_MAXFILES]) {
                need_cleanup = true;