Use Trace to Diagnose Problems

Use trace to observe the status of a software module at a given time.

About this task

For example, if you notice a CPU utilization issue (generally a sustained spike above 90%) perform a trace of the control plane activity.

Procedure

  1. Enter Global Configuration mode:

    enable

    configure terminal

  2. Clear the trace:

    clear trace

  3. Identify the module ID for which you want to use the trace tool:

    show trace modid-list

  4. Begin the trace operation:

    trace level [<Module_ID>] [<0-4>]

  5. Wait approximately 30 seconds.

    The default trace settings for CPU utilization are:

    • High CPU Utilization: 90%

    • High Track Duration: 5 seconds

    • Low CPU Utilization: 75%

    • Low Track Duration: 5 seconds

  6. Stop tracing:

    trace shutdown

  7. View the trace results:

    show trace file [tail]

  8. Search trace results for a specific string value, for example, the word error:

    trace grep [WORD<0-128>]

    If you use this command and do not specify a string value, you clear the results of a previous search.

  9. Stop tracing:

    trace shutdown

Example

Switch:1> enable 

Clear the trace:

Switch:1# clear trace 

Identify the module ID for which you want to use the trace tool:

Switch:1# show trace modid-list 
0   - COMMON
1   - SNMP
2   - RMON
3   - PORT_MGR
4   - CHAS_MGR
5   - BRIDGE
6   - HWIF
7   - SIM
8   - CPP
9  - NETDRV
10  - VLAN_MGR
11  - CLI
12  - MAIN
12  - P2IP
12  - RCIP
15  - WEBSRV
16  - ACIF
17  - GBIF
18  - WDT
19  - TDP
20  - MAN_DIAG
21  - MAN_TEST

--More-- (q = quit)

Begin the trace operation:

Switch:1# trace level 2 3 

Stop tracing:

Switch:1# trace shutdown 

Save the trace file to the internal flash card for retrieval:

Switch:1# save trace 

Search trace results for a specific string value, for example, the word error:

Switch:1# trace grep error 

Search trace results for a specific string value, for example, MAC address 00-1A-4B-8A-FB-6B:

Switch:1# trace grep 00-1A-4B-8A-FB-6B 

Variable Definitions

The following table defines parameters for the trace command.

Variable

Value

grep [WORD<0-128>]

Search trace results for a specific string value, for example, the word error. Performs a comparison of trace messages.

level [<Module_ID>] [<0-4>]

Starts the trace by specifying the module ID and level.
  • <Module_ID> specifies the module for the trace. Different hardware platforms support different ID ranges because of feature support differences. To see which module IDs are available on the switch, use the show trace modid-list command or CLI command completion Help.

  • <0-4> specifies the trace level from 0–4, where 0 is disabled; 1 is very terse; 2 is terse; 3 is verbose, 4 is very verbose.

shutdown

Stops the trace operation.

screen {disable|enable}

Enables the display of trace output to the screen.

The following table defines parameters for the save trace command.

Variable

Value

file WORD<1–99>

Specifies the file name in one of the following formats:
  • a.b.c.d:<file>