[dpdk-dev,3/3] logs: remove log level config option
Checks
Commit Message
Remove RTE_LOG_LEVEL config option, use existing RTE_LOG_DP_LEVEL config
option for controlling datapath log level.
RTE_LOG_LEVEL is no longer needed as dynamic logging can be used to
control global and module specific log levels.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
config/common_base | 1 -
devtools/test-build.sh | 2 +-
doc/guides/faq/faq.rst | 3 ---
drivers/net/ena/base/ena_plat_dpdk.h | 2 +-
drivers/net/sfc/sfc_debug.h | 2 +-
examples/l3fwd-acl/main.c | 2 +-
test/test/test.h | 2 +-
7 files changed, 5 insertions(+), 9 deletions(-)
Comments
On Wed, Nov 22, 2017 at 02:58:06PM +0530, Pavan Nikhilesh wrote:
> Remove RTE_LOG_LEVEL config option, use existing RTE_LOG_DP_LEVEL config
> option for controlling datapath log level.
> RTE_LOG_LEVEL is no longer needed as dynamic logging can be used to
> control global and module specific log levels.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Tome, removing the RTE_LOG_LEVEL goes in the good direction (less
compile-time options).
[...]
> --- a/drivers/net/ena/base/ena_plat_dpdk.h
> +++ b/drivers/net/ena/base/ena_plat_dpdk.h
> @@ -96,7 +96,7 @@ typedef uint64_t dma_addr_t;
> #define ENA_GET_SYSTEM_USECS() \
> (rte_get_timer_cycles() * US_PER_S / rte_get_timer_hz())
>
> -#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG
> +#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
> #define ENA_ASSERT(cond, format, arg...) \
> do { \
> if (unlikely(!(cond))) { \
> diff --git a/drivers/net/sfc/sfc_debug.h b/drivers/net/sfc/sfc_debug.h
> index 92eba9c38..3f9ccf1e6 100644
> --- a/drivers/net/sfc/sfc_debug.h
> +++ b/drivers/net/sfc/sfc_debug.h
> @@ -35,7 +35,7 @@
> #include <rte_debug.h>
>
> #ifdef RTE_LIBRTE_SFC_EFX_DEBUG
> -/* Avoid dependency from RTE_LOG_LEVEL to be able to enable debug check
> +/* Avoid dependency from RTE_LOG_DP_LEVEL to be able to enable debug check
> * in the driver only.
> */
> #define SFC_ASSERT(exp) RTE_VERIFY(exp)
> diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
> index e50b1a1a8..eb78decdd 100644
> --- a/examples/l3fwd-acl/main.c
> +++ b/examples/l3fwd-acl/main.c
> @@ -68,7 +68,7 @@
> #include <rte_string_fns.h>
> #include <rte_acl.h>
>
> -#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG
> +#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
> #define L3FWDACL_DEBUG
> #endif
> #define DO_RFC_1812_CHECKS
> diff --git a/test/test/test.h b/test/test/test.h
> index 08ffe949c..8fdb3045e 100644
> --- a/test/test/test.h
> +++ b/test/test/test.h
> @@ -204,7 +204,7 @@ struct unit_test_case {
>
> #define TEST_CASES_END() { NULL, NULL, NULL, NULL, 0 }
>
> -#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG
> +#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
> #define TEST_HEXDUMP(file, title, buf, len) rte_hexdump(file, title, buf, len)
> #else
> #define TEST_HEXDUMP(file, title, buf, len) do {} while (0)
For drivers, it looks correct to replace RTE_LOG_LEVEL by
RTE_LOG_DP_LEVEL, from what I see it's about dataplane logs.
For l3fwd, I'm less sure, but it could make sense too.
For test, I think we should replace TEST_HEXDUMP() by a function
that checks the runtime log level instead of relying on RTE_LOG_DP_LEVEL.
I can submit a patch for this.
Olivier
Hi Oliver,
Thanks for the review.
On Thu, Dec 07, 2017 at 02:21:21PM +0100, Olivier MATZ wrote:
> On Wed, Nov 22, 2017 at 02:58:06PM +0530, Pavan Nikhilesh wrote:
> > Remove RTE_LOG_LEVEL config option, use existing RTE_LOG_DP_LEVEL config
> > option for controlling datapath log level.
> > RTE_LOG_LEVEL is no longer needed as dynamic logging can be used to
> > control global and module specific log levels.
> >
> > Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
>
> Tome, removing the RTE_LOG_LEVEL goes in the good direction (less
> compile-time options).
>
> [...]
>
> > --- a/drivers/net/ena/base/ena_plat_dpdk.h
> > +++ b/drivers/net/ena/base/ena_plat_dpdk.h
> > @@ -96,7 +96,7 @@ typedef uint64_t dma_addr_t;
> > #define ENA_GET_SYSTEM_USECS() \
> > (rte_get_timer_cycles() * US_PER_S / rte_get_timer_hz())
> >
> > -#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG
> > +#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
> > #define ENA_ASSERT(cond, format, arg...) \
> > do { \
> > if (unlikely(!(cond))) { \
> > diff --git a/drivers/net/sfc/sfc_debug.h b/drivers/net/sfc/sfc_debug.h
> > index 92eba9c38..3f9ccf1e6 100644
> > --- a/drivers/net/sfc/sfc_debug.h
> > +++ b/drivers/net/sfc/sfc_debug.h
> > @@ -35,7 +35,7 @@
> > #include <rte_debug.h>
> >
> > #ifdef RTE_LIBRTE_SFC_EFX_DEBUG
> > -/* Avoid dependency from RTE_LOG_LEVEL to be able to enable debug check
> > +/* Avoid dependency from RTE_LOG_DP_LEVEL to be able to enable debug check
> > * in the driver only.
> > */
> > #define SFC_ASSERT(exp) RTE_VERIFY(exp)
> > diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
> > index e50b1a1a8..eb78decdd 100644
> > --- a/examples/l3fwd-acl/main.c
> > +++ b/examples/l3fwd-acl/main.c
> > @@ -68,7 +68,7 @@
> > #include <rte_string_fns.h>
> > #include <rte_acl.h>
> >
> > -#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG
> > +#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
> > #define L3FWDACL_DEBUG
> > #endif
> > #define DO_RFC_1812_CHECKS
> > diff --git a/test/test/test.h b/test/test/test.h
> > index 08ffe949c..8fdb3045e 100644
> > --- a/test/test/test.h
> > +++ b/test/test/test.h
> > @@ -204,7 +204,7 @@ struct unit_test_case {
> >
> > #define TEST_CASES_END() { NULL, NULL, NULL, NULL, 0 }
> >
> > -#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG
> > +#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
> > #define TEST_HEXDUMP(file, title, buf, len) rte_hexdump(file, title, buf, len)
> > #else
> > #define TEST_HEXDUMP(file, title, buf, len) do {} while (0)
>
> For drivers, it looks correct to replace RTE_LOG_LEVEL by
> RTE_LOG_DP_LEVEL, from what I see it's about dataplane logs.
>
> For l3fwd, I'm less sure, but it could make sense too.
>
> For test, I think we should replace TEST_HEXDUMP() by a function
> that checks the runtime log level instead of relying on RTE_LOG_DP_LEVEL.
> I can submit a patch for this.
Agreed.
Pavan
>
> Olivier
On Thu, Dec 07, 2017 at 07:37:14PM +0530, Pavan Nikhilesh Bhagavatula wrote:
> Hi Oliver,
>
> Thanks for the review.
>
> On Thu, Dec 07, 2017 at 02:21:21PM +0100, Olivier MATZ wrote:
> > On Wed, Nov 22, 2017 at 02:58:06PM +0530, Pavan Nikhilesh wrote:
> > > --- a/test/test/test.h
> > > +++ b/test/test/test.h
> > > @@ -204,7 +204,7 @@ struct unit_test_case {
> > >
> > > #define TEST_CASES_END() { NULL, NULL, NULL, NULL, 0 }
> > >
> > > -#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG
> > > +#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
> > > #define TEST_HEXDUMP(file, title, buf, len) rte_hexdump(file, title, buf, len)
> > > #else
> > > #define TEST_HEXDUMP(file, title, buf, len) do {} while (0)
> >
> > For drivers, it looks correct to replace RTE_LOG_LEVEL by
> > RTE_LOG_DP_LEVEL, from what I see it's about dataplane logs.
> >
> > For l3fwd, I'm less sure, but it could make sense too.
> >
> > For test, I think we should replace TEST_HEXDUMP() by a function
> > that checks the runtime log level instead of relying on RTE_LOG_DP_LEVEL.
> > I can submit a patch for this.
>
> Agreed.
Please see:
http://dpdk.org/ml/archives/dev/2017-December/083295.html
By the way, if you do another version on top of this patchset,
I think you can also do the following replacement for consistency:
--- a/lib/librte_flow_classify/rte_flow_classify.c
+++ b/lib/librte_flow_classify/rte_flow_classify.c
@@ -685,7 +685,7 @@ static void
librte_flow_classify_init_log(void)
{
librte_flow_classify_logtype =
- rte_log_register("librte.flow_classify");
+ rte_log_register("lib.flow_classify");
if (librte_flow_classify_logtype >= 0)
rte_log_set_level(librte_flow_classify_logtype, RTE_LOG_INFO);
}
diff --git a/lib/librte_member/rte_member.c b/lib/librte_member/rte_member.c
index cc9ea84ae..84354cc38 100644
--- a/lib/librte_member/rte_member.c
+++ b/lib/librte_member/rte_member.c
@@ -330,7 +330,7 @@ RTE_INIT(librte_member_init_log);
static void
librte_member_init_log(void)
{
- librte_member_logtype = rte_log_register("librte.member");
+ librte_member_logtype = rte_log_register("lib.member");
if (librte_member_logtype >= 0)
rte_log_set_level(librte_member_logtype, RTE_LOG_DEBUG);
}
Thanks,
Olivier
@@ -94,7 +94,6 @@ CONFIG_RTE_MAX_MEMSEG=256
CONFIG_RTE_MAX_MEMZONE=2560
CONFIG_RTE_MAX_TAILQ=32
CONFIG_RTE_ENABLE_ASSERT=n
-CONFIG_RTE_LOG_LEVEL=RTE_LOG_INFO
CONFIG_RTE_LOG_DP_LEVEL=RTE_LOG_INFO
CONFIG_RTE_LOG_HISTORY=256
CONFIG_RTE_BACKTRACE=y
@@ -157,7 +157,7 @@ config () # <directory> <target> <options>
! echo $3 | grep -q '+shared' || \
sed -ri 's,(SHARED_LIB=)n,\1y,' $1/.config
! echo $3 | grep -q '+debug' || ( \
- sed -ri 's,(RTE_LOG_LEVEL=).*,\1RTE_LOG_DEBUG,' $1/.config
+ sed -ri 's,(RTE_LOG_DP_LEVEL=).*,\1RTE_LOG_DEBUG,' $1/.config
sed -ri 's,(_DEBUG.*=)n,\1y,' $1/.config
sed -ri 's,(_STAT.*=)n,\1y,' $1/.config
sed -ri 's,(TEST_PMD_RECORD_.*=)n,\1y,' $1/.config )
@@ -103,9 +103,6 @@ Yes, the option ``--log-level=`` accepts one of these numbers:
#define RTE_LOG_INFO 7U /* Informational. */
#define RTE_LOG_DEBUG 8U /* Debug-level messages. */
-It is also possible to change the default level at compile time
-with ``CONFIG_RTE_LOG_LEVEL``.
-
How can I tune my network application to achieve lower latency?
---------------------------------------------------------------
@@ -96,7 +96,7 @@ typedef uint64_t dma_addr_t;
#define ENA_GET_SYSTEM_USECS() \
(rte_get_timer_cycles() * US_PER_S / rte_get_timer_hz())
-#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG
+#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
#define ENA_ASSERT(cond, format, arg...) \
do { \
if (unlikely(!(cond))) { \
@@ -35,7 +35,7 @@
#include <rte_debug.h>
#ifdef RTE_LIBRTE_SFC_EFX_DEBUG
-/* Avoid dependency from RTE_LOG_LEVEL to be able to enable debug check
+/* Avoid dependency from RTE_LOG_DP_LEVEL to be able to enable debug check
* in the driver only.
*/
#define SFC_ASSERT(exp) RTE_VERIFY(exp)
@@ -68,7 +68,7 @@
#include <rte_string_fns.h>
#include <rte_acl.h>
-#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG
+#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
#define L3FWDACL_DEBUG
#endif
#define DO_RFC_1812_CHECKS
@@ -204,7 +204,7 @@ struct unit_test_case {
#define TEST_CASES_END() { NULL, NULL, NULL, NULL, 0 }
-#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG
+#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
#define TEST_HEXDUMP(file, title, buf, len) rte_hexdump(file, title, buf, len)
#else
#define TEST_HEXDUMP(file, title, buf, len) do {} while (0)