[v2,02/22] event/dlb2: add dynamic logging

Message ID 1602958879-8558-3-git-send-email-timothy.mcdaniel@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers
Series Add DLB2 PMD |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Timothy McDaniel Oct. 17, 2020, 6:20 p.m. UTC
  This commit adds base support for dynamic logging.
The default log level is NOTICE. Dynamic logging
is used exclusively throughout this patchset.

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
Reviewed-by: Gage Eads <gage.eads@intel.com>
---
 drivers/event/dlb2/dlb2_log.h | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 drivers/event/dlb2/dlb2_log.h
  

Comments

Jerin Jacob Oct. 18, 2020, 8:57 a.m. UTC | #1
On Sat, Oct 17, 2020 at 11:50 PM Timothy McDaniel
<timothy.mcdaniel@intel.com> wrote:
>
> This commit adds base support for dynamic logging.
> The default log level is NOTICE. Dynamic logging
> is used exclusively throughout this patchset.
>
> Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
> Reviewed-by: Gage Eads <gage.eads@intel.com>
> ---
>  drivers/event/dlb2/dlb2_log.h | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
>  create mode 100644 drivers/event/dlb2/dlb2_log.h
>
> diff --git a/drivers/event/dlb2/dlb2_log.h b/drivers/event/dlb2/dlb2_log.h
> new file mode 100644
> index 0000000..dc1481e
> --- /dev/null
> +++ b/drivers/event/dlb2/dlb2_log.h
> @@ -0,0 +1,25 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright(c) 2016-2020 Intel Corporation
> + */
> +
> +#ifndef _DLB2_EVDEV_LOG_H_
> +#define _DLB2_EVDEV_LOG_H_
> +
> +extern int eventdev_dlb2_log_level;

Move rte_log_register() calling part to this patch. Without
registration this patch
is incomplete.


> +/* Dynamic logging */
> +#define DLB2_LOG_IMPL(level, fmt, args...) \
> +       rte_log(RTE_LOG_ ## level, eventdev_dlb2_log_level, "%s" fmt "\n", \
> +               __func__, ##args)
> +
> +#define DLB2_LOG_INFO(fmt, args...) \
> +       DLB2_LOG_IMPL(INFO, fmt, ## args)
> +
> +#define DLB2_LOG_ERR(fmt, args...) \
> +       DLB2_LOG_IMPL(ERR, fmt, ## args)
> +
> +/* remove debug logs at compile time unless actually debugging */
> +#define DLB2_LOG_DBG(fmt, args...) \
> +       RTE_LOG_DP(DEBUG, PMD, fmt, ## args)
> +
> +#endif /* _DLB2_EVDEV_LOG_H_ */
> --
> 2.6.4
>
  
Timothy McDaniel Oct. 20, 2020, 2:08 p.m. UTC | #2
> -----Original Message-----
> From: Jerin Jacob <jerinjacobk@gmail.com>
> Sent: Sunday, October 18, 2020 3:57 AM
> To: McDaniel, Timothy <timothy.mcdaniel@intel.com>
> Cc: dpdk-dev <dev@dpdk.org>; Carrillo, Erik G <Erik.G.Carrillo@intel.com>;
> Eads, Gage <gage.eads@intel.com>; Van Haaren, Harry
> <harry.van.haaren@intel.com>; Jerin Jacob <jerinj@marvell.com>
> Subject: Re: [dpdk-dev] [PATCH v2 02/22] event/dlb2: add dynamic logging
> 
> On Sat, Oct 17, 2020 at 11:50 PM Timothy McDaniel
> <timothy.mcdaniel@intel.com> wrote:
> >
> > This commit adds base support for dynamic logging.
> > The default log level is NOTICE. Dynamic logging
> > is used exclusively throughout this patchset.
> >
> > Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
> > Reviewed-by: Gage Eads <gage.eads@intel.com>
> > ---
> >  drivers/event/dlb2/dlb2_log.h | 25 +++++++++++++++++++++++++
> >  1 file changed, 25 insertions(+)
> >  create mode 100644 drivers/event/dlb2/dlb2_log.h
> >
> > diff --git a/drivers/event/dlb2/dlb2_log.h b/drivers/event/dlb2/dlb2_log.h
> > new file mode 100644
> > index 0000000..dc1481e
> > --- /dev/null
> > +++ b/drivers/event/dlb2/dlb2_log.h
> > @@ -0,0 +1,25 @@
> > +/* SPDX-License-Identifier: BSD-3-Clause
> > + * Copyright(c) 2016-2020 Intel Corporation
> > + */
> > +
> > +#ifndef _DLB2_EVDEV_LOG_H_
> > +#define _DLB2_EVDEV_LOG_H_
> > +
> > +extern int eventdev_dlb2_log_level;
> 
> Move rte_log_register() calling part to this patch. Without
> registration this patch
> is incomplete.
> 

will do
  

Patch

diff --git a/drivers/event/dlb2/dlb2_log.h b/drivers/event/dlb2/dlb2_log.h
new file mode 100644
index 0000000..dc1481e
--- /dev/null
+++ b/drivers/event/dlb2/dlb2_log.h
@@ -0,0 +1,25 @@ 
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2016-2020 Intel Corporation
+ */
+
+#ifndef _DLB2_EVDEV_LOG_H_
+#define _DLB2_EVDEV_LOG_H_
+
+extern int eventdev_dlb2_log_level;
+
+/* Dynamic logging */
+#define DLB2_LOG_IMPL(level, fmt, args...) \
+	rte_log(RTE_LOG_ ## level, eventdev_dlb2_log_level, "%s" fmt "\n", \
+		__func__, ##args)
+
+#define DLB2_LOG_INFO(fmt, args...) \
+	DLB2_LOG_IMPL(INFO, fmt, ## args)
+
+#define DLB2_LOG_ERR(fmt, args...) \
+	DLB2_LOG_IMPL(ERR, fmt, ## args)
+
+/* remove debug logs at compile time unless actually debugging */
+#define DLB2_LOG_DBG(fmt, args...) \
+	RTE_LOG_DP(DEBUG, PMD, fmt, ## args)
+
+#endif /* _DLB2_EVDEV_LOG_H_ */