Skip to content

Commit 1341f58

Browse files
authored
[202012] [generate_dump]: Enhance show techsupport for cisco-8000 platform (#2395)
* Collect data from /usr/share/sonic/device/<platform> and save in techsupport tarfile under sai directory
1 parent b21e2ce commit 1341f58

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

scripts/generate_dump

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,32 @@ collect_broadcom() {
939939
copy_from_masic_docker "syncd" "/var/log/bcm_diag_post" "/var/log/bcm_diag_post"
940940
}
941941

942+
###############################################################################
943+
# Collect Cisco-8000 specific information
944+
# Globals:
945+
# None
946+
# Arguments:
947+
# None
948+
# Returns:
949+
# None
950+
###############################################################################
951+
collect_cisco_8000() {
952+
trap 'handle_error $? $LINENO' ERR
953+
local platform=$(show platform summary --json | python -c 'import sys, json; \
954+
print(json.load(sys.stdin)["platform"])')
955+
956+
if [ -d /usr/share/sonic/device/${platform} ]; then
957+
pushd /usr/share/sonic/device/${platform} > /dev/null
958+
for file in $(find . -path "./*plugin*" -prune -o -path "./*.xml" -prune -o -path "./*.yaml" -prune -o -print); do
959+
save_file ${file} sai false
960+
done
961+
popd > /dev/null
962+
else
963+
echo "'/usr/share/sonic/device/${platform}' does not exist" > /tmp/error
964+
save_file /tmp/error sai false
965+
fi
966+
}
967+
942968
###############################################################################
943969
# Save log file
944970
# Globals:
@@ -1235,6 +1261,10 @@ main() {
12351261
collect_broadcom
12361262
fi
12371263

1264+
if [ "$asic" = "cisco-8000" ]; then
1265+
collect_cisco_8000
1266+
fi
1267+
12381268
# 2nd counter snapshot late. Need 2 snapshots to make sense of counters trend.
12391269
save_counter_snapshot $asic 2
12401270

0 commit comments

Comments
 (0)