1 /* SPDX-License-Identifier: BSD-3-Clause 2 * 3 * Copyright 2017 NXP 4 * 5 */ 6 7 #ifndef _DPAA_LOGS_H_ 8 #define _DPAA_LOGS_H_ 9 10 #include <rte_log.h> 11 12 extern int dpaa_logtype_bus; 13 #define RTE_LOGTYPE_DPAA_BUS dpaa_logtype_bus 14 15 #define DPAA_BUS_LOG(level, ...) \ 16 RTE_LOG_LINE(level, DPAA_BUS, __VA_ARGS__) 17 18 #ifdef RTE_LIBRTE_DPAA_DEBUG_BUS 19 #define DPAA_BUS_HWWARN(cond, fmt, ...) \ 20 do {\ 21 if (cond) \ 22 DPAA_BUS_LOG(DEBUG, "WARN: " fmt, ##__VA_ARGS__); \ 23 } while (0) 24 #else 25 #define DPAA_BUS_HWWARN(cond, fmt, ...) do { } while (0) 26 #endif 27 28 #define DPAA_BUS_DEBUG(...) \ 29 RTE_LOG_LINE_PREFIX(DEBUG, DPAA_BUS, "%s(): ", __func__, __VA_ARGS__) 30 31 #define BUS_INIT_FUNC_TRACE() DPAA_BUS_DEBUG(" >>") 32 33 #define DPAA_BUS_INFO(fmt, ...) \ 34 DPAA_BUS_LOG(INFO, fmt, ## __VA_ARGS__) 35 #define DPAA_BUS_ERR(fmt, ...) \ 36 DPAA_BUS_LOG(ERR, fmt, ## __VA_ARGS__) 37 #define DPAA_BUS_WARN(fmt, ...) \ 38 DPAA_BUS_LOG(WARNING, fmt, ## __VA_ARGS__) 39 40 #endif /* _DPAA_LOGS_H_ */ 41