SetTracePC

Mon 01 January 2018

Syntax

SetTracePC(n)

Description

Use the SetTracePC function to control PeopleCode trace settings programmatically. This is useful if you want to isolate and debug a single program or part of a program.

Note: If you’re using an API with the Session class, use the Trace Setting class properties instead of this function.

You can also set options prior to starting a PeopleSoft Application Designer session using the Trace tab of PeopleSoft Configuration Manager.

Tracing PeopleCode creates and writes data to a trace file that it shares with SQL tracing; SQL trace and PeopleCode trace information are both output to the file in the order of execution. The trace file uses a file name and location specified in the Trace page of PeopleSoft Configuration Manager. If no trace file is specified in PeopleSoft Configuration Manager, the file is set by default to DBG1.TMP in your Windows TEMP directory. If you specify only a file name, and no directory is specified, the file is written to the directory you’re running PeopleSoft Application Designer from. This file is cleared each time you log on and can be opened in a text editor while you are in a PeopleSoft Application Designer session, so if you want to save it, you must print it or copy it from your text editor.

Trace timings are given in the elapsed time in seconds, but reported in microseconds and include CPU time and "cycles". The CPU time measurement, depending on platform, may not be very precise. The "cycles" is a measure of how much PeopleCode the program is executing. It counts loops around the PeopleCode interpreter. This cycle count is only updated when some tracing or debugging is going on. So, for example, turning the trace off then back on again will skip some cycles.

Note: Oracle recommends using a value of  %TracePC_Statements (2048) instead of %TracePC_Functions (1) and %TracePC_List (2).

Parameters

Field or Control

Definition

options

Either a number or a constant value that sets trace options. Calculate options by either totaling the numbers associated with any of the following options or by adding constants together:

Numeric Value

Constant Value

Description

0

%TracePC_None

Set trace off.

1

%TracePC_Functions

Provide a trace of the program as it is executed. This implies options 64, 128, and 256 described in the following rows.

2

%TracePC_List

Provide a listing of the entire program.

4

%TracePC_Assigns

Show the results of all assignments made to variables.

8

%TracePC_Fetches

Show the values fetched for all variables.

16

%TracePC_Stack

Show the contents of the internal machine stack. This option is normally used for debugging the PeopleCode language and not PeopleCode programs.

64

%TracePC_Starts

Provide a trace showing when each program starts.

128

%TracePC_ExtFuncs

Provide a trace showing the calls made to each external PeopleCode routine.

256

%TracePC_IntFuncs

Provide a trace showing the calls made to each internal PeopleCode routine.

512

%TracePC_ParamsIn

Show the values of the parameters to a function.

1024

%TracePC_ParamsOut

Show the values of the parameters as they exist at the return from a function.

2048

%TracePC_Statements

Show each statement as it's executed (and do not show statements on branches not taken.)

32768

%TracePC_Evaluations

Start the timing tracing of the start and end of top-level program evaluations. This is similar to the Trace Start of Programs, but only traced when the call isn't directly from PeopleCode.

It traces recursive evaluations, like what happens when a ScrollSelect in a RowInit event causes another recursive RowInit to fire during the outer RowInit.

If both Trace Evaluations (32768) and Trace Start of Programs (64) are on (32768+64 = 32832) then all routine calls (functions, methods, get, set for both internal and external PeopleCode to PeopleCode calls) are traced. The resulting trace file can be processed by a program to add up the timings for each routine and separate the in-routine timings from those for called routines.

Returns

None.