1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
15 #include <rte_debug.h>
16 #include <rte_common.h>
18 #define BACKTRACE_SIZE 256
20 /* dump the stack of the calling core */
21 void rte_dump_stack(void)
24 void *func[BACKTRACE_SIZE];
28 size = backtrace(func, BACKTRACE_SIZE);
29 symb = backtrace_symbols(func, size);
35 rte_log(RTE_LOG_ERR, RTE_LOGTYPE_EAL,
36 "%d: [%s]\n", size, symb[size - 1]);
41 #endif /* RTE_BACKTRACE */
44 /* not implemented in this environment */
45 void rte_dump_registers(void)
50 /* call abort(), it will generate a coredump if enabled */
51 void __rte_panic(const char *funcname, const char *format, ...)
55 rte_log(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, "PANIC in %s():\n", funcname);
57 rte_vlog(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, format, ap);
65 * Like rte_panic this terminates the application. However, no traceback is
66 * provided and no core-dump is generated.
69 rte_exit(int exit_code, const char *format, ...)
74 RTE_LOG(CRIT, EAL, "Error - exiting with code: %d\n"
75 " Cause: ", exit_code);
78 rte_vlog(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, format, ap);
81 #ifndef RTE_EAL_ALWAYS_PANIC_ON_ERROR