DeBug

Enable/Disable debug output

DeBug

Shortest form: db.

Show or change the SDK’s debug logging: which layers and sources print messages at which severity, filtering by thread, and the output sinks.

  • debug: print Available layers: and the layer names.

  • debug [<layers>] [<sources>] [<severity>|+|-|=]: set the severity threshold. Lists are comma-separated, and an omitted list means all. Severities are Off, Fatal, Error, Warn, Info, Verbose and Debug, and may be shortened. + enables all messages, - none, and = restores the defaults.

The sub-command words show, sink, thread and test must be spelt out. debug test is not in the built-in help.

Changes only logging, not the switch. Turning Verbose or Debug on for busy layers can flood the console and syslog and slow syncd down; debug = restores the defaults.

Hardware-validated

drivshell> debug
Available layers:
APPL APPLDNX BCM BCMAPI BCMBD BCMCFG BCMCTH BCMDI BCMDNX BCMDRD BCMEDK BCMEVM BCMFP BCMHA BCMIMM BCMISSU BCMLM BCMLRD BCMLT BCMLTD BCMLTM BCMLTX BCMMGMT BCMPC BCMPKT BCMPTM BCMSEC BCMTM BCMTRM BOARD SAL SHARED SHAREDSWDNX SHR SOC SOCDNX SWSTATEDNX SYS TKS

Unvalidated

drivshell> debug bcm l3 verbose
debug show [<layers>] [<sources>]

Show the current severity of the given layers and sources (all by default), and the thread settings if thread filtering is on. Read-only.

Hardware-validated

drivshell> debug show bcm
-------- BCM --------
Warn
         ALpm ARL ATTach AUth BENCHMARK BFD CAPability CES
         CNT COLLECTOR COMMON CosQ CounTeR CPRI DLB DMA
         EDK ELPM EXTender FABric FAILover FCOE FlexCtr FlexDigest
         FlexInstr FLEXState FLOW FLOWTRACKER FP GDPLL GLB HASH
         HITBIT IFA INC INIT INIT_PP INSTRU INT INTr
         IPFIX IPMC IPSEC KeepAlive KNET KNETSYNC L2 L2GRE
         L2TABLE L3 latency_monitor LB LInk LSM LT MacSEC
         MCAST MEM MIM MIRRor MoD MPLS MSG MultiCast
         NIV OAM ONESYNC OOB OTHER PacKeT PHY PKT
         PKTIO POLicer POrt POSTCARD PPP PROFile PSTATS PTP
         QOS RANGE RATE RCPU Regex RX SAT SRV6
         STAT STG STK STP SUBPort SUM SWItch TAS
         TDM TELEMETRY TESTS TIME TRACE TRILL TRUNK TSN
         TUNnel TWAMP TX UDF UFT UTILs VLAN VXLAN
         XFLOW_MacSEC
debug sink [<sink_id>|<name>] [EnableMIN=<sev>] [EnableMAX=<sev>] [Units=<list>] [Ports=<list>] [eXtra=<n>] [PrefixMIN=<sev>] [PrefixMAX=<sev>] [PrefixFormat=<str>]

With no argument, list the sinks. With a sink id or name alone, show its settings. With options, change them. Unit and port lists take numbers, ranges a-b separated by commas, or all. The prefix format codes are listed in the built-in help.

Hardware-validated

drivshell> debug sink
Id   Name
0    console
1    logfile
debug thread <off|<tid>[,<tid>…]|self> [<layers>] [<sources>] [<severity>|+|-|=]

Show messages of the given layers and sources on the console only when they come from the listed threads (self is the shell’s own thread), or switch thread filtering off.

Unvalidated

drivshell> debug thread off
debug test [<n>]

Without a number, list the logging self-tests; with one, run that test, which prints test messages. Not in the built-in help.

Hardware-validated

drivshell> debug test
Available test suites:
0  : Test all log macros with current settings
2  : Test all log macros across all severities
3  : Test incremental logging single line
4  : Test incremental logging single line with prefix
5  : Test incremental logging multiple lines
6  : Test incremental logging multiple lines with prefix
7  : Test current settings with prefixed Fatal/Error
8  : Test all log macros with meta options
9  : Test all log macros with meta options and prefix
10 : Test option logging multiple lines
11 : Test option logging multiple lines with prefix
12 : Test all log functions for unit 1
13 : Test all log functions for unknown unit (-1)

Built-in help

    debug [show] [<layer_list>] [<source_list>] [<severity>|+|-|=]
    Options:
    show          display current settings
    <layer_list>  one or more comma-separated layers
                  (if omitted, then all layers)
    <source_list> one or more comma-separated sources
                  (if omitted, then all sources)
    <severity>    Off, Fatal, Error, Warn, Info, Verbose, Debug
    +             all messages
    -             no messages
    =             set to defaults
Thread sensitive debug usage:
    debug thread [off|<thread_list>] [<layer_list>] [<source_list>]
                 [<severity>|+|-|=]
    Options:
    off           disable thread sensitive check
    <thread_list> one or more comma-separated thread IDs
    <layer_list>  one or more comma-separated layers
                  (if omitted, then all layers)
    <source_list> one or more comma-separated sources
                  (if omitted, then all sources)
    <severity>    Off, Fatal, Error, Warn, Info, Verbose, Debug
    +             all messages
    -             no messages
    =             set to defaults
NOTE: When thread sensitive debug is enabled on any source, the thread
      information could be displayed by 'debug show'.
Other usages:
    debug sink [<sink_id>] [EnableMIN=<severity>] [EnableMAX=<severity>]
               [Units=<unit-list>] [Ports=<port-list>] [eXtra=<param-value>]
               [PrefixMIN=<severity>] [PrefixMAX=<severity>] [PrefixFormat=<str>]
    Options:
    EnableMIN     minimum severity level for which this sink is enabled
    EnableMAX     maximum severity level for which this sink is enabled
    Units         unit numbers for which this sink is enabled
    Ports         port numbers for which this sink is enabled
    eXtra         parameter for which this sink is enabled (-1 to skip)
    PrefixMIN     minimum severity level for prefixed log message
    PrefixMAX     maximum severity level for prefixed log message
    PrefixFormat  prefix format string
        The following format specifiers are supported
        %F - function name
        %f - file name
        %l - line number
        %u - unit number
        %p - port number
        %x - xtra parameter
        %L - layer of this log message source
        %S - source of this log message
        %s - severity level (string value) of this log message
        %t - time stamp (seconds since system start)
        %T - high resolution timestamp (micro seconds)
        %P - process or thread name
    Omitting options will list all installed sinks
    Units, ports and extra parameters can be a single value or a
    comma-separated list of values.

Further reading

SDK-6.5.20 HSDK Getting Started Guide (GS-SDK6520-R), plus SDK-6.5.20/21/22 Release Notes (RN-SDK65xx-R), cPCI-6S10 Series 6U CompactPCI Switch Blade User’s Manual (50-15099-1000, Rev 1.0), FBOSS: BcmSwitch gatherSdkState/rcload, validated shell commands, diag shell stress test, vendor-diag-shell skill, debugging doc, BCM-SDK命令的使用.pdf, BCM_SDK命令, 交换芯片Helix4 L2 L3功能验证, bcm 使用技巧.