Managing PureCoverage cache files

PureCoverage inserts usage-tracking instructions into the object code of your application. After the compiler creates the object files for your application, PureCoverage instruments the object files, using Object Code Insertion (OCI) to add the monitoring instructions. The instrumented object files, or cache files, are given new names so that your original object files are not modified.

PureCoverage passes the cache files, complete with the instrumented versions of any libraries required for the application, to the linker, in place of the original object files.

The cache file names always include pure and an encoded PureCoverage version number. The names can also include information about the size of the original file, or the name and number of the operating system.

PureCoverage stores the cache files in the same directories as their original counterparts, unless those directories do not have write permission. In this case, PureCoverage creates shadow directories in the global cache, <purecovhome>/cache, where it stores the cache files.

To force PureCoverage to store all cache files in the global cache, use the -always-use-cache-dir option.

To prevent PureCoverage from storing cache files in specific directories, use the -forbidden-directories option.

You can clean up and remove old cached files with the script <purecovhome>/pure_remove_old_files. It is safe to remove these files because PureCoverage rebuilds them as needed. By removing them, you gain disk space, but lose some time during linking.

To remove all cache files that have been in the system 14 days or longer, use:

% pure_remove_old_files / 14

To remove all of the cache files in the current directory and subdirectories, useful in clean targets of makefiles, use:

% pure_remove_old_files . 0

To remove the cache files periodically, add a cron job. For example, to remove cache files that have not been accessed in two weeks, add an entry to your crontab file:

15 2 * * * <purecovhome>/pure_remove_old_files / 14

This runs pure_remove_old_files every day at 2:15 a.m. and, starting at the root directory, removes all cache files that have not been read in the last 14 days.