# cgtrace - Performing CG board debugging

Enables debugging and tracing of CG boards.

#### Usage

cgtrace -bboardnum options

where boardnum is the CG board number (0 by default) and options are:

Option | Description
--- | ---
-gglobalmask | Sends the specified global trace mask globalmask in hexadecimal format to the board.
-q | Displays the global trace masks and manager IDs of the board.
-r | Displays the current global or manager trace masks.
-mmanagernum tracemask params | Sends a new tracing configuration to the specified manager, where: managernum is the manager ID in hexadecimal format. tracemask is the manager trace mask in hexadecimal format. params are the manager-specific tracing parameters. The parameters can be decimal or hexadecimal numbers or strings in quotes. Prefix hexadecimal numbers with 0x. Specify tracing parameters depending on the needs of the particular manager to be traced.

#### Description

cgtrace enables debugging output for various on-board software components (managers). The resulting debug output appears in the oammon display.

#### Procedure

Complete the following procedure to run cgtrace:

Step | Action
1 | Enter the following command after a board has been booted: cgtrace -bboardnumber options If options are omitted, the following menu of commands appears: L - List All Managers D Manager_ID - Display Trace Info S Manager_ID [Trace_Data] - Send New Tracing Configuration R Manager_ID / Global_ID - Request Current Tracing Configuration G Trace_Mask - Send New Global Trace Mask Q - Quit
2 | Enter one of the following commands followed by the required parameters (if any):
Command | Description
--- | ---
L | Lists the manager IDs of all the on-board managers that support tracing. ID: 0 - Global tracing ID: 1 - Filter manager ID: 2 - Executive ID: 3 - Host interface ID: 4 - Switching manager ID: 5 - Legacy manager ID: 7 - Image manager ID: 8 - Framer manager ID: 9 - Resource manager ID: A - HDLC manager ID: D - DSP manager ID: 10 - CLK manager ID: 13 - Diagnostic manager
D | Displays tracing information for the given manager ID in hexadecimal format or displays global tracing information (Manager ID = 0).
S | Sends a new tracing configuration to the given manager ID. This command requires a manager ID in hexadecimal format, a trace mask in hexadecimal format, and optionally integers in decimal or hexadecimal format or strings in quotes. Prefix hexadecimal numbers with 0x. Use the D command to determine valid trace masks, as well as integer and string parameters for a given manager. Output resulting from this command appears in the oammon display.
R | Displays the current trace mask for the given manager ID or displays the current global trace masks (Manager ID = 0).
G | Sends the given global trace mask (hexadecimal number) to the board. Output resulting from this command appears in the oammon display.
Q | Quits the application.

#### Details

Use the D command to determine valid trace masks, as well as valid integer and string parameters, for a given manager.

For example, selecting the filter manager (Manager ID = 1) displays the following trace options:

Trace Masks:
.. 00000001: Trace Commands
.. 00000002: Object Creates and Destroys
.. 00000004: Object Starts and Stops
.. 00000010: Extra Pin Connect and Disconnect Errors

Each of these lines describes a tracing option that can be enabled for the filter manager. Combine the options to get a 32-bit tracing mask. Use the S command to send the tracing mask to the manager. For example, to enable command tracing and object starts and stops for the filter manager, use the tracing mask 00000005.

The DSP manager is an example of a manager with an optional integer parameter. Enter the D command and select the DSP manager (Manager ID = D). The following trace options display:

Trace Masks:
.. 00000001: Trace Commands
.. 00000002: DSP - HPI Cmd Queue Sent
.. 00000004: DSP - HPI Cmd Queue Buffered
.. 00000010: DSP - HPI DSP Out Queue Reads
.. 00000020: DSP - HPI DSP Out Queue Parse: OS Acks
.. 00000040: DSP - HPI DSP out queue parse:OS other events
.. 00000080: DSP - HPI DSP Out Queue Parse: DPF Events
.. 00000100: DSP - HPI DSP Out Queue Parse: DPF Data Events
.. 00000200: DSP - HPI DSP Out Queue Parse: Data
.. 00000400: DSP - HPI DSP Out Queue Parse: Data Requests
.. 00001000: DSP - HPI DSP Data In Queue Sent
.. 00002000: DSP - HPI DSP Data In Queue Sent With Data
.. 00010000: DSP - DPF Starts and Stops
.. 00020000: DSP - DPF Events and Command Acks
.. 00040000: DSP - DPF Pauses and Resumes
.. 00080000: DSP - DPF Modifies
.. 00100000: DSP - High Speed Memory available
.. 00200000: DSP - Managed Memory checking during execution
.. 01000000: DSP - Extended Pin Information
.. 02000000: DSP - DPF Proxy Creates and Destroys
.. 10000000: DSP - # DSP Resource Groups and DSPs in each group
.. 20000000: DSP - Display and reset DSP packet statistics
.. 40000000: DSP - Dump the amount of resources available
.. 80000000: DSP - Dump DPF and Pin Data
Integer 0:
.. Min -1, Max 96, Default 0 (Optional): DSP to Trace

The DSP manager has a large number of different tracing configurations. Most of the configurations involve the DSPs and not the manager. Therefore, most trace commands to the DSP manager make use of the optional integer parameter. For example, a common trace flag for the DSPs is to trace all DPF (DSP function) starts and stops. To set this flag for DSP 5, use the S command. Enter the following information at the command line:

S D 00010000 5

where 5 is the optional integer parameter (in this example, the DSP to trace). The DSP manager also contains a special case: if -1 is specified as the DSP to trace, all DSPs obtain that trace mask.

#### cgtrace and resource management

To display a list of resource management trace values available with a brief description of what each value traces, enter 9.

cgtrace displays the following list:

Tracing data for Resource Manager...
Trace Masks:
.. 00000001: RM CMD Enable Trace Commands
.. 00000002: RM EVT Enable Trace Events
.. 00000010: Resource Objects creation and destruction
.. 00200000: List Pool names indexed by timeslots in global table
.. 00400000: Display all DPFs in resource definition (Pool name required)
.. 00000040: Allocate and Destroy of Resource Objects while running
.. 00100000: Print Prestart list
.. 01000000: Prints Host ResDef (Pool name required)
.. 02000000: Prints all TCP ResDefs (TCP name required)
.. 04000000: Resource Calculation of Definition in use( Pool name required)
.. 10000000: Number of pools and their names
.. 20000000: Single pool: number of objects, number objects in use (Pool name required)
.. 40000000: Single pool details: List of resource objects and their engine (pool name required)
String 0:
.. MaxLen 11, Default "" Optional): Res Label or TCP label
Ex: S Manager_ID Trace_Mask ["String"]

To send a trace configuration to the on-board resource manager, enter the S command.

When the menu indicates the pool name required for a particular trace mask, you must enter, in quotes, the name (set with the Resource[x].Name keyword) associated with the resources you want to trace.

To set the global trace mask on the board after the board has been booted, enter the G command.