texprof - Man Page
A profiler for TeX source files
Synopsis
texprof [options] [&format] [file|\commands]
Description
Run the T E X profiler on file, usually creating file.dvi and file.tprof. If the file argument has no extension, ".tex" will be appended to it. Instead of a file name, a list of T E X commands can be given, the first of which must start with a backslash. With a &format argument, the T E X profiler uses a different set of precompiled commands, contained in format.fmt; it is usually better to use the -fmt format option instead.
The T E X profiler is a version of T E X that measures the time T E X needs to execute individual input lines or macros. It writes the collected data to a file with extension .tprof. A separate program, texprofile (see texprofile(1)), is used to display the content of a .tprof file in a readable form.
The typical use of the T E X profiler is with pre generated formats. The texprof command uses the equivalent of the plain T E X format, and the latexprof command uses the equivalent of the L A T E X format. To investigate the timing of macros targeted to pdftex or pdflatex, you can use pdftexprof or pdflatexprof.
The T E X profiler's handling of its command-line arguments is similar to that of the other T E X programs in the web2c implementation.
Options
This version of the T E X profiler understands the following command line options.
- -cnf-line string
Parse string as a texmf.cnf configuration line. See the Kpathsea manual.
- -etex
Enable the e-T E X extensions. This option is only effective in combination with -ini. See etex(1).
- -file-line-error
Print error messages in the form file:line:error which is similar to the way many compilers format them.
- -no-file-line-error
Disable printing error messages in the file:line:error style.
- -fmt format
Use format as the name of the format to be used, instead of the name by which the T E X profiler was called or a %& line.
- -help
Print help message and exit.
- -ini
Start in INI mode, which is used to dump formats. The INI mode can be used for typesetting, but no format is preloaded, and basic initializations like setting catcodes may be required.
- -interaction mode
Sets the interaction mode. The mode can be either batchmode, nonstopmode, scrollmode, and errorstopmode. The meaning of these modes is the same as that of the corresponding \commands.
- -jobname name
Use name for the job name, instead of deriving it from the name of the input file.
- -kpathsea-debug bitmask
Sets path searching debugging flags according to the bitmask. See the Kpathsea manual for details.
- -ltx
Enable the L A T E X extensions. This option is only effective in combination with -ini. See latex(1).
- -mktex fmt
Enable mktexfmt, where fmt must be either tex, tfm, fmt, or pk.
- -no-mktex fmt
Disable mktexfmt, where fmt must be either tex, tfm, fmt, or pk.
- -output-directory directory
Write output files in directory instead of the current directory. Look up input files in directory first, then along the normal search path.
- -parse-first-line
If the first line of the main input file begins with %& parse it to look for a dump name.
- -no-parse-first-line
Disable parsing of the first line of the main input file.
Enable the simulation of common pdftex primitives. This option requires the -ini option and implies the -ltx option. See pdftex(1).
- -prof
Enable profiling as soon as T E X enters the main loop. If tis option it not used, profiling needs to switched on using the \profileon primitive. Profiling can be switched of with the \profileoff primitive.
- -progname name
Pretend to be program name. This affects both the format used and the search paths.
- -version
Print version information and exit.
Environment
See the Kpathsea library documentation (e.g., the `Path specifications' node) for precise details of how the environment variables are used. The kpsewhich utility can be used to query the values of the variables.
- TEXMFOUTPUT
Normally, T E X puts its output files in the current directory. If any output file cannot be opened there, it tries to open it in the directory specified in the environment variable TEXMFOUTPUT. There is no default value for that variable. For example, if you say texprof paper and the current directory is not writable and TEXMFOUTPUT has the value /tmp, T E X attempts to create /tmp/paper.log , /tmp/paper.dvi , and /tmp/paper.tprof . TEXMFOUTPUT is also checked for input files, as T E X often generates files that need to be subsequently read; for input, no suffixes (such as “.tex”) are added by default, the input name is simply checked as given.
- TEXINPUTS
Search path for \input and \openin files. This normally starts with “.”, so that user files are found before system files. An empty path component will be replaced with the paths defined in the texmf.cnf file. For example, set TEXINPUTS to ".:/home/user/tex:" to prepend the current directory and “/home/user/tex” to the standard search path.
- TEXFORMATS
Search path for format files.
- TFMFONTS
Search path for font metric (.tfm) files.
- SOURCE_DATE_EPOCH
If set, its value, taken to be in epoch-seconds, will be used for the creation date and as the reference moment for the time related primitives of L A T E X. This is useful for making reproducible builds.
- FORCE_SOURCE_DATE
If set to the value "1", the time-related T E X primitives (\year, \month, \day, \time) are also initialized from the value of SOURCE_DATE_EPOCH. This is not recommended if there is any viable alternative.
Many, many more environment variables may be consulted related to path searching. See the Kpathsea manual.
Files
The location of the files mentioned below varies from system to system. Use the kpsewhich utility to find their locations.
- *.tfm
Metric files for T E X's fonts.
- *.fmt
Predigested T E X format files.
- *.pk *.pfb
Font files used by T E X.
Notes
This manual page is not meant to be exhaustive. The complete documentation for the T E X profiler can be found in texprof.pdf. Further information can be found in the manual of the Kpathsea library.
Bugs
This version of the T E X profiler does not implement all of the primitives that pdftex provides, and further, it will not produce the same side effects.
Availability
The T E X profiler should compile on a large variety of machine architectures and operating systems. The function to obtain timing information id POSIX specific.
The sources of the T E X profiler are hosted at https://github.com/ruckertm/HINT
See Also
texprofiler(1), tex(1), latex(1), pdftex(1), pdflatex(1),and kpsewhich(1).
Authors
The primary author of the T E X profiler is Martin Ruckert, with eT E X extensions by Peter Breitenlohner, L A T E X extensions by Thierry Laronde, and the kpathsearch library by Karl Berry.
T E X was designed by Donald E. Knuth, who implemented it using his WEB system for Pascal programs.
Many, many more contributed to the typesetting system now known as T E X; far too many to name all of them here.