Skip to content

Commit

Permalink
Made the Debug Dump Execution optional
Browse files Browse the repository at this point in the history
Signed-off-by: Vivek Reddy Karri <vkarri@nvidia.com>
  • Loading branch information
vivekrnv committed Aug 21, 2021
1 parent 89ebe06 commit 9c8b137
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
13 changes: 12 additions & 1 deletion scripts/generate_dump
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ HOME=${HOME:-/root}
USER=${USER:-root}
TIMEOUT_MIN="5"
SKIP_BCMCMD=0
DEBUG_DUMP=false

handle_signal()
{
Expand Down Expand Up @@ -1019,6 +1020,11 @@ save_counter_snapshot() {
# save the debug dump output
###############################################################################
save_dump_state_all_ns() {
if ! $DEBUG_DUMP
then
return 0
fi

MODULES="$(dump state -s | sed '1d;2d' | awk '{print $1}')"
local UVDUMP="unified_view_dump"
echo "DEBUG DUMP: Modules Available to Generate Debug Dump Output"
Expand Down Expand Up @@ -1288,11 +1294,13 @@ OPTIONS
"24 March", "yesterday", etc.
-t TIMEOUT_MINS
Command level timeout in minutes
-d
Collect the output of debug dump cli
EOF
}

while getopts ":xnvhzas:t:" opt; do
while getopts ":xnvhzas:t:d" opt; do
case $opt in
x)
# enable bash debugging
Expand Down Expand Up @@ -1334,6 +1342,9 @@ while getopts ":xnvhzas:t:" opt; do
t)
TIMEOUT_MIN="${OPTARG}"
;;
d)
DEBUG_DUMP=true
;;
/?)
echo "Invalid option: -$OPTARG" >&2
exit 1
Expand Down
7 changes: 6 additions & 1 deletion show/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,8 @@ def users(verbose):
@click.option('--verbose', is_flag=True, help="Enable verbose output")
@click.option('--allow-process-stop', is_flag=True, help="Dump additional data which may require system interruption")
@click.option('--silent', is_flag=True, help="Run techsupport in silent mode")
def techsupport(since, global_timeout, cmd_timeout, verbose, allow_process_stop, silent):
@click.option('--debug-dump', is_flag=True, help="Collect Debug Dump Output")
def techsupport(since, global_timeout, cmd_timeout, verbose, allow_process_stop, silent, debug_dump):
"""Gather information for troubleshooting"""
cmd = "sudo timeout -s SIGTERM --foreground {}m".format(global_timeout)

Expand All @@ -1031,6 +1032,10 @@ def techsupport(since, global_timeout, cmd_timeout, verbose, allow_process_stop,

if since:
cmd += " -s '{}'".format(since)

if debug_dump:
cmd += " -d "

cmd += " -t {}".format(cmd_timeout)
run_command(cmd, display_cmd=verbose)

Expand Down

0 comments on commit 9c8b137

Please sign in to comment.