Skip to content

[config/mlnx.py]Prompt the risk of excessive consumption of disk space when user intends to turn on the sdk sniffer.#2

Closed
stephenxs wants to merge 1 commit intomasterfrom
warn-when-sdk-sniffer
Closed

[config/mlnx.py]Prompt the risk of excessive consumption of disk space when user intends to turn on the sdk sniffer.#2
stephenxs wants to merge 1 commit intomasterfrom
warn-when-sdk-sniffer

Conversation

@stephenxs
Copy link
Owner

Prompt the risk of excessive consumption of disk space when the user intends to turn on the sdk sniffer.
The SDK sniffer is a diagnosis feature, introduced with a view to recording the all the operations to SDK into the sniffer file which the low-level team can replay and investigate. Only the sniffer file contains all the operations from SWSS restart does it help. To handle it in a way log-rotate does can hurt its integrity since the operations can be lost during rotating and to address this requires big effort.
So we just add a prompt of that risk for now.

- What I did

- How I did it

- How to verify it

- Previous command output (if the output of a command-line utility has changed)

- New command output (if the output of a command-line utility has changed)

-->

Prompt the risk of excessive consumption of disk space when user intends to turn on the sdk sniffer.
The SDK sniffer is a diagnosis feature, introduced with a view to recording the all the operations to SDK into the sniffer file which the low level team can replay and investigate. Only the sniffer file contains all the operations from SWSS restart does it help. To handle it in a way like log-rotate can hurt its integrity since the operations can be lost during rotating and to address this requires big effort.
So we just add a promot of that risk for now.
@stephenxs stephenxs closed this May 30, 2019
stephenxs pushed a commit that referenced this pull request Nov 21, 2023
…aidump_by_route_size (sonic-net#2972)

* * [saidump]
•	Saidump for DNX-SAI sonic-net/sonic-buildimage#13561

Solution and modification:
To use the redis-db SAVE option to save the snapshot of DB each time and recover later, instead of looping through each entry in the table and saving it.

(1) Updated sonic-buildimage/build_debian.sh, to install Python library rdbtools into the host.
(2) Updated sonic-buildimage/src/sonic-sairedis/saidump/saidump.cpp, add a new option -r, which updates the rdbtools's output-JSON files' format.
(3) Add a new script file: files/scripts/saidump.sh, to do the below steps
  For each ASIC0, such as ASIC0,

  #1. Save the Redis data.
  sudo sonic-db-cli -n asic$1 SAVE > /dev/null

  #2. Move dump files to /var/run/redisX/
  docker exec database$1 sh -c "mv /var/lib/redis/dump.rdb /var/run/redis$1/"

  #3. Run rdb command to convert the dump files into JSON files
  sudo python /usr/local/bin/rdb --command json  /var/run/redis$1/dump.rdb | sudo tee /var/run/redis$1/dump.json > /dev/null

  #4. Run saidump -r to update the JSON files' format as same as the saidump before. Then we can get the saidump result in standard output.
  docker exec syncd$1 sh -c "saidump -r /var/run/redis$1/dump.json"

  #5. clear
  sudo rm -f /var/run/redis$1/dump.rdb
  sudo rm -f /var/run/redis$1/dump.json

(4) Update sonic-buildimage/src/sonic-utilities/scripts/generate_dump, replace saidump with saidump.sh
* * [saidump]
•	Saidump for DNX-SAI sonic-net/sonic-buildimage#13561
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants