Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[show_tech] modify generate_dump to includes BERT data and also the platform specified hw-mgmt info #101

Open
wants to merge 1 commit into
base: 202405
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions scripts/generate_dump
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,42 @@ save_proc() {
chmod ugo+rw -R $DUMPDIR/$BASE/proc
}

###############################################################################
# Given list of sys files, saves sys files to tar.
# Globals:
# V
# TARDIR
# MKDIR
# CP
# DUMPDIR
# TAR
# RM
# BASE
# TARFILE
# NOOP
# Arguments:
# *sysfiles: variable-length list of sys file paths to save
# Returns:
# None
###############################################################################
save_sys() {
trap 'handle_error $? $LINENO' ERR
local sysfiles="$@"
$MKDIR $V -p $TARDIR/sys
for f in $sysfiles
do
if $NOOP; then
if [ -e $f ]; then
echo "$CP $V -r $f $TARDIR/sys"
fi
else
( [ -e $f ] && $CP $V -r $f $TARDIR/sys ) || echo "$f not found" > $TARDIR/$f
fi
done

chmod ugo+rw -R $DUMPDIR/$BASE/sys
}

###############################################################################
# Dump io stats for processes
# Globals:
Expand Down Expand Up @@ -1442,6 +1478,7 @@ collect_marvell() {
###############################################################################
collect_broadcom() {
trap 'handle_error $? $LINENO' ERR
local timeout_cmd="timeout --foreground ${TIMEOUT_MIN}m"
local platform=$(show platform summary --json | python -c 'import sys, json; \
print(json.load(sys.stdin)["platform"])')
local hwsku=$(show platform summary --json | python -c 'import sys, json; \
Expand Down Expand Up @@ -1570,6 +1607,25 @@ collect_broadcom() {

copy_from_masic_docker "syncd" "/var/log/diagrun.log" "/var/log/diagrun.log"
copy_from_masic_docker "syncd" "/var/log/bcm_diag_post" "/var/log/bcm_diag_post"

# run 'hw-management-generate-dump.sh' script and save the result file
HW_DUMP_FILE=/usr/bin/hw-management-generate-dump.sh
if [ -f "$HW_DUMP_FILE" ]; then
${CMD_PREFIX}${timeout_cmd} /usr/bin/hw-management-generate-dump.sh $ALLOW_PROCESS_STOP
ret=$?
if [ $ret -ne 0 ]; then
if [ $ret -eq $TIMEOUT_EXIT_CODE ]; then
echo "hw-management dump timedout after ${TIMEOUT_MIN} minutes."
else
echo "hw-management dump failed ..."
fi
else
save_file "/tmp/hw-mgmt-dump*" "hw-mgmt" false
rm -f /tmp/hw-mgmt-dump*
fi
else
echo "HW Mgmt dump script $HW_DUMP_FILE does not exist"
fi
}

###############################################################################
Expand Down Expand Up @@ -1739,6 +1795,12 @@ save_log_files() {
file_list="${file_list} ${file_list_2}"
fi

# save log files creation info
files_ts_info=/tmp/files.timestamp.info
ls --time-style='+%d-%m-%Y %H:%M:%S' -last /var/log/* > $files_ts_info
save_file $files_ts_info "log" true
rm -f $files_ts_info

# gzip up all log files individually before placing them in the incremental tarball
for file in $file_list; do
dest_dir="log"
Expand Down Expand Up @@ -2005,6 +2067,12 @@ main() {
echo "[ Capture Proc State ] : $(($end_t-$start_t)) msec" >> $TECHSUPPORT_TIME_INFO
wait

# capture /sys info - include acpi info
save_sys /sys/firmware/acpi/tables &
end_t2=$(date +%s%3N)
echo "[ Capture Sys info ] : $(($end_t2-$end_t)) msec" >> $TECHSUPPORT_TIME_INFO
wait

# Save all the processes within each docker
save_cmd "show services" services.summary &

Expand Down
Loading