From: Joel Rosdahl Date: Sun, 21 Feb 2010 19:58:58 +0000 (+0100) Subject: Add comments about the stats files X-Git-Tag: v3.0pre0~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=741bb5587fe02f2ea046b4bc684dc03b570ab56c;p=thirdparty%2Fccache.git Add comments about the stats files --- diff --git a/ccache.c b/ccache.c index a925e23da..e79fa67ce 100644 --- a/ccache.c +++ b/ccache.c @@ -125,7 +125,10 @@ static int direct_i_file; /* the name of the cpp stderr file */ static char *cpp_stderr; -/* the name of the statistics file */ +/* + * Full path to the statistics file in the subdirectory where the cached result + * belongs (CCACHE_DIR/X/stats). + */ char *stats_file = NULL; /* can we safely use the unification hashing backend? */ diff --git a/stats.c b/stats.c index 6cb424d4d..911448412 100644 --- a/stats.c +++ b/stats.c @@ -136,6 +136,11 @@ static void stats_update_size(enum stats stat, size_t size) if (getenv("CCACHE_NOSTATS")) return; if (!stats_file) { + /* + * A NULL stats file means that we didn't get past find_hash(), + * so we update the counter in the cache-wide statistics file + * CCACHE_DIR/stats instead of a subdirectory stats file. + */ if (!cache_dir) return; x_asprintf(&stats_file, "%s/stats", cache_dir); }