[dpdk-dev] [PATCH v4 1/7] bus/fslmc: change to dynamic logging

Ferruh Yigit ferruh.yigit at intel.com
Tue Dec 3 16:35:14 CET 2019


On 4/2/2018 3:05 PM, Shreyansh Jain wrote:
> Signed-off-by: Shreyansh Jain <shreyansh.jain at nxp.com>
> Acked-by: Hemant Agrawal <hemant.agrawal at nxp.com>

<...>

> diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
> index 5ee0beb85..4d29b53b1 100644
> --- a/drivers/bus/fslmc/fslmc_bus.c
> +++ b/drivers/bus/fslmc/fslmc_bus.c
> @@ -18,9 +18,9 @@
>  
>  #include <rte_fslmc.h>
>  #include <fslmc_vfio.h>
> +#include "fslmc_logs.h"
>  
> -#define FSLMC_BUS_LOG(level, fmt, args...) \
> -	RTE_LOG(level, EAL, fmt "\n", ##args)
> +int dpaa2_logtype_bus;
>  
>  #define VFIO_IOMMU_GROUP_PATH "/sys/kernel/iommu_groups"
>  
> @@ -93,6 +93,25 @@ insert_in_device_list(struct rte_dpaa2_device *newdev)
>  		TAILQ_INSERT_TAIL(&rte_fslmc_bus.device_list, newdev, next);
>  }
>  
> +static void
> +dump_device_list(void)
> +{
> +	struct rte_dpaa2_device *dev;
> +	uint32_t global_log_level;
> +	int local_log_level;
> +
> +	/* Only if the log level has been set to Debugging, print list */
> +	global_log_level = rte_log_get_global_level();
> +	local_log_level = rte_log_get_level(dpaa2_logtype_bus);
> +	if (global_log_level == RTE_LOG_DEBUG ||
> +	    global_log_level == RTE_LOG_DEBUG) {
> +		DPAA2_BUS_DEBUG("List of devices scanned on bus:");
> +		TAILQ_FOREACH(dev, &rte_fslmc_bus.device_list, next) {
> +			DPAA2_BUS_DEBUG("%s", dev->device.name);
> +		}
> +	}
> +}

Hi Hemant, Shreyansh,

This is old code but I saw it while checking something else, is
'global_log_level' & 'global_log_level' checks required?
Won't 'DPAA2_BUS_DEBUG' macro do it already?

Thanks,
ferruh





More information about the dev mailing list