xref: /dpdk/drivers/crypto/caam_jr/caam_jr_log.h (revision e9fd1ebf981f361844aea9ec94e17f4bda5e1479)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2017-2018 NXP
3  */
4 
5 #ifndef _CAAM_JR_LOG_H_
6 #define _CAAM_JR_LOG_H_
7 
8 #include <rte_log.h>
9 
10 extern int caam_jr_logtype;
11 #define RTE_LOGTYPE_CAAM_JR caam_jr_logtype
12 
13 #define CAAM_JR_LOG(level, fmt, args...) \
14 	rte_log(RTE_LOG_ ## level, caam_jr_logtype, "caam_jr: " \
15 		fmt "\n", ##args)
16 
17 #define CAAM_JR_DEBUG(fmt, args...) \
18 	rte_log(RTE_LOG_DEBUG, caam_jr_logtype, "caam_jr: %s(): " \
19 		fmt "\n", __func__, ##args)
20 
21 #define PMD_INIT_FUNC_TRACE() CAAM_JR_DEBUG(" >>")
22 
23 #define CAAM_JR_INFO(fmt, args...) \
24 	CAAM_JR_LOG(INFO, fmt, ## args)
25 #define CAAM_JR_ERR(fmt, args...) \
26 	CAAM_JR_LOG(ERR, fmt, ## args)
27 #define CAAM_JR_WARN(fmt, args...) \
28 	CAAM_JR_LOG(WARNING, fmt, ## args)
29 
30 /* DP Logs, toggled out at compile time if level lower than current level */
31 #define CAAM_JR_DP_LOG(level, fmt, args...) \
32 	RTE_LOG_DP(level, CAAM_JR, fmt "\n", ## args)
33 
34 #define CAAM_JR_DP_DEBUG(fmt, args...) \
35 	CAAM_JR_DP_LOG(DEBUG, fmt, ## args)
36 #define CAAM_JR_DP_INFO(fmt, args...) \
37 	CAAM_JR_DP_LOG(INFO, fmt, ## args)
38 #define CAAM_JR_DP_WARN(fmt, args...) \
39 	CAAM_JR_DP_LOG(WARNING, fmt, ## args)
40 #define CAAM_JR_DP_ERR(fmt, args...) \
41 	CAAM_JR_DP_LOG(ERR, fmt, ## args)
42 
43 #endif /* _CAAM_JR_LOG_H_ */
44