Skip to content

Commit

Permalink
[202012] [generate_dump]: Enhance show techsupport for cisco-8000 pla…
Browse files Browse the repository at this point in the history
…tform (#2395)

* Collect data from /usr/share/sonic/device/<platform> and save in techsupport tarfile under sai directory
  • Loading branch information
gvlaemyn authored Sep 23, 2022
1 parent b21e2ce commit 1341f58
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions scripts/generate_dump
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,32 @@ collect_broadcom() {
copy_from_masic_docker "syncd" "/var/log/bcm_diag_post" "/var/log/bcm_diag_post"
}

###############################################################################
# Collect Cisco-8000 specific information
# Globals:
# None
# Arguments:
# None
# Returns:
# None
###############################################################################
collect_cisco_8000() {
trap 'handle_error $? $LINENO' ERR
local platform=$(show platform summary --json | python -c 'import sys, json; \
print(json.load(sys.stdin)["platform"])')

if [ -d /usr/share/sonic/device/${platform} ]; then
pushd /usr/share/sonic/device/${platform} > /dev/null
for file in $(find . -path "./*plugin*" -prune -o -path "./*.xml" -prune -o -path "./*.yaml" -prune -o -print); do
save_file ${file} sai false
done
popd > /dev/null
else
echo "'/usr/share/sonic/device/${platform}' does not exist" > /tmp/error
save_file /tmp/error sai false
fi
}

###############################################################################
# Save log file
# Globals:
Expand Down Expand Up @@ -1235,6 +1261,10 @@ main() {
collect_broadcom
fi

if [ "$asic" = "cisco-8000" ]; then
collect_cisco_8000
fi

# 2nd counter snapshot late. Need 2 snapshots to make sense of counters trend.
save_counter_snapshot $asic 2

Expand Down

0 comments on commit 1341f58

Please sign in to comment.