Skip to content

Commit 160d1b5

Browse files
authored
[nvidia bmc] add nvidia dump to the generate_dump utility (#383)
#### What I did Extended generate_dump / show techsupport on the Nvidia BMC (aspeed) platform with hw-management dump. #### How I did it Added `collect_nvidia_bmc_dump()` in `scripts/generate_dump` #### How to verify it Run `show techsupport` on Nvidia BMC platform and check the techsupport. Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com> #### Previous command output (if the output of a command-line utility has changed) #### New command output (if the output of a command-line utility has changed)
1 parent 8058eec commit 160d1b5

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

scripts/generate_dump

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2126,6 +2126,44 @@ collect_nvidia_bluefield() {
21262126
save_cmd "get_component_versions.py" "component_versions"
21272127
}
21282128

2129+
###############################################################################
2130+
# Collect NVIDIA BMC hw-management dump.
2131+
# hw-management-bmc-generate-dump.sh writes artifacts under /tmp/hw-mgmt-bmc-dump*
2132+
# (e.g. /tmp/hw-mgmt-bmc-dump.tar.gz).
2133+
# Globals:
2134+
# CMD_PREFIX
2135+
# TIMEOUT_MIN
2136+
# TIMEOUT_EXIT_CODE
2137+
# ALLOW_PROCESS_STOP
2138+
# Arguments:
2139+
# None
2140+
# Returns:
2141+
# None
2142+
###############################################################################
2143+
collect_nvidia_bmc_dump() {
2144+
trap 'handle_error $? $LINENO' ERR
2145+
local timeout_cmd="timeout --foreground ${TIMEOUT_MIN}m"
2146+
local HW_BMC_DUMP_FILE=/usr/bin/hw-management-bmc-generate-dump.sh
2147+
2148+
if [ ! -f "$HW_BMC_DUMP_FILE" ]; then
2149+
echo "HW Mgmt BMC dump script $HW_BMC_DUMP_FILE does not exist"
2150+
return 0
2151+
fi
2152+
2153+
${CMD_PREFIX}${timeout_cmd} "$HW_BMC_DUMP_FILE" $ALLOW_PROCESS_STOP
2154+
local ret=$?
2155+
if [ $ret -ne 0 ]; then
2156+
if [ $ret -eq $TIMEOUT_EXIT_CODE ]; then
2157+
echo "hw-management-bmc dump timedout after ${TIMEOUT_MIN} minutes."
2158+
else
2159+
echo "hw-management-bmc dump failed ..."
2160+
fi
2161+
else
2162+
save_file "/tmp/hw-mgmt-bmc-dump*" "hw-mgmt-bmc" false
2163+
rm -f /tmp/hw-mgmt-bmc-dump*
2164+
fi
2165+
}
2166+
21292167
###############################################################################
21302168
# Collect Pensando specific information
21312169
# Globals:
@@ -2645,6 +2683,7 @@ main() {
26452683

26462684
local asic="$(/usr/local/bin/sonic-cfggen -y /etc/sonic/sonic_version.yml -v asic_type)"
26472685
local device_type=`sonic-db-cli CONFIG_DB hget 'DEVICE_METADATA|localhost' type`
2686+
local platform=$(python3 -c "from sonic_py_common import device_info; print(device_info.get_platform())")
26482687
# 1st counter snapshot early. Need 2 snapshots to make sense of counters trend.
26492688
save_counter_snapshot $asic 1
26502689

@@ -2789,6 +2828,10 @@ main() {
27892828
collect_pensando
27902829
fi
27912830

2831+
if [[ "$asic" = "aspeed" && "$platform" == *"nvidia"* ]]; then
2832+
collect_nvidia_bmc_dump
2833+
fi
2834+
27922835
start_dpu_flow_dump &
27932836

27942837
# 2nd counter snapshot late. Need 2 snapshots to make sense of counters trend.

0 commit comments

Comments
 (0)