[06/27] event/dlb: add dynamic logging

Message ID 20200612212434.6852-7-timothy.mcdaniel@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers
Series V1 event/dlb add Intel DLB PMD |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation fail Compilation issues

Commit Message

Timothy McDaniel June 12, 2020, 9:24 p.m. UTC
  Change-Id: I7698d9b8eea2e681ea6ff237d1f93b0ece7f4704
Signed-off-by: McDaniel, Timothy <timothy.mcdaniel@intel.com>
---
 drivers/event/dlb/dlb_log.h | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 drivers/event/dlb/dlb_log.h
  

Patch

diff --git a/drivers/event/dlb/dlb_log.h b/drivers/event/dlb/dlb_log.h
new file mode 100644
index 000000000..b8f4ba5cf
--- /dev/null
+++ b/drivers/event/dlb/dlb_log.h
@@ -0,0 +1,24 @@ 
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2020 Intel Corporation
+ */
+
+#ifndef _DLB_EVDEV_LOG_H_
+#define _DLB_EVDEV_LOG_H_
+
+extern int eventdev_dlb_log_level;
+
+/* Dynamic logging */
+#define DLB_LOG_IMPL(level, fmt, args...) \
+	rte_log(RTE_LOG_ ## level, eventdev_dlb_log_level, "%s" fmt "\n", \
+                __func__, ##args)
+
+#define DLB_LOG_INFO(fmt, args...) \
+	DLB_LOG_IMPL(INFO, fmt, ## args)
+
+#define DLB_LOG_DBG(fmt, args...) \
+	DLB_LOG_IMPL(DEBUG, fmt, ## args)
+
+#define DLB_LOG_ERR(fmt, args...) \
+	DLB_LOG_IMPL(ERR, fmt, ## args)
+
+#endif /* _DLB_EVDEV_LOG_H_ */