1
2
3
4
5#ifndef _IONIC_LOGS_H_
6#define _IONIC_LOGS_H_
7
8#include <rte_log.h>
9
10extern int ionic_logtype;
11
12#define IONIC_PRINT(level, fmt, args...) rte_log(RTE_LOG_ ## level, \
13 ionic_logtype, "%s(): " fmt "\n", __func__, ##args)
14
15#define IONIC_PRINT_CALL() IONIC_PRINT(DEBUG, " >>")
16
17#ifndef IONIC_WARN_ON
18#define IONIC_WARN_ON(x) do { \
19 int ret = !!(x); \
20 if (unlikely(ret)) \
21 IONIC_PRINT(WARNING, "WARN_ON: \"" #x "\" at %s:%d\n", \
22 __func__, __LINE__); \
23} while (0)
24#endif
25
26#endif
27