SRI Technologies

Last Modified
Date: 11-Dec-2005
Time: 03:07:37
Index

Project Name: SqrPlus
System Name: SqrPlus Trace Analysis System
Application Name: SqrPlus Trace
Source File: SQRP-TRC.SQC
Shared Code Name: Sqc for Trace Analysis
Description: Sqc that contains procedures that are required in SqrPlus Trace Analysis System.
Used by *.CTR files created by SqrPlus Compiler.
Author: SRI Technologies

Procedure Index:
Sl.NoProcedureDescription
1 SQRP-TRC-BEGINCalled at the begining of each procedure.
2 SQRP-TRC-ENDCalled before end of each procedure.
3 SQRP-TRC-STOPCalled before stop.
4 SQRP-TRC-OPTIONSCalled before stop.
5 SQRP-TRC-ARGSCalled internally by Trace Application.
6 SQRP-TRC-MSGMay be called anywhere to Log Message.

Program Change Log:
Sl.NODateAuthorRemark
1.01-09-1999DJInitial coding.
2.01-07-2002SMModified to support procedures not to be traced.
$SQRP_TRC_List variable can contain procedure name with preceding '-' character. This would indicate the procedure not to be traced.
e.g. if contents of this variable is ';*;-GET-DEPT-NAME;' then all procedures will be traced except GET-DEPT-NAME.
3.10-07-2002SMIntroduced ADS tags for documentation.


Database Tables:
SLNO.Table NameAccess ModeProcedure NameRemarks
1NoneN/AN/ANot Applicable

Include Files:

  1. None


This SQC uses following global variables:

+------------------------------------------------------------------| 
|                                                                  | 
|                                                                  | 
| CALLS_STACK_SIZE       Constant for stack size.                  | 
| SQRP_CallArray         Array to stack the procedure calls.       | 
|                                                                  | 
| #SQRP_CallsIdx         Index pointer to call stack.              | 
|                                                                  | 
| #SQRP_TRC_on           Set if entry/exit to procedures are to    | 
|                        be logged.                                | 
|                        Defaults to 1 (true).                     | 
|                        May be set in the main (*.sqr) program.   | 
|                                                                  | 
| $SQRP_TRC_List         List of procedures to be traced. ';*;' if | 
|                        all procedure to be traced.               | 
|                        Procedure names are ';' seperated.        | 
|                        May be set in the main (*.sqr) program.   | 
|                        by calling SQRP-TRC-Options procedure     | 
|                        as:                                       | 
|                                                                  | 
|                      do SQRP-TRC-Options (1, ';*;-GET-DEPT-NAME')| 
|                                                                  | 
|                      Note: Value must be in upper case           | 
+------------------------------------------------------------------+ 


See Also:

  1. None

Procedures:

  1. Procedure Name: SQRP-TRC-BEGIN
    Procedure Description: Called at the begining of each procedure.
    Procedure Type: Local

    Arguments/Parameter:
    SLNO.VariableMode
    1$PROC_NAMEBy Value
    2$PROC_ARGSBy Value

    Database Tables:
    SLNO.Table NameAccess ModeRemarks
    1NoneN/ANot Applicable

    Processing:

    Main Processing

    1. When called first time, initialises the procedure call stack array. It also sets the default trace options and logs begining of call trace message.
    2. Log entry message for given procedure name if that procedure qualifies to be logged.
    3. If argument list is not null, log their value at the time of entering procedure.
    4. All logging is done in log file created by sqr program.
    5. Check for array subscript overflow and log message appropriate error message.
    6. Calling procedure must call SQRP-TRC-End.

    See Also:

    1. SQRP-TRC-End
    2. SQRP-TRC-Options
    3. SQRP-TRC-Args

  2. Procedure Name: SQRP-TRC-END
    Procedure Description: Called before end of each procedure.
    Procedure Type: Local

    Arguments/Parameter:
    SLNO.VariableMode
    1$PROC_ARGSBy Value

    Database Tables:
    SLNO.Table NameAccess ModeRemarks
    1NoneN/ANot Applicable

    Processing:

    Main Processing

    1. Check for array subscript underflow and log message appropriate error message.
    2. Get last procedure name from array.
    3. Get current date-time.
    4. If procedure qualifies for trace, log exit message.
    5. If argument list is not null, log their value at the time of exiting procedure.
    6. Calling procedure must call SQRP-TRC-Begin.
    7. All logging is done in log file created by sqr program.

    See Also:

    1. SQRP-TRC-Begin
    2. SQRP-TRC-Options
    3. SQRP-TRC-Args

  3. Procedure Name: SQRP-TRC-STOP
    Procedure Description: Called before stop.
    Procedure Type: Local

    Arguments/Parameter:
    SLNO.VariableMode
    N/ANoneNot Applicable

    Database Tables:
    SLNO.Table NameAccess ModeRemarks
    1NoneN/ANot Applicable

    Processing:

    Main Processing

    1. Get current date-time.
    2. Log Procedure Call Trace.
    3. All logging is done in log file created by sqr program.

    See Also:

    1. SQRP-TRC-Begin
    2. SQRP-TRC-End

  4. Procedure Name: SQRP-TRC-OPTIONS
    Procedure Description: Called before stop.
    Procedure Type: Local

    Arguments/Parameter:
    SLNO.VariableMode
    1#ONBy Value
    2$PROC_LISTBy Value

    Database Tables:
    SLNO.Table NameAccess ModeRemarks
    1NoneN/ANot Applicable

    Processing:

    Call Trace Options

    1. Sets Call Trace mode to On/Off depending on value #on variable (1/0).
    2. Sets list of procedures to be traced. ';*;' means all procedures.
    3. Log Call trace message.

    See Also:

    1. SQRP-TRC-Begin
    2. SQRP-TRC-End

  5. Procedure Name: SQRP-TRC-ARGS
    Procedure Description: Called internally by Trace Application.
    Procedure Type: Local

    Arguments/Parameter:
    SLNO.VariableMode
    1#INBy Value
    2$PROCBy Value
    3$TIMEBy Value
    4$ARGSBy Value

    Database Tables:
    SLNO.Table NameAccess ModeRemarks
    1NoneN/ANot Applicable

    Processing:

    Main Processing.

    1. Depending on value of #in, log in/out message.
    2. Log argument list.
    3. Log Call trace message.

    See Also:

    1. SQRP-TRC-Begin
    2. SQRP-TRC-End

  6. Procedure Name: SQRP-TRC-MSG
    Procedure Description: May be called anywhere to Log Message.
    Procedure Type: Local

    Arguments/Parameter:
    SLNO.VariableMode
    1$MSGBy Value

    Database Tables:
    SLNO.Table NameAccess ModeRemarks
    1NoneN/ANot Applicable

    Processing:

    Main Processing.

    1. Get Current Time.
    2. Log message.