numam-dpdk/drivers/net/virtio
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
..
virtio_user net/virtio: fix kernel set memtable for multi-queue device 2021-04-28 07:55:27 +02: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
virtio_ethdev.c log: register with standardized names 2021-05-11 15:17:55 +02:00
virtio_ethdev.h drivers: replace page size definitions with function 2021-03-23 08:41:05 +01:00
virtio_logs.h net/virtio: implement dynamic logging 2018-01-16 18:47:49 +01:00
virtio_pci_ethdev.c net/virtio: fix secondary process crash with PCI devices 2021-02-04 18:19:36 +01:00
virtio_pci.c net/virtio: fix secondary process crash with PCI devices 2021-02-04 18:19:36 +01:00
virtio_pci.h net/virtio: fix secondary process crash with PCI devices 2021-02-04 18:19:36 +01:00
virtio_ring.h net/virtio: move features definition to generic header 2021-01-29 18:16:09 +01:00
virtio_rxtx_packed_avx.h net/virtio: refactor Tx offload helper 2021-05-04 10:22:17 +02:00
virtio_rxtx_packed_neon.h net/virtio: refactor Tx offload helper 2021-05-04 10:22:17 +02:00
virtio_rxtx_packed.c net/virtio: remove reference to virtqueue in vrings 2021-03-31 07:31:14 +02:00
virtio_rxtx_packed.h net/virtio: remove reference to virtqueue in vrings 2021-03-31 07:31:14 +02:00
virtio_rxtx_simple_altivec.c net/virtio: fix vectorized Rx queue rearm 2021-05-04 10:08:11 +02:00
virtio_rxtx_simple_neon.c net/virtio: fix vectorized Rx queue rearm 2021-05-04 10:08:11 +02:00
virtio_rxtx_simple_sse.c net/virtio: fix vectorized Rx queue rearm 2021-05-04 10:08:11 +02:00
virtio_rxtx_simple.c ethdev: make driver-only headers private 2021-01-29 20:59:09 +01:00
virtio_rxtx_simple.h net/virtio: remove reference to virtqueue in vrings 2021-03-31 07:31:14 +02:00
virtio_rxtx.c net/virtio: refactor Tx offload helper 2021-05-04 10:22:17 +02:00
virtio_rxtx.h net/virtio: allocate fake mbuf in Rx queue 2021-03-31 07:31:41 +02:00
virtio_user_ethdev.c net/virtio: fix getline memory leakage 2021-04-28 05:10:27 +02:00
virtio.c net/virtio: make interrupt handling more generic 2021-01-29 18:16:09 +01:00
virtio.h drivers: replace page size definitions with function 2021-03-23 08:41:05 +01:00
virtqueue.c net/virtio: remove last PCI refs in non-PCI code 2021-01-29 18:16:09 +01:00
virtqueue.h net/virtio: refactor Tx offload helper 2021-05-04 10:22:17 +02:00