Skip to content

Commit

Permalink
[Mellanox] Add all results from saisdkdump to the techsupport on Mell…
Browse files Browse the repository at this point in the history
…anox switches (sonic-net#1660)

- What I did
Enhance the way techsupport collects dumps provided by SAI and do not keep them in the filesystem once the techsupport is created.

- How I did it
Create a temporary directory once techsupport script is executed, gather all files SAI dumps created, add them to the tech support and remove the temporary directory and files.
Remove direct call to FW trace collection as it is done now by SAI dump

- How to verify it
Run techsupport, verify newly created files are part of it including mlxtrace which is no longer called directly by the techsupport script.
  • Loading branch information
DavidZagury committed Jun 20, 2021
1 parent a1c8751 commit 45e7b71
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions scripts/generate_dump
Original file line number Diff line number Diff line change
Expand Up @@ -758,10 +758,20 @@ enable_logrotate() {
# None
###############################################################################
collect_mellanox() {
local sai_dump_filename="/tmp/sai_sdk_dump_$(date +"%m_%d_%Y_%I_%M_%p")"
local sai_dump_folder="/tmp/saisdkdump"
local sai_dump_filename="${sai_dump_folder}/sai_sdk_dump_$(date +"%m_%d_%Y_%I_%M_%p")"

${CMD_PREFIX}docker exec -it syncd mkdir -p $sai_dump_folder
${CMD_PREFIX}docker exec -it syncd saisdkdump -f $sai_dump_filename
${CMD_PREFIX}docker exec syncd tar Ccf $(dirname $sai_dump_filename) - $(basename $sai_dump_filename) | tar Cxf /tmp/ -
save_file $sai_dump_filename sai_sdk_dump true

copy_from_docker syncd $sai_dump_folder $sai_dump_folder
echo "$sai_dump_folder"
for file in `ls $sai_dump_folder`; do
save_file ${sai_dump_folder}/${file} sai_sdk_dump true
done

${CMD_PREFIX}rm -rf $sai_dump_folder
${CMD_PREFIX}docker exec -it syncd rm -rf $sai_dump_folder

local mst_dump_filename="/tmp/mstdump"
local max_dump_count="3"
Expand Down

0 comments on commit 45e7b71

Please sign in to comment.