Managing cached object files

To improve build-time performance, Quantify caches its instrumented versions of all the libraries and object files that are used by the program. When you rebuild a program, Quantify updates only the new or modified files; otherwise it uses the cached versions. (For system libraries such as libc, Quantify may not use the cached version if you reinstrument your program on a different machine.)

You can identify an instrumented cache file by its name. It includes _pure_ and a Quantify version number. It can also include information about the size of the original file, or the name and version number of the operating system.

By default, Quantify writes instrumented files to the directory of the original file. If this directory does not have write permission, or if it is part of a directory tree specified with the -forbidden-directories option, Quantify creates a shadow directory in the  global cache directory, <quantifyhome>/cache, where it stores the cache files.

You can control how instrumented libraries and files are cached by:

·        Specifying the global cache directory with the -cache-dir option

·        Directing Quantify to save all cache files in the global cache directory with the -always-use-cache-dir option

·        Restricting Quantify from caching files in certain directories with the -forbidden-directories option.

Deleting cached object files

Since Quantify rebuilds cached files as needed, you can remove them at any time in order to conserve disk space.

Using the pure_remove_old_files script

The pure_remove_old_files script also removes Purify and PureCoverage cache files.

To remove cache files, use the pure_remove_old_files script located in the <quantifyhome> directory. For example, to remove all cache files that are 14 days or older:

% pure_remove_old_files / 14

The first argument (/) specifies the path, the second argument (14) specifies the number of days. This command removes files 14 days or older recursively from the root directory /.

Using a cron job

To automate the removal of cache files, create a cron job that periodically removes the files. For example, to remove files that have not been accessed in two weeks, type:

% crontab -e

Add this entry to the crontab file:

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

This runs pure_remove_old_files each day at 2:15 A.M., and removes all cached files starting at the root directory / that have not been read within the last 14 days.

To remove all of the cache files in the current directory and subdirectories, use:

% pure_remove_old_files . 0

This is useful in clean targets of makefiles.