X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Ftest_debug.c;h=23b24db177394919cd2e52f2d566317e001c9688;hb=88caad251c8de3a84e353b0b2a27014bc303df87;hp=faf2cf5573b980ddc1e6e1360639d7a7489a3ad8;hpb=a9de470cc7c0649221e156fc5f30a2dbdfe7c166;p=dpdk.git diff --git a/app/test/test_debug.c b/app/test/test_debug.c index faf2cf5573..23b24db177 100644 --- a/app/test/test_debug.c +++ b/app/test/test_debug.c @@ -4,6 +4,8 @@ #include #include +#include +#include #include #include @@ -28,9 +30,14 @@ test_panic(void) pid = fork(); - if (pid == 0) + if (pid == 0) { + struct rlimit rl; + + /* No need to generate a coredump when panicking. */ + rl.rlim_cur = rl.rlim_max = 0; + setrlimit(RLIMIT_CORE, &rl); rte_panic("Test Debug\n"); - else if (pid < 0){ + } else if (pid < 0) { printf("Fork Failed\n"); return -1; } @@ -66,13 +73,11 @@ test_exit_val(int exit_val) } wait(&status); printf("Child process status: %d\n", status); -#ifndef RTE_EAL_ALWAYS_PANIC_ON_ERROR if(!WIFEXITED(status) || WEXITSTATUS(status) != (uint8_t)exit_val){ printf("Child process terminated with incorrect status (expected = %d)!\n", exit_val); return -1; } -#endif return 0; } @@ -81,7 +86,7 @@ test_exit(void) { int test_vals[] = { 0, 1, 2, 255, -1 }; unsigned i; - for (i = 0; i < sizeof(test_vals) / sizeof(test_vals[0]); i++){ + for (i = 0; i < RTE_DIM(test_vals); i++) { if (test_exit_val(test_vals[i]) < 0) return -1; } @@ -113,7 +118,6 @@ static int test_debug(void) { rte_dump_stack(); - rte_dump_registers(); if (test_panic() < 0) return -1; if (test_exit() < 0)