MemWatch

Turn on/off memory snooping

MemWatch

Shortest form: mw.

Log SDK reads and writes of a memory, or count reads and writes of all memories. It does not change the hardware, but while syncd programs tables it can print a lot.

Grammar:

memwatch [<VIEW>:]<TABLE> | * <read | write | off>
memwatch start
memwatch stop [clear]
memwatch show [read | write] [all]
memwatch delta <on | off>

The built-in help shows memwatch [Mem=<Memory>] [write] [read] [off]; the shell actually takes the table name itself as the first word, followed by exactly one of read, write or off. * means all memories. All keywords must be typed in full (any case).

Unvalidated — Log every write to the L2 table

drivshell> memwatch L2X write
MemWatch start

Start counting reads and writes of all memories. memwatch stop [clear] stops counting and optionally resets the counts.

Unvalidated

drivshell> memwatch start
MemWatch show [read | write] [all]

Show the read and write counts of memories that changed since the last show (Read count: <n> +<delta>, Write count: <n> +<delta>); all includes unchanged memories. Prints WARNING: Memory watch not started on <unit> if counting is off.

Unvalidated

drivshell> memwatch show write
MemWatch delta <on | off>

Switch the delta mode on or off. Not in the built-in help.

Unvalidated

drivshell> memwatch delta on

Built-in help

Usages:
    All Memories Read/Write Counting Watch Options:
    memwatch start
           - Start to counting read/write operations on all memory
             It is turned-on by default
    memwatch stop [clear]
           - Stop to counting read/write operations on all memory
               -Clear - specify to clear memory counters
    memwatch show [ |read|write] [all]
           -Blank - specify to show both memory rd/wr-count update
           -Read  - specify to show memory rd-count update
           -Write - specify to show memory wr-count update
           -ALL   - specify to show memory rd/wr-count even if no update
    Specify which memory to watch:
    memwatch [Mem=<Memory>] [write] [read] [off]
           -Mem   - memory to watch
           -Write - specify to start watching writing operations on memory
           -Read  - specify to start watching reading operations on memory
           -Off   - specify to stop watching all operations on memory

Further reading

BCM_SDK命令, 交换芯片Helix4 L2 L3功能验证.