[v1,17/17] sched: replace library debug flag with global one

Message ID 20200417215739.23180-18-l.wojciechow@partner.samsung.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series introduce global debug flag |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/travis-robot warning Travis build: failed
ci/Intel-compilation success Compilation OK

Commit Message

Lukasz Wojciechowski April 17, 2020, 9:57 p.m. UTC
  Use global debug flag RTE_DEBUG instead of RTE_SCHED_DEBUG.
The old define is completely removed from source code and config.

Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
---
 config/common_base           |  1 -
 lib/librte_sched/rte_sched.c | 10 +++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)
  

Comments

Cristian Dumitrescu April 20, 2020, 9:04 a.m. UTC | #1
> -----Original Message-----
> From: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
> Sent: Friday, April 17, 2020 10:58 PM
> To: Thomas Monjalon <thomas@monjalon.net>; Dumitrescu, Cristian
> <cristian.dumitrescu@intel.com>; Singh, Jasvinder
> <jasvinder.singh@intel.com>
> Cc: dev@dpdk.org
> Subject: [PATCH v1 17/17] sched: replace library debug flag with global one
> 
> Use global debug flag RTE_DEBUG instead of RTE_SCHED_DEBUG.
> The old define is completely removed from source code and config.
> 
> Signed-off-by: Lukasz Wojciechowski
> <l.wojciechow@partner.samsung.com>
> ---
>  config/common_base           |  1 -
>  lib/librte_sched/rte_sched.c | 10 +++++-----
>  2 files changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/config/common_base b/config/common_base
> index ae6db0adb..eb8b83224 100644
> --- a/config/common_base
> +++ b/config/common_base
> @@ -976,7 +976,6 @@ CONFIG_RTE_LIBRTE_FLOW_CLASSIFY=y
>  # Compile librte_sched
>  #
>  CONFIG_RTE_LIBRTE_SCHED=y
> -CONFIG_RTE_SCHED_DEBUG=n
>  CONFIG_RTE_SCHED_RED=n
>  CONFIG_RTE_SCHED_COLLECT_STATS=n
>  CONFIG_RTE_SCHED_SUBPORT_TC_OV=n
> diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c
> index c0983ddda..e19f1d959 100644
> --- a/lib/librte_sched/rte_sched.c
> +++ b/lib/librte_sched/rte_sched.c
> @@ -1482,7 +1482,7 @@ rte_sched_queue_read_stats(struct
> rte_sched_port *port,
>  	return 0;
>  }
> 
> -#ifdef RTE_SCHED_DEBUG
> +#ifdef RTE_DEBUG
> 
>  static inline int
>  rte_sched_port_queue_is_empty(struct rte_sched_subport *subport,
> @@ -1493,7 +1493,7 @@ rte_sched_port_queue_is_empty(struct
> rte_sched_subport *subport,
>  	return queue->qr == queue->qw;
>  }
> 
> -#endif /* RTE_SCHED_DEBUG */
> +#endif /* RTE_DEBUG */
> 
>  #ifdef RTE_SCHED_COLLECT_STATS
> 
> @@ -1627,7 +1627,7 @@ static inline int rte_sched_port_red_drop(struct
> rte_sched_port *port __rte_unus
> 
>  #endif /* RTE_SCHED_RED */
> 
> -#ifdef RTE_SCHED_DEBUG
> +#ifdef RTE_DEBUG
> 
>  static inline void
>  debug_check_queue_slab(struct rte_sched_subport *subport, uint32_t
> bmp_pos,
> @@ -1654,7 +1654,7 @@ debug_check_queue_slab(struct
> rte_sched_subport *subport, uint32_t bmp_pos,
>  			bmp_slab, bmp_pos);
>  }
> 
> -#endif /* RTE_SCHED_DEBUG */
> +#endif /* RTE_DEBUG */
> 
>  static inline struct rte_sched_subport *
>  rte_sched_port_subport(struct rte_sched_port *port,
> @@ -2404,7 +2404,7 @@ grinder_next_pipe(struct rte_sched_port *port,
>  		if (unlikely(rte_bitmap_scan(subport->bmp, &bmp_pos,
> &bmp_slab) <= 0))
>  			return 0;
> 
> -#ifdef RTE_SCHED_DEBUG
> +#ifdef RTE_DEBUG
>  		debug_check_queue_slab(subport, bmp_pos, bmp_slab);
>  #endif
> 
> --
> 2.17.1

The approach in this series does not make any sense to me: what if you want to debug just this library instead of the entire DPDK? We need to be able to enable debug for a single library at a time, as opposed to the user being flooded with unwanted debug messages from all the libraries.

NAK from me.
  

Patch

diff --git a/config/common_base b/config/common_base
index ae6db0adb..eb8b83224 100644
--- a/config/common_base
+++ b/config/common_base
@@ -976,7 +976,6 @@  CONFIG_RTE_LIBRTE_FLOW_CLASSIFY=y
 # Compile librte_sched
 #
 CONFIG_RTE_LIBRTE_SCHED=y
-CONFIG_RTE_SCHED_DEBUG=n
 CONFIG_RTE_SCHED_RED=n
 CONFIG_RTE_SCHED_COLLECT_STATS=n
 CONFIG_RTE_SCHED_SUBPORT_TC_OV=n
diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c
index c0983ddda..e19f1d959 100644
--- a/lib/librte_sched/rte_sched.c
+++ b/lib/librte_sched/rte_sched.c
@@ -1482,7 +1482,7 @@  rte_sched_queue_read_stats(struct rte_sched_port *port,
 	return 0;
 }
 
-#ifdef RTE_SCHED_DEBUG
+#ifdef RTE_DEBUG
 
 static inline int
 rte_sched_port_queue_is_empty(struct rte_sched_subport *subport,
@@ -1493,7 +1493,7 @@  rte_sched_port_queue_is_empty(struct rte_sched_subport *subport,
 	return queue->qr == queue->qw;
 }
 
-#endif /* RTE_SCHED_DEBUG */
+#endif /* RTE_DEBUG */
 
 #ifdef RTE_SCHED_COLLECT_STATS
 
@@ -1627,7 +1627,7 @@  static inline int rte_sched_port_red_drop(struct rte_sched_port *port __rte_unus
 
 #endif /* RTE_SCHED_RED */
 
-#ifdef RTE_SCHED_DEBUG
+#ifdef RTE_DEBUG
 
 static inline void
 debug_check_queue_slab(struct rte_sched_subport *subport, uint32_t bmp_pos,
@@ -1654,7 +1654,7 @@  debug_check_queue_slab(struct rte_sched_subport *subport, uint32_t bmp_pos,
 			bmp_slab, bmp_pos);
 }
 
-#endif /* RTE_SCHED_DEBUG */
+#endif /* RTE_DEBUG */
 
 static inline struct rte_sched_subport *
 rte_sched_port_subport(struct rte_sched_port *port,
@@ -2404,7 +2404,7 @@  grinder_next_pipe(struct rte_sched_port *port,
 		if (unlikely(rte_bitmap_scan(subport->bmp, &bmp_pos, &bmp_slab) <= 0))
 			return 0;
 
-#ifdef RTE_SCHED_DEBUG
+#ifdef RTE_DEBUG
 		debug_check_queue_slab(subport, bmp_pos, bmp_slab);
 #endif