numam-dpdk/drivers/net/dpaa2
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
..
base net/dpaa2: fix RSS distribution size field 2021-04-09 11:00:30 +02:00
mc net/dpaa2: do not drop parse error packets by dpdmux 2021-02-24 18:03:30 +01:00
dpaa2_ethdev.c log: register with standardized names 2021-05-11 15:17:55 +02:00
dpaa2_ethdev.h ethdev: replace callback getting filter operations 2021-03-26 18:37:13 +01:00
dpaa2_flow.c ethdev: replace callback getting filter operations 2021-03-26 18:37:13 +01:00
dpaa2_mux.c net/dpaa2: do not drop parse error packets by dpdmux 2021-02-24 18:03:30 +01:00
dpaa2_pmd_logs.h drivers: fix SPDX license id consistency 2019-03-29 00:15:53 +01:00
dpaa2_ptp.c net/dpaa2: fix build with timesync functions 2020-10-16 19:18:47 +02:00
dpaa2_rxtx.c net/dpaa2: enable error queues optionally 2021-02-24 18:03:30 +01:00
dpaa2_sparser.c devtools: forbid variable declaration inside for 2020-07-03 10:04:15 +02:00
dpaa2_sparser.h net/dpaa2: add soft parser driver 2019-10-08 12:14:31 +02:00
dpaa2_tm.c net/dpaa2: support traffic management 2021-02-24 18:03:30 +01:00
dpaa2_tm.h net/dpaa2: support traffic management 2021-02-24 18:03:30 +01:00
meson.build drivers: change indentation in build files 2021-04-21 14:04:09 +02:00
rte_pmd_dpaa2.h net/dpaa2: support configuring dpdmux max Rx frame length 2021-02-24 18:03:30 +01:00
version.map net/dpaa2: support configuring dpdmux max Rx frame length 2021-02-24 18:03:30 +01:00