[dpdk-dev] [PATCH] enic: disable debug traces

Adrien Mazarguil adrien.mazarguil at 6wind.com
Thu Apr 9 10:32:24 CEST 2015


On Tue, Apr 07, 2015 at 07:40:19PM +0200, Thomas Monjalon wrote:
> The function name is printed in each enic_ethdev function.
> Disable it by default with a new build option.
> 
> Signed-off-by: Thomas Monjalon <thomas.monjalon at 6wind.com>
> ---
>  config/common_bsdapp              | 1 +
>  config/common_linuxapp            | 1 +
>  lib/librte_pmd_enic/enic_ethdev.c | 4 ++++
>  3 files changed, 6 insertions(+)
> 
> diff --git a/config/common_bsdapp b/config/common_bsdapp
> index a8ba484..c2374c0 100644
> --- a/config/common_bsdapp
> +++ b/config/common_bsdapp
> @@ -214,6 +214,7 @@ CONFIG_RTE_LIBRTE_MLX4_SOFT_COUNTERS=1
>  # Compile burst-oriented Cisco ENIC PMD driver
>  #
>  CONFIG_RTE_LIBRTE_ENIC_PMD=y
> +CONFIG_RTE_LIBRTE_ENIC_DEBUG=n
>  
>  #
>  # Compile burst-oriented VIRTIO PMD driver
> diff --git a/config/common_linuxapp b/config/common_linuxapp
> index 0b25f34..0078dc9 100644
> --- a/config/common_linuxapp
> +++ b/config/common_linuxapp
> @@ -211,6 +211,7 @@ CONFIG_RTE_LIBRTE_MLX4_SOFT_COUNTERS=1
>  # Compile burst-oriented Cisco ENIC PMD driver
>  #
>  CONFIG_RTE_LIBRTE_ENIC_PMD=y
> +CONFIG_RTE_LIBRTE_ENIC_DEBUG=n
>  
>  #
>  # Compile burst-oriented VIRTIO PMD driver
> diff --git a/lib/librte_pmd_enic/enic_ethdev.c b/lib/librte_pmd_enic/enic_ethdev.c
> index 4950ede..18fadfb 100644
> --- a/lib/librte_pmd_enic/enic_ethdev.c
> +++ b/lib/librte_pmd_enic/enic_ethdev.c
> @@ -48,8 +48,12 @@
>  #include "vnic_enet.h"
>  #include "enic.h"
>  
> +#ifdef RTE_LIBRTE_ENIC_DEBUG
>  #define ENICPMD_FUNC_TRACE() \
>  	RTE_LOG(DEBUG, PMD, "ENICPMD trace: %s\n", __func__)
> +#else
> +#define ENICPMD_FUNC_TRACE() do {} while (0)

How about defining it as (void)0 instead of an empty do/while block?

Doing so will prevent warnings if this macro happens to be used in an
expression. RTE_LOG() supports it.

> +#endif
>  
>  /*
>   * The set of PCI devices this driver supports
> -- 
> 2.2.2

-- 
Adrien Mazarguil
6WIND


More information about the dev mailing list