From: Joel Rosdahl Date: Sun, 2 Oct 2022 17:02:09 +0000 (+0200) Subject: fix: Don't increment preprocessed_cache_miss in recache mode X-Git-Tag: v4.7~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fbe45b77f24c17723d3930014e8b3d6d6eeb238d;p=thirdparty%2Fccache.git fix: Don't increment preprocessed_cache_miss in recache mode --- diff --git a/src/ccache.cpp b/src/ccache.cpp index 3df194193..2ae809327 100644 --- a/src/ccache.cpp +++ b/src/ccache.cpp @@ -2457,7 +2457,9 @@ do_cache_compilation(Context& ctx, const char* const* argv) return Statistic::preprocessed_cache_hit; } - ctx.storage.local.increment_statistic(Statistic::preprocessed_cache_miss); + if (!ctx.config.recache()) { + ctx.storage.local.increment_statistic(Statistic::preprocessed_cache_miss); + } } if (ctx.config.read_only()) { diff --git a/test/suites/base.bash b/test/suites/base.bash index 39dcdf041..937530732 100644 --- a/test/suites/base.bash +++ b/test/suites/base.bash @@ -449,11 +449,13 @@ fi $CCACHE_COMPILE -c test1.c expect_stat preprocessed_cache_hit 0 + expect_stat preprocessed_cache_miss 1 expect_stat cache_miss 1 expect_stat recache 0 CCACHE_RECACHE=1 $CCACHE_COMPILE -c test1.c expect_stat preprocessed_cache_hit 0 + expect_stat preprocessed_cache_miss 1 expect_stat cache_miss 1 expect_stat recache 1