DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
C programmer's productivity tools

The PROFOPTS environment variable

The environment variable PROFOPTS provides run-time control over profiling, allowing you to override some of the default behavior. When the profiled program is about to terminate, it examines the value of PROFOPTS to determine how the profiling data is to be handled.

The PROFOPTS environment variable is a comma-separated list of options interpreted by the program being profiled. If PROFOPTS is not defined in the environment, then the default action is taken: the profiling data is saved in a file (with the default name) in the current directory. If PROFOPTS is set to the null string, no profiling data is produced.

The following options can be specified for PROFOPTS. They are explained in more detail in the examples.


msg=[y|n]
If msg=y is specified, a message is printed to stderr stating that profile data is being created. If msg=n is specified, only profiling error messages are printed. The default is msg=y.

merge=[y|n]
If merge=n is specified, data files are not merged after successive runs; the data file will be overwritten after each execution. If merge=y is specified, the data will be merged. The merge will fail if the program has been recompiled between runs; the data file will be stored in TMPDIR. The default is merge=n.

pid=[y|n]
If pid=y is specified, the name of the data file will include the process ID of the profiled program. This allows the creation of different data files for programs calling fork(S). If pid=n is specified, the default name is used. The default is pid=n.

dir=dirname
The data file is placed in the directory dirname if this option is specified. Otherwise, the data file is created in the directory that is current at the end of execution.

file=filename
filename is used as the name of the data file created by the profiled program if this option is specified. Otherwise the default name is used. (See ``Profiling programs that fork'' for an example.)


Next topic: Examples of using PROFOPTS
Previous topic: Running the profiled program

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003