numam-dpdk/drivers/net/softnic
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
..
conn.c mk: build with _GNU_SOURCE defined by default 2018-10-22 11:28:27 +02:00
conn.h net/softnic: add connection agent 2018-07-12 13:52:37 +02:00
firmware.cli net/softnic: add firmware script 2018-07-12 13:55:42 +02:00
meson.build drivers: change indentation in build files 2021-04-21 14:04:09 +02:00
parser.c net/softnic: use POSIX network address conversion 2020-10-23 11:01:25 +02:00
parser.h net: add rte prefix to ether structures 2019-05-24 13:34:45 +02:00
rte_eth_softnic_action.c net/softnic: add symmetric crypto action 2018-10-26 14:13:45 +02:00
rte_eth_softnic_cli.c replace packed attributes 2020-04-16 18:16:46 +02:00
rte_eth_softnic_cryptodev.c net/softnic: use separate session mempools 2019-01-10 16:57:22 +01:00
rte_eth_softnic_flow.c ethdev: add pre-defined meter policy API 2021-04-21 12:22:17 +02:00
rte_eth_softnic_internals.h ethdev: add pre-defined meter policy API 2021-04-21 12:22:17 +02:00
rte_eth_softnic_link.c net/softnic: check status of getting ethdev info 2019-10-07 14:45:35 +02:00
rte_eth_softnic_mempool.c net/softnic: add mempool object 2018-07-12 13:49:44 +02:00
rte_eth_softnic_meter.c net/softnic: fix meter policies initialization 2021-04-29 16:10:57 +02:00
rte_eth_softnic_pipeline.c net: add rte prefix to TCP structure 2019-05-24 13:34:46 +02:00
rte_eth_softnic_swq.c net/softnic: fix memory illegal access after free 2018-07-23 23:55:26 +02:00
rte_eth_softnic_tap.c replace snprintf with strlcpy without adding extra include 2019-04-04 22:45:54 +02:00
rte_eth_softnic_thread.c eal: rename lcore master and slave 2020-10-20 13:17:08 +02:00
rte_eth_softnic_tm.c net/softnic: fix out-of-bound access 2020-11-03 23:24:24 +01:00
rte_eth_softnic.c log: register with standardized names 2021-05-11 15:17:55 +02:00
rte_eth_softnic.h enforce experimental tag at beginning of declarations 2019-06-29 19:04:48 +02:00
version.map build: remove library name from version map file name 2020-10-19 22:13:59 +02:00