HP SunSoft Pascal 4.0 User Manual

Page 83

Advertising
background image

The Pascal Compiler

59

3

This option causes execution frequency data to be collected and saved during
execution, then the data can be used in subsequent runs to improve
performance.

Table 3-6

The

-xprofile

Values

Value

Meaning

collect

Collect and save execution frequency for later use by the optimizer.

The compiler inserts code to measure the execution frequency at a low
level. During execution, the measured frequency data is written into

.prof

files that correspond to each of the source files.

If you run the program several times, the execution frequency data
accumulates in the

.prof

files; that is, output from prior runs is not lost.

use

Use execution frequency data saved by the compiler.

Optimize by using the execution frequency data previously generated
and saved in the

.prof

files by the compiler.

The source files and the compiler options (excepting only this option),
must be exactly the same as for the compilation used to create the
compiled program that was executed to create the

.prof

files.

tcov

Correctly collects data for programs that have source code in header files
or make use of C++ templates. See

-a

for information on the old style of

profiling, the

tcov

(1) man page, and the Profiling Tools manual for more

details.

Code instrumentation is performed similarly to that of

-a

, but

.d

files

are no longer generated. Instead, a single file is generated, whose name is
based off of the final executable. For example, if the program is run out
of

/foo/bar/myprog

, then the data file is stored in

/foo/bar/myprog.profile/myprog.tcovd

.

When running

tcov

, you must pass it the

-x

option to make it use the

new style of data. If not,

tcov

uses the old

.d

files, if any, by default for

data, and produces unexpected output.

Unlike

-a

, the

TCOVDIR

environment variable has no effect at compile-

time. However, its value is used at program runtime.

Advertising