1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
15 #include <rte_debug.h>
16 #include <rte_common.h>
19 #define BACKTRACE_SIZE 256
21 /* dump the stack of the calling core */
22 void rte_dump_stack(void)
25 void *func[BACKTRACE_SIZE];
29 size = backtrace(func, BACKTRACE_SIZE);
30 symb = backtrace_symbols(func, size);
36 rte_log(RTE_LOG_ERR, RTE_LOGTYPE_EAL,
37 "%d: [%s]\n", size, symb[size - 1]);
42 #endif /* RTE_BACKTRACE */
45 /* not implemented in this environment */
46 void rte_dump_registers(void)
51 /* call abort(), it will generate a coredump if enabled */
52 void __rte_panic(const char *funcname, const char *format, ...)
56 rte_log(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, "PANIC in %s():\n", funcname);
58 rte_vlog(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, format, ap);
66 * Like rte_panic this terminates the application. However, no traceback is
67 * provided and no core-dump is generated.
70 rte_exit(int exit_code, const char *format, ...)
75 RTE_LOG(CRIT, EAL, "Error - exiting with code: %d\n"
76 " Cause: ", exit_code);
79 rte_vlog(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, format, ap);
82 #ifndef RTE_EAL_ALWAYS_PANIC_ON_ERROR
83 if (rte_eal_cleanup() != 0)
85 "EAL could not release all resources\n");