Maintain Statement Trace

In this section:

Maintain application developers can trace the logic flow of Maintain procedures and measure CPU and memory usage at the procedure, case, and statement level with the following server trace options:

Note: There will be a significant increase in CPU overhead when MNTPERF is in effect.

Trace operation codes generated at the compile stage determine the Maintain statements for which the above information is provided.

Trace records will be produced when a statement completes. If a Maintain procedure fails, an error message (3850) will print the last traced line.

There are two basic phases in the process of generating trace output for Maintain procedure at run time:

  1. Compiling Maintain procedures.
  2. Enabling server tracing and setting Maintain trace levels.

Top of page

x
Compiling Maintain Procedures

Trace operation codes are generated for the procedure at the time of the compile. There are two levels of statement trace detail available: basic and verbose. The level of detail in the trace output at run time depends on the type of compile statement used.

You can set Compiling and Compiling with Debug (verbose statement trace) at deployment time from within Developer Studio with settings in the Property option of a Deploy Scenario folder. For more information, see the Creating Reporting Applications With Developer Studio manual.

You can also use the following Maintain language commands:



Example: MNTCON COMPILE MNTCAR1 Using MNTSTMT

Note lines for Maintain statements Case and Endcase, and Call:

12.59.30 FU MNTSTMT>MNTCAR1  Line=  109.008 F= 1  S=CaseDef  006 
Msec=46770750  Cpu=   0 Mmem=  2052 Amem=   0
12.59.30 FU MNTSTMT>MNTCAR1  Line=  120.003 F= 1  S=CaseEnd  001 
Msec=46770750  Cpu=   0 Mmem=  2052 Amem=   0
12.59.30 FU MNTSTMT>MNTCAR1  Line=  122.008 F= 1  S=CaseDef  006 
Msec=46770750  Cpu=   0 Mmem=  2052 Amem=   0
12.59.30 FU MNTSTMT>MNTCAR1  Line=  101.008 F= 1  S=CaseDef  006 
Msec=46770750  Cpu=   0 Mmem=  2052 Amem=   0
12.59.30 FU MNTSTMT>MNTCAR1  Line=   14.006 F= 2  S=CaseDef  006 
Msec=46770750  Cpu=   0 Mmem=  2052 Amem=   0
12.59.31 FU MNTSTMT>MNTGET1  Line=    5.006 F= 1  S=CaseDef  006 
Msec=46771691  Cpu=   0 Mmem=  2315 Amem=   0
12.59.31 FU MNTSTMT>MNTGET1  Line=   11.001 F= 1  S=CaseEnd  001 
Msec=46771751  Cpu=   0 Mmem=  2316 Amem=   0
12.59.31 FU MNTSTMT>MNTCAR1  Line=  17.019 F= 2  S=CallStmt  005 
Msec=46771761  Cpu=   0 Mmem=  2254 Amem=   0
12.59.31 FU MNTSTMT>MNTCAR1  Line=   18.001 F= 2  S=CaseEnd  001 
Msec=46771761  Cpu=   0 Mmem=  2254 Amem=   0
12.59.31 FU MNTSTMT>MNTCAR1  Line=  103.003 F= 1  S=CaseEnd  001 
Msec=46771761  Cpu=   0 Mmem=  2254 Amem=   0
12.59.31 FU MNTSTMT>MNTCAR1  Line=  132.003 F= 1  S=CaseEnd  001 
Msec=46771761  Cpu=   0 Mmem=  2254 Amem=   0


Example: MNTCON DEBUG EX MNTCAR1 Using MNTSTMT

Note lines for Maintain statements Reposition, Stack Clear, Next and For statements:

13.21.17 FU MNTSTMT>MNTCAR1  Line=  109.008 F= 1  S=CaseDef  006 
Msec=48077990  Cpu=   0 Mmem=  2052 Amem=   0
13.21.17 FU MNTSTMT>MNTCAR1  Line=  120.003 F= 1  S=CaseEnd  001 
Msec=48077990  Cpu=   0 Mmem=  2052 Amem=   0
13.21.17 FU MNTSTMT>MNTCAR1  Line=  122.008 F= 1  S=CaseDef  006 
Msec=48077990  Cpu=   0 Mmem=  2052 Amem=   0
13.21.17 FU MNTSTMT>MNTCAR1  Line=  101.008 F= 1  S=CaseDef  006 
Msec=48077990  Cpu=   0 Mmem=  2052 Amem=   0
13.21.17 FU MNTSTMT>MNTCAR1  Line=   14.006 F= 2  S=CaseDef  006 
Msec=48077990  Cpu=   0 Mmem=  2052 Amem=   0
13.21.19 FU MNTSTMT>MNTGET1  Line=    5.006 F= 1  S=CaseDef  006 
Msec=48079672  Cpu=   0 Mmem=  2315 Amem=   0
13.21.19 FU MNTSTMT>MNTGET1  Line=    8.012 F= 1  S=RepoStmt 031 
Msec=48079672  Cpu=   0 Mmem=  2315 Amem=   0
13.21.19 FU MNTSTMT>MNTGET1  Line=    9.013 F= 1  S=StakClear 035 
Msec=48079672  Cpu=   0 Mmem=  2315 Amem=   0
13.21.19 FU MNTSTMT>MNTGET1  Line=   10.040 F= 1  S=NextStmt  017 
Msec=48079682  Cpu=   0 Mmem=  2315 Amem=   0
13.21.19 FU MNTSTMT>MNTGET1  Line=   10.040 F= 1  S=NextStmt  017 
Msec=48079682  Cpu=   0 Mmem=  2315 Amem=   0
13.21.19 FU MNTSTMT>MNTGET1  Line=   10.040 F= 1  S=NextStmt  017 
Msec=48079682  Cpu=   0 Mmem=  2316 Amem=   0
13.21.19 FU MNTSTMT>MNTGET1  Line=   10.040 F= 1  S=NextStmt  017 
Msec=48079682  Cpu=   0 Mmem=  2316 Amem=   0
13.21.19 FU MNTSTMT>MNTGET1  Line=   10.040 F= 1  S=MntForSt  015 
Msec=48079682  Cpu=   0 Mmem=  2316 Amem=   0

Top of page

x
Enabling Server Tracing and Setting Trace Levels

Reference:

Server tracing must be enabled in order to activate the Maintain statement trace. These trace settings can be set:

Refer to the WebFOCUS documentation for your server platform for information on setting traces from the Web Console and for profile commands.



x
Reference: Examples of Enabling and Setting Tracing

The following are examples of enabling server tracing in EDASPROF.PRF and setting tracing using SYS_MGR.FOCSET.



Example: Enabling Server Tracing in EDASPROF.PRF

The following commands enable server tracing and disable all trace levels except MNTSTMT:

SET TRACEUSER=ON
SET TRACEOFF=ALL
SET TRACEON=MNTSTMT


Example: Setting Tracing Using SYS_MGR.FOCSET

The following commands enable tracing from a Maintain procedure:

SYS_MGR.FOCSET("TRACEON","MNTSTMT"); 
SYS_MGR.FOCSET("TRACEUSER","ON");

Top of page

x
Viewing Trace Output

After compiling and enabling the trace facility, running the Maintain procedure using the appropriate command (MNTCON RUN, MNTCON RUNIMAGE, MNTCON EX or MNTCON DEBUG EX) will generate the trace information. The output will be in the .trc file (ts000001, etc.) in the edatemp directory; each line of the Maintain trace information is prefixed with 'MNTSTMT'.

You can view the trace output file from the console by clicking Show the File. This displays the Maintain statement trace output for the .trc file displayed in the Select File dropdown box.

You can also generate custom reports using the MNTSTMT.MAS file, which is packaged with the server; the fields in this master file correspond to the components of the Maintain trace line. By issuing a FILEDEF for the trace output file, you can extract the relevant information.



Example: Viewing Trace Output in the MNTSTMT.MAS File

The following code

FILEDEF MNTSTMT DISK E:\IBI\APPS\MY71APP\TS000001.TRC
-RUN
TABLE FILE MNTSTMT
PRINT CPU MNTMEM AGNMEM
BY TOD BY PROCNAME BY STMTTYPE 
IF MNTSTMTLAB EQ 'MNTSTMT>'
ON STMTTYPE SKIP-LINE
END

produces output formatted as shown below:

TOD        PROCNAME          STMTTYPE          CPUMSEC   MNTMEM  AGNMEM
---        --------          --------          -------   ------  ------
13.28.08   MNTNEW1           CaseDef             11010   2315     11016
                             CaseEnd             11010   2316     11016
                             MntForSt            11010   2316     11016
                             NextStmt            11010   2316     11016
                                                 11010   2316     11016
                                                 11010   2316     11016
                                                 11010   2316     11016
                                                 11010   2316     11016
                             RepoStmt            11010   2316     11016
                             StakClear           11010   2316     11016
.
.
.

Top of page

x
Sample Usage Scenarios for Tracing

WebFOCUS