Skip to content

Commit aaa8d25

Browse files
authored
[202205][generate_dump]: Enhance show techsupport for cisco-8000 platform (#2533)
What I did Added cisco-8000 specific platform information to "show techsupport" tarfile How I did it Added collect_cisco_8000 function to scripts/generate_dump which filters out the wanted files from /usr/share/sonic/device/${platform} and saves them in the techsupport tarfile under sai subdirectory How to verify it Run "show techsupport" and grep sai in the generated techsupport tarfile Signed-off-by: Geert Vlaemynck <[email protected]>
1 parent 25d581e commit aaa8d25

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

scripts/generate_dump

+34
Original file line numberDiff line numberDiff line change
@@ -1215,6 +1215,36 @@ collect_broadcom() {
12151215
copy_from_masic_docker "syncd" "/var/log/bcm_diag_post" "/var/log/bcm_diag_post"
12161216
}
12171217

1218+
###############################################################################
1219+
# Collect Cisco-8000 specific information
1220+
# Globals:
1221+
# None
1222+
# Arguments:
1223+
# None
1224+
# Returns:
1225+
# None
1226+
###############################################################################
1227+
collect_cisco_8000() {
1228+
trap 'handle_error $? $LINENO' ERR
1229+
local platform=$(show platform summary --json | python -c 'import sys, json; \
1230+
print(json.load(sys.stdin)["platform"])')
1231+
1232+
if [ -d /usr/share/sonic/device/${platform} ]; then
1233+
pushd /usr/share/sonic/device/${platform} > /dev/null
1234+
for file in $(find . -path "./*plugin*" -prune -o -path "./*.xml" -prune -o -path "./*.yaml" -prune -o -print); do
1235+
if [ -f ${file} ]; then
1236+
save_file ${file} sai false
1237+
fi
1238+
done
1239+
popd > /dev/null
1240+
else
1241+
echo "'/usr/share/sonic/device/${platform}' does not exist" > /tmp/error
1242+
save_file /tmp/error sai false
1243+
fi
1244+
1245+
save_cmd "show platform versions" "platform.versions"
1246+
}
1247+
12181248
###############################################################################
12191249
# Save log file
12201250
# Globals:
@@ -1537,6 +1567,10 @@ main() {
15371567
collect_broadcom
15381568
fi
15391569

1570+
if [ "$asic" = "cisco-8000" ]; then
1571+
collect_cisco_8000
1572+
fi
1573+
15401574
# 2nd counter snapshot late. Need 2 snapshots to make sense of counters trend.
15411575
save_counter_snapshot $asic 2
15421576

0 commit comments

Comments
 (0)