summaryrefslogtreecommitdiffstats
path: root/src/plugins/memif/private.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/memif/private.h')
-rw-r--r--src/plugins/memif/private.h28
1 files changed, 8 insertions, 20 deletions
diff --git a/src/plugins/memif/private.h b/src/plugins/memif/private.h
index 5c8a919061a..c7fec67f9e4 100644
--- a/src/plugins/memif/private.h
+++ b/src/plugins/memif/private.h
@@ -16,6 +16,7 @@
*/
#include <vppinfra/lock.h>
+#include <vlib/log.h>
#define MEMIF_DEFAULT_SOCKET_FILENAME "memif.sock"
#define MEMIF_DEFAULT_RING_SIZE 1024
@@ -28,39 +29,24 @@
#define MEMIF_MAX_REGION 255
#define MEMIF_MAX_LOG2_RING_SIZE 14
-#define MEMIF_DEBUG 0
-#if MEMIF_DEBUG == 1
-#define DBG(...) clib_warning(__VA_ARGS__)
-#define DBG_UNIX_LOG(...) clib_unix_warning(__VA_ARGS__)
-#else
-#define DBG(...)
-#define DBG_UNIX_LOG(...)
-#endif
-
-#if MEMIF_DEBUG == 1
#define memif_file_add(a, b) do { \
*a = clib_file_add (&file_main, b); \
- clib_warning ("clib_file_add fd %d private_data %u idx %u", \
+ vlib_log_warn ((&memif_main)->log_class, \
+ "clib_file_add fd %d private_data %u idx %u", \
(b)->file_descriptor, (b)->private_data, *a); \
} while (0)
#define memif_file_del(a) do { \
- clib_warning ("clib_file_del idx %u",a - file_main.file_pool); \
+ vlib_log_warn ((&memif_main)->log_class, \
+ "clib_file_del idx %u",a - file_main.file_pool); \
clib_file_del (&file_main, a); \
} while (0)
#define memif_file_del_by_index(a) do { \
- clib_warning ("clib_file_del idx %u", a); \
+ vlib_log_warn ((&memif_main)->log_class, "clib_file_del idx %u", a); \
clib_file_del_by_index (&file_main, a); \
} while (0)
-#else
-#define memif_file_add(a, b) do { \
- *a = clib_file_add (&file_main, b); \
-} while (0)
-#define memif_file_del(a) clib_file_del(&file_main, a)
-#define memif_file_del_by_index(a) clib_file_del_by_index(&file_main, a)
-#endif
typedef struct
{
@@ -227,6 +213,8 @@ typedef struct
/* per thread data */
memif_per_thread_data_t *per_thread_data;
+ vlib_log_class_t log_class;
+
} memif_main_t;
extern memif_main_t memif_main;