diff --git a/scripts/generate_dump b/scripts/generate_dump index edbd638e16..07a43f0e22 100755 --- a/scripts/generate_dump +++ b/scripts/generate_dump @@ -20,6 +20,7 @@ MV=mv GREP=grep TOUCH=touch V= +ALLOW_PROCESS_STOP= NOOP=false DO_COMPRESS=true CMD_PREFIX= @@ -763,7 +764,7 @@ main() { # 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 - /usr/bin/hw-management-generate-dump.sh + /usr/bin/hw-management-generate-dump.sh $ALLOW_PROCESS_STOP save_file "/tmp/hw-mgmt-dump*" "hw-mgmt" false rm -f /tmp/hw-mgmt-dump* else @@ -827,6 +828,9 @@ OPTIONS passed to them -n Noop mode. Don't actually create anything, just echo what would happen + -a + Allow any process stop. This allows for collection of platform HW register + status, which may require potential system interruption -z Don't compress the tar at the end. -s DATE @@ -837,7 +841,7 @@ OPTIONS EOF } -while getopts ":xnvhzs:" opt; do +while getopts ":xnvhzsa:" opt; do case $opt in x) # enable bash debugging @@ -868,6 +872,9 @@ while getopts ":xnvhzs:" opt; do z) DO_COMPRESS=false ;; + a) + ALLOW_PROCESS_STOP="-a" + ;; s) SINCE_DATE="${OPTARG}" # validate date expression diff --git a/show/main.py b/show/main.py index 087a67958b..220d4daaa0 100755 --- a/show/main.py +++ b/show/main.py @@ -1128,11 +1128,16 @@ def users(verbose): @cli.command() @click.option('--since', required=False, help="Collect logs and core files since given date") @click.option('--verbose', is_flag=True, help="Enable verbose output") -def techsupport(since, verbose): +@click.option('--allow-process-stop', is_flag=True, help="Dump additional data which may require system interruption") +def techsupport(since, verbose, allow_process_stop): """Gather information for troubleshooting""" cmd = "sudo generate_dump -v" + if allow_process_stop: + cmd += " -a" + if since: cmd += " -s {}".format(since) + run_command(cmd, display_cmd=verbose)