Skip to content

Commit abd5eba

Browse files
authored
[generate_dump]: Enhance show techsupport for cisco-8000 platform (sonic-net#2403)
Signed-off-by: Geert Vlaemynck <[email protected]> Signed-off-by: Geert Vlaemynck <[email protected]>
1 parent ee15b74 commit abd5eba

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

scripts/generate_dump

+30
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,32 @@ collect_barefoot() {
10871087
done
10881088
}
10891089

1090+
###############################################################################
1091+
# Collect Cisco-8000 specific information
1092+
# Globals:
1093+
# None
1094+
# Arguments:
1095+
# None
1096+
# Returns:
1097+
# None
1098+
###############################################################################
1099+
collect_cisco_8000() {
1100+
trap 'handle_error $? $LINENO' ERR
1101+
local platform=$(show platform summary --json | python -c 'import sys, json; \
1102+
print(json.load(sys.stdin)["platform"])')
1103+
1104+
if [ -d /usr/share/sonic/device/${platform} ]; then
1105+
pushd /usr/share/sonic/device/${platform} > /dev/null
1106+
for file in $(find . -path "./*plugin*" -prune -o -path "./*.xml" -prune -o -path "./*.yaml" -prune -o -print); do
1107+
save_file ${file} sai false
1108+
done
1109+
popd > /dev/null
1110+
else
1111+
echo "'/usr/share/sonic/device/${platform}' does not exist" > /tmp/error
1112+
save_file /tmp/error sai false
1113+
fi
1114+
}
1115+
10901116
###############################################################################
10911117
# Save log file
10921118
# Globals:
@@ -1412,6 +1438,10 @@ main() {
14121438
collect_broadcom
14131439
fi
14141440

1441+
if [ "$asic" = "cisco-8000" ]; then
1442+
collect_cisco_8000
1443+
fi
1444+
14151445
# 2nd counter snapshot late. Need 2 snapshots to make sense of counters trend.
14161446
save_counter_snapshot $asic 2
14171447

0 commit comments

Comments
 (0)