net/sfc: rename array of SW stats descriptions
[dpdk.git] / app / test / test_debug.c
index 25eab97..23b24db 100644 (file)
@@ -4,6 +4,8 @@
 
 #include <stdio.h>
 #include <stdint.h>
+#include <sys/resource.h>
+#include <sys/time.h>
 #include <sys/wait.h>
 #include <unistd.h>
 
@@ -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;
 }
 
@@ -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)