Skip to content

Commit 6dd5d31

Browse files
authored
show tech with platform dump option (sonic-net#1158)
- What I did Add an option to force the hardware register dump with -f for show techsupport --allow-process-stop - How I did it Add an option '--allow-process-stop' to show techsupport cli command and '-a' to generate_dump script - How to verify it Perform show techsupport --allow-process-stop to collect extra hardware registers information which may require system interruption. - Previous command output (if the output of a command-line utility has changed) N/A - New command output (if the output of a command-line utility has changed) N/A
1 parent 6255384 commit 6dd5d31

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

scripts/generate_dump

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ MV=mv
2020
GREP=grep
2121
TOUCH=touch
2222
V=
23+
ALLOW_PROCESS_STOP=
2324
NOOP=false
2425
DO_COMPRESS=true
2526
CMD_PREFIX=
@@ -763,7 +764,7 @@ main() {
763764
# run 'hw-management-generate-dump.sh' script and save the result file
764765
HW_DUMP_FILE=/usr/bin/hw-management-generate-dump.sh
765766
if [ -f "$HW_DUMP_FILE" ]; then
766-
/usr/bin/hw-management-generate-dump.sh
767+
/usr/bin/hw-management-generate-dump.sh $ALLOW_PROCESS_STOP
767768
save_file "/tmp/hw-mgmt-dump*" "hw-mgmt" false
768769
rm -f /tmp/hw-mgmt-dump*
769770
else
@@ -827,6 +828,9 @@ OPTIONS
827828
passed to them
828829
-n
829830
Noop mode. Don't actually create anything, just echo what would happen
831+
-a
832+
Allow any process stop. This allows for collection of platform HW register
833+
status, which may require potential system interruption
830834
-z
831835
Don't compress the tar at the end.
832836
-s DATE
@@ -837,7 +841,7 @@ OPTIONS
837841
EOF
838842
}
839843

840-
while getopts ":xnvhzs:" opt; do
844+
while getopts ":xnvhzsa:" opt; do
841845
case $opt in
842846
x)
843847
# enable bash debugging
@@ -868,6 +872,9 @@ while getopts ":xnvhzs:" opt; do
868872
z)
869873
DO_COMPRESS=false
870874
;;
875+
a)
876+
ALLOW_PROCESS_STOP="-a"
877+
;;
871878
s)
872879
SINCE_DATE="${OPTARG}"
873880
# validate date expression

show/main.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1128,11 +1128,16 @@ def users(verbose):
11281128
@cli.command()
11291129
@click.option('--since', required=False, help="Collect logs and core files since given date")
11301130
@click.option('--verbose', is_flag=True, help="Enable verbose output")
1131-
def techsupport(since, verbose):
1131+
@click.option('--allow-process-stop', is_flag=True, help="Dump additional data which may require system interruption")
1132+
def techsupport(since, verbose, allow_process_stop):
11321133
"""Gather information for troubleshooting"""
11331134
cmd = "sudo generate_dump -v"
1135+
if allow_process_stop:
1136+
cmd += " -a"
1137+
11341138
if since:
11351139
cmd += " -s {}".format(since)
1140+
11361141
run_command(cmd, display_cmd=verbose)
11371142

11381143

0 commit comments

Comments
 (0)