Go to the first, previous, next, last section, table of contents.


3. Debugging

Kpathsea provides a number of runtime debugging options, detailed below by their names (and corresponding numeric values). You can set these with some runtime argument (e.g., `-d') to the program; in that case, you should use the numeric values described in the program's documentation (which, except for Dviljk, are different from those below).

You can also set the environment variable KPATHSEA_DEBUG. In this case, you should use the numbers below. Also use the numbers below if you run the program under a debugger and set the the variable `kpathsea_debug' yourself.

In any case, you can not use the names below; you must always use somebody's numbers. (Sorry.) And to set more than option, just sum the corresponding numbers.

KPSE_DEBUG_STAT
(1). Reports `stat'(2) calls. This is useful for verifying that your directory structure is not forcing Kpathsea to do many additional file tests (see section 2.2.2 Slow path searching and see section 4.6 Subdirectory expansion). If you are using an up-to-date `ls-R' database (see section 4.7 Filename database (ls-R)), this should produce no output unless a nonexistent file is searched for.
KPSE_DEBUG_HASH
(2). Reports lookups in all hash tables, including `ls-R' (see section 4.7 Filename database (ls-R)), font aliases (see section 5.2.2 Fontmap), and config file values (see section 4.2.1 Config files). Useful when expected values are not being found, e.g.., file searches are looking at the disk instead of using `ls-R'.
KPSE_DEBUG_FOPEN
(4). Reports file openings and closings. Especially useful when your system's file table is full, for seeing if some files have been opened but never closed. In case you want to set breakpoints: this works by redefining `fopen' (`fclose') to be `kpse_fopen_trace' (`kpse_fclose_trace').
KPSE_DEBUG_PATHS
(8). Reports general path information for each file type Kpathsea is asked to search. This is useful when you are trying to track down how a particular path got defined--from `texmf.cnf', `config.ps', the compile-time default, an environment variable, etc. This is the contents of a structure defined in `tex-file.h'.
KPSE_DEBUG_EXPAND
(16). Reports the directory list corresponding to each path element Kpathsea searches in. This is only relevant when Kpathsea is searching the disk, since `ls-R' searches don't look through directory lists in this way (they go straight to the file using the hash table).
KPSE_DEBUG_SEARCH
(32). Reports on each file search Kpathsea attempts: the name of the file searched for, the path searched in, whether or not the file must exist (when drivers search for `cmr10.vf', it need not exist), and whether or not we are collecting all occurrences of the file in the path (as with, e.g., `texmf.cnf' and `texfonts.map'), or just the first (as with most lookups). This can help you correlate what Kpathsea is doing with what is in your input file.

Debugging output from Kpathsea is always written to standard error, and begins with `kdebug:'. (Except for hash table buckets, which just start with the number.)

3.1 Logging

Kpathsea can record the time and filename found for each successful search. This may be useful in finding good candidates for deletion when your disk is full.

To do this, define the environment or config file variable TEXMFLOG. The value is the name of the file to append the information to. The file is created if it doesn't exist.

Each successful search turns into one line in the log file, with two words separated by a space. The first word is the time of the search, as the integer number of seconds since "the epoch", i.e., UTC midnight 1 January 1970 (more precisely, the result of the time system call). The second word is the filename.

For example, after setenv TEXMFLOG /tmp/log, running Dvips on `story.dvi' appends the following lines:

774455887 /usr/local/lib/texmf/dvips/config.ps
774455887 /usr/local/lib/texmf/dvips/psfonts.map
774455888 /usr/local/lib/texmf/dvips/texc.pro
774455888 /usr/local/lib/texmf/fonts/public/cm/pk/ljfour/cmbx10.600pk
774455889 /usr/local/lib/texmf/fonts/public/cm/pk/ljfour/cmsl10.600pk
774455889 /usr/local/lib/texmf/fonts/public/cm/pk/ljfour/cmr10.600pk
774455889 /usr/local/lib/texmf/dvips/texc.pro

Only filenames that are absolute are recorded, to preserve some semblance of privacy.


Go to the first, previous, next, last section, table of contents.