numam-dpdk/drivers/net/mlx4
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
..
meson.build drivers: change indentation in build files 2021-04-21 14:04:09 +02:00
mlx4_ethdev.c ethdev: make driver-only headers private 2021-01-29 20:59:09 +01:00
mlx4_flow.c net/mlx4: fix RSS action with null hash key 2021-04-13 13:38:13 +02:00
mlx4_flow.h ethdev: replace callback getting filter operations 2021-03-26 18:37:13 +01:00
mlx4_glue.c align SPDX Mellanox copyrights 2018-04-11 01:47:47 +02:00
mlx4_glue.h net/mlx: remove separate ABI version for glue libraries 2020-11-03 23:35:07 +01:00
mlx4_intr.c ethdev: make driver-only headers private 2021-01-29 20:59:09 +01:00
mlx4_mp.c net/mlx4: fix port attach in secondary process 2021-01-29 18:16:08 +01:00
mlx4_mr.c net/mlx4: improve assert control 2020-02-05 09:51:21 +01:00
mlx4_mr.h remove useless include of EAL memory config header 2019-10-09 10:22:24 +02:00
mlx4_prm.h net/mlx4: remove device register remap 2019-04-12 11:02:02 +02:00
mlx4_rxq.c ethdev: make driver-only headers private 2021-01-29 20:59:09 +01:00
mlx4_rxtx.c net/mlx4: fix buffer leakage on device close 2021-04-28 08:43:31 +02:00
mlx4_rxtx.h net/mlx4: fix port attach in secondary process 2021-01-29 18:16:08 +01:00
mlx4_txq.c net/mlx4: fix buffer leakage on device close 2021-04-28 08:43:31 +02:00
mlx4_utils.c net/mlx4: improve assert control 2020-02-05 09:51:21 +01:00
mlx4_utils.h net/mlx4: enable debug logs dynamically 2021-03-15 14:30:53 +01:00
mlx4.c log: register with standardized names 2021-05-11 15:17:55 +02:00
mlx4.h net/mlx4: fix port attach in secondary process 2021-01-29 18:16:08 +01:00
version.map build: remove library name from version map file name 2020-10-19 22:13:59 +02:00