gpu: nvgpu: unit: enable signal handler in single thread

Until now, using single thread we disable the signal handler to
make it easier to debug crashes. Since we are now using single
threading in GVS, it is better to have the signal handler enabled
by default. This patch introduces a "-d" argument to explicitly
disable the signal handler and thus make local debugging easier.

JIRA NVGPU-2975

Change-Id: I35b0fb71990b3fef575242c1bba398a3b0e6facf
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2223662
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Nicolas Benech
2019-10-22 18:04:14 -04:00
committed by Alex Waterman
parent d22fc21a5c
commit 4523ee2b14
3 changed files with 12 additions and 6 deletions

View File

@@ -36,15 +36,14 @@ static struct option core_opts[] = {
{ "no-color", 0, NULL, 'C' },
{ "nvtest", 0, NULL, 'n' },
{ "is-qnx", 0, NULL, 'Q' },
{ "unit-load-path", 1, NULL, 'L' },
{ "num-threads", 1, NULL, 'j' },
{ "test-level", 1, NULL, 't' },
{ "debug", 0, NULL, 'd' },
{ NULL, 0, NULL, 0 }
};
static const char *core_opts_str = "hvqCnQL:j:t:";
static const char *core_opts_str = "hvqCnQL:j:t:d";
void core_print_help(struct unit_fw *fw)
{
@@ -73,6 +72,8 @@ void core_print_help(struct unit_fw *fw)
" Number of threads to use while running all tests.\n",
" -t, --test-level <LEVEL>\n",
" Test plan level. 0=L0, 1=L1. default: 1\n",
" -d, --debug Disable signal handling to facilitate debug of",
" crashes.\n",
"\n",
"Note: mandatory arguments to long arguments are mandatory for short\n",
"arguments as well.\n",
@@ -162,6 +163,9 @@ int core_parse_args(struct unit_fw *fw, int argc, char **argv)
return -1;
}
break;
case 'd':
args->debug = true;
break;
case '?':
args->help = true;
return -1;