numam-dpdk/drivers/net/axgbe
David Marchand eeded2044a log: register with standardized names
Let's try to enforce the convention where most drivers use a pmd. logtype
with their class reflected in it, and libraries use a lib. logtype.

Introduce two new macros:
- RTE_LOG_REGISTER_DEFAULT can be used when a single logtype is
  used in a component. It is associated to the default name provided
  by the build system,
- RTE_LOG_REGISTER_SUFFIX can be used when multiple logtypes are used,
  and then the passed name is appended to the default name,

RTE_LOG_REGISTER is left untouched for existing external users
and for components that do not comply with the convention.

There is a new Meson variable log_prefix to adapt the default name
for baseband (pmd.bb.), bus (no pmd.) and mempool (no pmd.) classes.

Note: achieved with below commands + reverted change on net/bonding +
edits on crypto/virtio, compress/mlx5, regex/mlx5

$ git grep -l RTE_LOG_REGISTER drivers/ |
  while read file; do
    pattern=${file##drivers/};
    class=${pattern%%/*};
    pattern=${pattern#$class/};
    drv=${pattern%%/*};
    case "$class" in
      baseband) pattern=pmd.bb.$drv;;
      bus) pattern=bus.$drv;;
      mempool) pattern=mempool.$drv;;
      *) pattern=pmd.$class.$drv;;
    esac
    sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern',/RTE_LOG_REGISTER_DEFAULT(\1,/' $file;
    sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern'\.\(.*\),/RTE_LOG_REGISTER_SUFFIX(\1, \2,/' $file;
  done

$ git grep -l RTE_LOG_REGISTER lib/ |
  while read file; do
    pattern=${file##lib/};
    pattern=lib.${pattern%%/*};
    sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern',/RTE_LOG_REGISTER_DEFAULT(\1,/' $file;
    sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern'\.\(.*\),/RTE_LOG_REGISTER_SUFFIX(\1, \2,/' $file;
  done

Signed-off-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2021-05-11 15:17:55 +02:00
..
axgbe_common.h drivers/net: redefine array size macros 2021-02-22 18:08:08 +01:00
axgbe_dev.c net/axgbe: support VLAN 2021-01-08 16:03:04 +01:00
axgbe_ethdev.c log: register with standardized names 2021-05-11 15:17:55 +02:00
axgbe_ethdev.h net/axgbe: fix jumbo frame flag condition for MTU set 2021-01-19 03:30:15 +01:00
axgbe_i2c.c net/axgbe: add debug logs 2020-03-18 10:21:41 +01:00
axgbe_logs.h net/axgbe: add minimal init and uninit support 2018-04-14 00:41:44 +02:00
axgbe_mdio.c net/axgbe: use common bit operations API 2020-06-16 14:34:42 +02:00
axgbe_phy_impl.c net/axgbe: add debug logs 2020-03-18 10:21:41 +01:00
axgbe_phy.h net/axgbe: add phy register map and helper macros 2018-04-14 00:41:44 +02:00
axgbe_regs.h net/axgbe: support registers dump 2020-03-18 10:21:41 +01:00
axgbe_rxtx_vec_sse.c net/axgbe: support IEEE 1588 PTP 2020-09-18 18:55:10 +02:00
axgbe_rxtx.c drivers/net: fix FW version query 2021-04-26 13:50:42 +02:00
axgbe_rxtx.h net/axgbe: support reading FW version 2021-01-13 18:51:57 +01:00
meson.build drivers: change indentation in build files 2021-04-21 14:04:09 +02:00
version.map build: remove library name from version map file name 2020-10-19 22:13:59 +02:00