[ovs-dev] [PATCH 3/3] debug: print mbuf extra info.

Ben Pfaff blp at ovn.org
Thu Sep 26 14:49:28 UTC 2019


On Thu, Sep 26, 2019 at 11:59:14AM -0400, Aaron Conole wrote:
> Flavio Leitner <fbl at sysclose.org> writes:
> 
> > Signed-off-by: Flavio Leitner <fbl at sysclose.org>
> > ---
> >  lib/netdev-dpdk.c | 18 ++++++++++++++++++
> >  1 file changed, 18 insertions(+)
> >
> > diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> > index cfbd9a9e5..7965bf57a 100644
> > --- a/lib/netdev-dpdk.c
> > +++ b/lib/netdev-dpdk.c
> > @@ -2294,6 +2294,24 @@ netdev_dpdk_vhost_update_rx_counters(struct netdev_stats *stats,
> >          }
> >  
> >          stats->rx_bytes += packet_size;
> > +#if 0
> 
> I've never liked bare '#if 0' in the code.
> 
> Can you make this something like:
> 
>   #ifndef NDEBUG
> 
> This means for all debug builds we would get this tracing
> infrastructure.  Maybe even make a special configuration option?

It's so much better if we can avoid #ifdefs.  Can we just use VLOG_DBG()
or its related VLOG_IS_DBG_ENABLED(), VLOG_DBG_RL(), VLOG_DROP_DBG()?


More information about the dev mailing list