From: JinWang An Date: Tue, 3 Aug 2021 07:18:15 +0000 (+0900) Subject: Imported Upstream version 3.3.5 X-Git-Tag: upstream/3.3.5^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e70429725122fbca9e7113996e852da2369d7181;p=platform%2Fupstream%2Fccache.git Imported Upstream version 3.3.5 --- diff --git a/AUTHORS.html b/AUTHORS.html index 5079e1f..8894164 100644 --- a/AUTHORS.html +++ b/AUTHORS.html @@ -734,7 +734,7 @@ asciidoc.install(2);

diff --git a/LICENSE.txt b/LICENSE.txt index 5bf7883..316fb81 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -38,7 +38,7 @@ The copyright for ccache as a whole is as follows: ------------------------------------------------------------------------------- Copyright (C) 2002-2007 Andrew Tridgell - Copyright (C) 2009-2017 Joel Rosdahl + Copyright (C) 2009-2018 Joel Rosdahl ------------------------------------------------------------------------------- diff --git a/MANUAL.html b/MANUAL.html index 1f2e5d9..3bf053d 100644 --- a/MANUAL.html +++ b/MANUAL.html @@ -734,7 +734,7 @@ asciidoc.install(2);

This option specifies the maximum number of files to keep in the cache. Use - 0 for no limit (which is the default). + 0 for no limit (which is the default). See also + CACHE SIZE MANAGEMENT.

@@ -1366,7 +1368,8 @@ might be incorrect.

This option specifies the maximum size of the cache. Use 0 for no limit. The default value is 5G. Available suffixes: k, M, G, T (decimal) and Ki, - Mi, Gi, Ti (binary). The default suffix is "G". + Mi, Gi, Ti (binary). The default suffix is "G". See also + CACHE SIZE MANAGEMENT.

@@ -1476,7 +1479,7 @@ when compiling preprocessed source code.

ccache normally examines a file’s contents to determine whether it matches the cached version. With this option set, ccache will consider a file as - matching its cached version if the sizes, mtimes and ctimes match. + matching its cached version if the mtimes and ctimes match.

@@ -1512,7 +1515,7 @@ when compiling preprocessed source code.

- Be sloppy about #defines when precompiling a header file. See + Be sloppy about #defines when precompiling a header file. See PRECOMPILED HEADERS for more information.

@@ -1592,11 +1595,56 @@ information.

Cache size management

-

By default, ccache has a five gigabyte limit on the total size of files in the -cache and no maximum number of files. You can set different limits using the +

By default, ccache has a 5 GB limit on the total size of files in the cache and +no limit on the number of files. You can set different limits using the -M/--max-size and -F/--max-files options. Use ccache -s/--show-stats to see the cache size and the currently configured limits (in addition to other various statistics).

+

Cleanup can be triggered in two different ways: automatic and manual.

+
+

Automatic cleanup

+

ccache maintains counters for various statistics about the cache, including the +size and number of all cached files. In order to improve performance and reduce +issues with concurrent ccache invocations, there is one statistics file for +each of the sixteen subdirectories in the cache.

+

After a new compilation result has been written to the cache, ccache will +update the size and file number statistics for the subdirectory (one of +sixteen) to which the result was written. Then, if the size counter for said +subdirectory is greater than max_size / 16 or the file number counter is +greater than max_files / 16, automatic cleanup is triggered.

+

When automatic cleanup is triggered for a subdirectory in the cache, ccache +will:

+
    +
  1. +

    +Count all files in the subdirectory and compute their aggregated size. +

    +
  2. +
  3. +

    +Remove files in LRU (least recently used) order until the size is at most + limit_multiple * max_size / 16 and the number of files is at most + limit_multiple * max_files / 16, where limit_multiple, max_size and + max_files are configuration settings. +

    +
  4. +
  5. +

    +Set the size and file number counters to match the files that were kept. +

    +
  6. +
+

The reason for removing more files than just those needed to not exceed the max +limits is that a cleanup is a fairly slow operation, so it would not be a good +idea to trigger it often, like after each cache miss.

+
+
+

Manual cleanup

+

You can run ccache -c/--cleanup to force cleanup of the whole cache, i.e. all +of the sixteen subdirectories. This will recalculate the statistics counters +and make sure that the max_size and max_files settings are not exceeded. +Note that limit_multiple is not taken into account for manual cleanup.

+
@@ -2008,7 +2056,7 @@ things to make it work properly:

You must set sloppiness to pch_defines,time_macros. The reason is that ccache can’t tell whether __TIME__ or __DATE__ is used when using a - precompiled header. Further, it can’t detect changes in #defines in the + precompiled header. Further, it can’t detect changes in #defines in the source code because of how preprocessing works in combination with precompiled headers.

@@ -2371,9 +2419,9 @@ maintained by Joel Rosdahl. See AUTHORS.txt or AUTHORS.html and

diff --git a/MANUAL.txt b/MANUAL.txt index c960979..1d4127d 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -407,7 +407,8 @@ might be incorrect. *limit_multiple* (*CCACHE_LIMIT_MULTIPLE*):: Sets the limit when cleaning up. Files are deleted (in LRU order) until the - levels are below the limit. The default is 0.8 (= 80%). + levels are below the limit. The default is 0.8 (= 80%). See + <<_automatic_cleanup,AUTOMATIC CLEANUP>> for more information. *log_file* (*CCACHE_LOGFILE*):: @@ -417,13 +418,15 @@ might be incorrect. *max_files* (*CCACHE_MAXFILES*):: This option specifies the maximum number of files to keep in the cache. Use - 0 for no limit (which is the default). + 0 for no limit (which is the default). See also + <<_cache_size_management,CACHE SIZE MANAGEMENT>>. *max_size* (*CCACHE_MAXSIZE*):: This option specifies the maximum size of the cache. Use 0 for no limit. The default value is 5G. Available suffixes: k, M, G, T (decimal) and Ki, - Mi, Gi, Ti (binary). The default suffix is "G". + Mi, Gi, Ti (binary). The default suffix is "G". See also + <<_cache_size_management,CACHE SIZE MANAGEMENT>>. *path* (*CCACHE_PATH*):: @@ -491,7 +494,7 @@ when compiling preprocessed source code. *file_stat_matches*:: ccache normally examines a file's contents to determine whether it matches the cached version. With this option set, ccache will consider a file as - matching its cached version if the sizes, mtimes and ctimes match. + matching its cached version if the mtimes and ctimes match. *include_file_ctime*:: By default, ccache also will not cache a file if it includes a header whose ctime is too new. This option disables that check. @@ -503,7 +506,7 @@ when compiling preprocessed source code. With this option set, ccache will only include system headers in the hash but not add the system header files to the list of include files. *pch_defines*:: - Be sloppy about #defines when precompiling a header file. See + Be sloppy about **#define**s when precompiling a header file. See <<_precompiled_headers,PRECOMPILED HEADERS>> for more information. *time_macros*:: Ignore *\_\_DATE\__* and *\_\_TIME__* being present in the source code. @@ -550,12 +553,52 @@ NOTE: In previous versions of ccache, *CCACHE_TEMPDIR* had to be on the same Cache size management --------------------- -By default, ccache has a five gigabyte limit on the total size of files in the -cache and no maximum number of files. You can set different limits using the +By default, ccache has a 5 GB limit on the total size of files in the cache and +no limit on the number of files. You can set different limits using the *-M*/*--max-size* and *-F*/*--max-files* options. Use *ccache -s/--show-stats* to see the cache size and the currently configured limits (in addition to other various statistics). +Cleanup can be triggered in two different ways: automatic and manual. + + +Automatic cleanup +~~~~~~~~~~~~~~~~~ + +ccache maintains counters for various statistics about the cache, including the +size and number of all cached files. In order to improve performance and reduce +issues with concurrent ccache invocations, there is one statistics file for +each of the sixteen subdirectories in the cache. + +After a new compilation result has been written to the cache, ccache will +update the size and file number statistics for the subdirectory (one of +sixteen) to which the result was written. Then, if the size counter for said +subdirectory is greater than *max_size / 16* or the file number counter is +greater than *max_files / 16*, automatic cleanup is triggered. + +When automatic cleanup is triggered for a subdirectory in the cache, ccache +will: + +1. Count all files in the subdirectory and compute their aggregated size. +2. Remove files in LRU (least recently used) order until the size is at most + *limit_multiple * max_size / 16* and the number of files is at most + *limit_multiple * max_files / 16*, where *limit_multiple*, *max_size* and + *max_files* are configuration settings. +3. Set the size and file number counters to match the files that were kept. + +The reason for removing more files than just those needed to not exceed the max +limits is that a cleanup is a fairly slow operation, so it would not be a good +idea to trigger it often, like after each cache miss. + + +Manual cleanup +~~~~~~~~~~~~~~ + +You can run *ccache -c/--cleanup* to force cleanup of the whole cache, i.e. all +of the sixteen subdirectories. This will recalculate the statistics counters +and make sure that the *max_size* and *max_files* settings are not exceeded. +Note that *limit_multiple* is not taken into account for manual cleanup. + Cache compression ----------------- @@ -822,7 +865,7 @@ things to make it work properly: * You must set *sloppiness* to *pch_defines,time_macros*. The reason is that ccache can't tell whether *\_\_TIME\__* or *\_\_DATE__* is used when using a - precompiled header. Further, it can't detect changes in #defines in the + precompiled header. Further, it can't detect changes in **#define**s in the source code because of how preprocessing works in combination with precompiled headers. * You must either: diff --git a/NEWS.html b/NEWS.html index 6e8af4f..24de53d 100644 --- a/NEWS.html +++ b/NEWS.html @@ -734,7 +734,7 @@ asciidoc.install(2);