Skip to content

Commit

Permalink
[generate_dump]: Enhance show techsupport for cisco-8000 platform (#2403
Browse files Browse the repository at this point in the history
)

Signed-off-by: Geert Vlaemynck <gvlaemyn@cisco.com>

Signed-off-by: Geert Vlaemynck <gvlaemyn@cisco.com>
  • Loading branch information
gvlaemyn authored Oct 13, 2022
1 parent ee15b74 commit abd5eba
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 @@ -1087,6 +1087,32 @@ collect_barefoot() {
done
}

###############################################################################
# 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 @@ -1412,6 +1438,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 abd5eba

Please sign in to comment.