Exclude Files From the Graph

The power of FlowTracer is its ability to capture all inputs and outputs for each job. When determined as more efficient, such as ignoring details that are considered as unnecessary or of little importance, selected files can be excluded from the dependency graph.

Files are sometimes excluded from a dependency graph when a file exists on one machine but not another. For example, suppose you are running vovserver on a 32-bit machine (lnx32) but you are compiling a C-file on a 64-bit machine (lnx64). The compilation probably requires the file /lib64/libgcc_s.so.1 which exists on lnx64 but not on lnx32. If the compiler declares /lib64/libgcc_s.so.1 as input, the vovserver (running on lnx32) will not find such file and therefore declare the compilation as failed. Having such a file in the dependencies is not really useful and the exclusion mechanism described in this section is an easy way to avoid these dependencies.

The exclusion rules are defined in the exclude.tcl file. There are two types of rules relating to a file's name that will lead to a file being excluded from the graph:
  • Based on a regular expression.
  • Based on a prefix: these rules are a special case of regular expressions but they execute faster,
Both rules are defined with the Tcl procedure vtk_exclude_rule. For example, to exclude all files in /usr/tmp, a prefix rule can be defined. Example:
vtk_exclude_rule -prefix /usr/tmp
To exclude all files that end with the .tmp suffix, a rule can be based on a regular expression. Example:
vtk_exclude_rule -regexp {\.tmp$}
Note: The braces are necessary to protect the regular expression from the undesired evaluation of special characters such as $ and [].
While parsing the exclude.tcl file, the global variables $argv0 and $argv are set to the command line of the tool, including the wrapper. This makes it possible to create different exclusion rules depending, for example, on the tool name. Additionally, the variables EXCLUDE_TOOL, EXCLUDE_JOBNAME, and EXCLUDE_JOBCLASS are available.
if { $EXCLUDE_TOOL == "dc_shell" } {
  vtk_exclude_rule -regexp {/command.log}
}

The exclude file is used by the tools and it is ignored by the server. Any change to the exclude file is effective immediately for all the tools that are executed after the change. The change, however, has no retroactive effect. Files to be excluded that are already in the graph must be forgotten explicitly with other commands.

Procedure Arguments Description
vtk_exclude_rule [ -prefix |

-regexp |

-clear |

-tool TOOLNAME_RX |

-jobname JOBNAME_RX |

-jobclass JOBCLASS_RX ]

string

Define an exclusion rule. This procedure is used in the exclude.tcl file and can also be used in the encapsulation files. Examples:
  • Exclude all files that end begin with /usr/tmp
    vtk_exclude_rule -prefix /usr/tmp
    vtk_exclude_rule -tool dc_shell -regexp command.log
    vtk_exclude_rule -jobclass synth -regexp {.vvv$}
  • Exclude all files that end with a tilde.
    vtk_exclude_rule {~$} 
  • Reset the exclude rules.
    Note: This procedure is rarely used.
    vtk_exclude_rule -clear 
  • Exclude the command.log file, but only if the tool is dc_shell.
    vtk_exclude_rule -tool dc_shell -regexp command.log
  • Exclude files ending in .vvv if the job is running in the job class "synth".
    vtk_exclude_rule -jobclass synth -regexp {.vvv$}
vtk_path_exclude path Test whether a path is excluded by the rules that have been defined. This procedure is normally not used in the exclude.tcl file.

Examples of vtk_exclude_rule

For an example of exclude file, see the default file for the "generic" project type at $VOVDIR/local/ProjectTypes/generic/exclude.tcl.

Another example:
# The files that start with these prefixes will not be added to the graph.
vtk_exclude_rule -prefix {${VOVDIR}}
vtk_exclude_rule -prefix /dev/
vtk_exclude_rule -prefix /devices/
vtk_exclude_rule -prefix /etc/
vtk_exclude_rule -prefix /proc/
vtk_exclude_rule -prefix /lib/
vtk_exclude_rule -prefix /opt/CC
vtk_exclude_rule -prefix /tmp/
vtk_exclude_rule -prefix /tmp_mnt/usr/
vtk_exclude_rule -prefix /usr/
vtk_exclude_rule -prefix /var/
vtk_exclude_rule -prefix c:/
vtk_exclude_rule -regexp {Dependency.state$}
vtk_exclude_rule -regexp {/gcc-lib/}
vtk_exclude_rule -prefix /lib64;   ### Added for multi-arch compilations.

# -- Exclude the NT executables from the current installation.
vtk_exclude_rule -regexp {VOVDIR.*/[a-z]+\.exe$}

# -- Tool dependent exclusion rule.
# -- (the first arg is the wrapper, the second the tool)
# -- Could also use the variable EXCLUDE_TOOL
switch -- [lindex $argv 1] {
    "toolx" {
        vtk_exclude_rule -regexp /TOOLXCACHE/
    }
}

Debugging the Exclusion Mechanism

Use the environment variable VOV_STRICT_TRACING to disable the exclusion mechanism in your shell.

Use the environment variable VOV_DEBUG_FLAGS to force the exclusion routines to print out debugging messages:
  1. % setenv VOV_DEBUG_FLAGS 128
  2. Run the tools.

Additional Files with Exclusion Rules

The variable VOV_EXCLUDE_FILES can be used to list a number of additional files that contain exclusion rules. Examples:
% setenv VOV_EXCLUDE_FILES $VOVDIR/local/exclude/exclude.cdn.tcl
% setenv VOV_EXCLUDE_FILES $VOVDIR/local/exclude/exclude.cdn.tcl:$VOVDIR/local/exclude/exclude.snps.tcl