[PATCH] drivers: use dedicated logtypes

Stephen Hemminger stephen at networkplumber.org
Mon Dec 18 18:14:33 CET 2023


On Mon, 18 Dec 2023 14:59:31 +0100
David Marchand <david.marchand at redhat.com> wrote:

> When a driver dedicated logtype exists, use it instead of the generic
> PMD logtype.
> 
> This has been done partially automatically with:
> 
> $ for file in $(git grep -l RTE_LOG.*PMD.*fmt drivers/'**.h' \
>   :^drivers/common/cnxk/roc_platform.h)
> do
>   tail=${file#drivers/*/*/}
>   dir=${file%%$tail}
>   ! git grep -q RTE_LOGTYPE_ $dir || \
>     { echo $dir already done; continue; }
>   git grep -hE '^extern int .*log.*;$' $file | \
>   sed -ne 's/^extern int \([^ ;]*\);$/\1/p' | \
>   while read logtype
>   do
>     git grep -q 'RTE_LOG_REGISTER\(_DEFAULT\|\)('$logtype',' || \
>     [ "$logtype" != "${logtype%%driver}" ] || \
>       { echo Skipped $logtype; continue; }
>     abbrev=$(echo $logtype | sed -e 's/_logtype//' | tr '[a-z]' '[A-Z]')
>     sed -i -e 's/^\(extern int '$logtype'.*\)$/\1\n#define RTE_LOGTYPE_' \
>       $abbrev' '$logtype'/' $file
>     sed -i -e 's/\(RTE_LOG.*, \)PMD,/\1'$abbrev',/' $file
>     break
>   done
> done
> 
> Then a manual update for:
> - common/cpt,
> - common/dpaax,
> - common/idpf,
> - mempool/dpaa,
> - net/bnxt,
> - net/octeon_ep,
> - raw/ifpga,
> - vdpa/ifc,
> 
> Signed-off-by: David Marchand <david.marchand at redhat.com>

I have some additional manual fixes on top of this.

Reviewed-by: Stephen Hemminger <stephen at networkplumber.org>



More information about the dev mailing list