aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/mfib/mfib_entry.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2018-09-24 12:36:26 +0000
committerDamjan Marion <dmarion@me.com>2018-10-16 12:22:49 +0000
commit710071bf0ed7a0926581d1f738a142b72e795d2b (patch)
tree6e3b8e7bc07b3e48ed4041ffe657ba1e4da058f1 /src/vnet/mfib/mfib_entry.c
parenta5ab5034f4b50fc5a19ccf8910c91613e6a52f5a (diff)
FIB: use vlib-log for debugging
Change-Id: I9052202b8cbcf656e61d635253d515f0f3a8d145 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/mfib/mfib_entry.c')
-rw-r--r--src/vnet/mfib/mfib_entry.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/src/vnet/mfib/mfib_entry.c b/src/vnet/mfib/mfib_entry.c
index 7427334fa17..a8d2f89cd55 100644
--- a/src/vnet/mfib/mfib_entry.c
+++ b/src/vnet/mfib/mfib_entry.c
@@ -22,31 +22,22 @@
#include <vnet/dpo/replicate_dpo.h>
/**
+ * the logger
+ */
+vlib_log_class_t mfib_entry_logger;
+
+/**
* Debug macro
*/
-#ifdef MFIB_DEBUG
-#DEFIne MFIB_ENTRY_DBG(_e, _fmt, _args...) \
+#define MFIB_ENTRY_DBG(_e, _fmt, _args...) \
{ \
- u8*__tmp = NULL; \
- __tmp = format(__tmp, "e:[%d:%U", \
- mfib_entry_get_index(_e), \
- format_ip46_address, \
- &_e->mfe_prefix.fp_grp_addr, \
- IP46_TYPE_ANY); \
- __tmp = format(__tmp, "/%d,", \
- _e->mfe_prefix.fp_len); \
- __tmp = format(__tmp, "%U]", \
+ vlib_log_debug(mfib_entry_logger, \
+ "e:[%d:%U]: " _fmt, \
mfib_entry_get_index(_e), \
- format_ip46_address, \
- &_e->mfe_prefix.fp_src_addr, \
- IP46_TYPE_ANY); \
- __tmp = format(__tmp, _fmt, ##_args); \
- clib_warning("%s", __tmp); \
- vec_free(__tmp); \
+ format_mfib_prefix, \
+ &_e->mfe_prefix, \
+ ##_args); \
}
-#else
-#define MFIB_ENTRY_DBG(_e, _fmt, _args...)
-#endif
/**
* MFIB extensions to each path
@@ -1207,6 +1198,7 @@ mfib_entry_module_init (void)
{
fib_node_register_type (FIB_NODE_TYPE_MFIB_ENTRY, &mfib_entry_vft);
dpo_register(DPO_MFIB_ENTRY, &mfib_entry_dpo_vft, mfib_entry_nodes);
+ mfib_entry_logger = vlib_log_register_class("mfib", "entry");
}
void