From: Joel Rosdahl Date: Thu, 2 Sep 2010 20:16:45 +0000 (+0200) Subject: Log incremented statistics counters as "result" X-Git-Tag: v3.1~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfffc92d5d018bfa6e85a2227852607c0bac17f0;p=thirdparty%2Fccache.git Log incremented statistics counters as "result" --- diff --git a/stats.c b/stats.c index b0fc9b792..c22614199 100644 --- 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;