log: register with standardized names
authorDavid Marchand <david.marchand@redhat.com>
Mon, 26 Apr 2021 12:51:08 +0000 (14:51 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 11 May 2021 13:17:55 +0000 (15:17 +0200)
commiteeded2044af5bbe88220120b14933536cbb3edb6
tree8a3687f81d55b1d4aa1accaa71e943db5f7c3289
parentbe81f77d807720f01e72e38502c2ca613b36b726
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>
122 files changed:
drivers/baseband/acc100/rte_acc100_pmd.c
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c
drivers/baseband/meson.build
drivers/baseband/null/bbdev_null.c
drivers/baseband/turbo_sw/bbdev_turbo_software.c
drivers/bus/dpaa/dpaa_bus.c
drivers/bus/fslmc/fslmc_bus.c
drivers/bus/ifpga/ifpga_bus.c
drivers/bus/meson.build
drivers/bus/vdev/vdev.c
drivers/bus/vmbus/vmbus_common.c
drivers/common/dpaax/dpaax_iova_table.c
drivers/common/iavf/iavf_impl.c
drivers/common/mlx5/mlx5_common.c
drivers/compress/isal/isal_compress_pmd.c
drivers/compress/mlx5/mlx5_compress.c
drivers/compress/octeontx/otx_zip_pmd.c
drivers/compress/zlib/zlib_pmd.c
drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
drivers/crypto/armv8/rte_armv8_pmd.c
drivers/crypto/bcmfs/bcmfs_logs.c
drivers/crypto/kasumi/rte_kasumi_pmd.c
drivers/crypto/mvsam/rte_mrvl_pmd.c
drivers/crypto/nitrox/nitrox_logs.c
drivers/crypto/null/null_crypto_pmd.c
drivers/crypto/octeontx/otx_cryptodev.c
drivers/crypto/octeontx2/otx2_cryptodev.c
drivers/crypto/openssl/rte_openssl_pmd.c
drivers/crypto/scheduler/rte_cryptodev_scheduler.c
drivers/crypto/snow3g/rte_snow3g_pmd.c
drivers/crypto/virtio/virtio_cryptodev.c
drivers/crypto/zuc/rte_zuc_pmd.c
drivers/event/dlb2/dlb2.c
drivers/event/dpaa/dpaa_eventdev.c
drivers/event/dpaa2/dpaa2_eventdev.c
drivers/event/octeontx/ssovf_evdev.c
drivers/event/octeontx/timvf_evdev.c
drivers/event/opdl/opdl_evdev.c
drivers/event/sw/sw_evdev.c
drivers/mempool/dpaa/dpaa_mempool.c
drivers/mempool/dpaa2/dpaa2_hw_mempool.c
drivers/mempool/meson.build
drivers/meson.build
drivers/net/af_packet/rte_eth_af_packet.c
drivers/net/af_xdp/rte_eth_af_xdp.c
drivers/net/ark/ark_ethdev.c
drivers/net/atlantic/atl_ethdev.c
drivers/net/avp/avp_ethdev.c
drivers/net/axgbe/axgbe_ethdev.c
drivers/net/bnx2x/bnx2x_ethdev.c
drivers/net/bnxt/bnxt_ethdev.c
drivers/net/bonding/rte_eth_bond_pmd.c
drivers/net/cxgbe/cxgbe_ethdev.c
drivers/net/dpaa/dpaa_ethdev.c
drivers/net/dpaa2/dpaa2_ethdev.c
drivers/net/e1000/e1000_logs.c
drivers/net/ena/ena_ethdev.c
drivers/net/enetc/enetc_ethdev.c
drivers/net/enic/enic_ethdev.c
drivers/net/failsafe/failsafe.c
drivers/net/fm10k/fm10k_ethdev.c
drivers/net/hinic/hinic_pmd_ethdev.c
drivers/net/hns3/hns3_ethdev.c
drivers/net/i40e/i40e_ethdev.c
drivers/net/iavf/iavf_ethdev.c
drivers/net/ice/ice_ethdev.c
drivers/net/igc/igc_logs.c
drivers/net/ionic/ionic_ethdev.c
drivers/net/ipn3ke/ipn3ke_ethdev.c
drivers/net/ixgbe/ixgbe_ethdev.c
drivers/net/kni/rte_eth_kni.c
drivers/net/liquidio/lio_ethdev.c
drivers/net/memif/rte_eth_memif.c
drivers/net/mlx4/mlx4.c
drivers/net/mlx5/mlx5.c
drivers/net/mvneta/mvneta_ethdev.c
drivers/net/mvpp2/mrvl_ethdev.c
drivers/net/netvsc/hn_ethdev.c
drivers/net/nfp/nfp_net.c
drivers/net/null/rte_eth_null.c
drivers/net/octeontx/octeontx_ethdev.c
drivers/net/octeontx_ep/otx_ep_ethdev.c
drivers/net/pcap/pcap_ethdev.c
drivers/net/pfe/pfe_ethdev.c
drivers/net/qede/qede_ethdev.c
drivers/net/ring/rte_eth_ring.c
drivers/net/softnic/rte_eth_softnic.c
drivers/net/szedata2/rte_eth_szedata2.c
drivers/net/tap/rte_eth_tap.c
drivers/net/thunderx/nicvf_ethdev.c
drivers/net/txgbe/txgbe_ethdev.c
drivers/net/vdev_netvsc/vdev_netvsc.c
drivers/net/vhost/rte_eth_vhost.c
drivers/net/virtio/virtio_ethdev.c
drivers/net/vmxnet3/vmxnet3_ethdev.c
drivers/raw/ifpga/ifpga_rawdev.c
drivers/raw/ioat/ioat_rawdev.c
drivers/raw/ntb/ntb.c
drivers/raw/skeleton/skeleton_rawdev.c
drivers/regex/mlx5/mlx5_regex.c
drivers/vdpa/mlx5/mlx5_vdpa.c
lib/bbdev/rte_bbdev.c
lib/bpf/bpf.c
lib/cfgfile/rte_cfgfile.c
lib/compressdev/rte_compressdev.c
lib/eal/include/rte_log.h
lib/ethdev/rte_ethdev.c
lib/eventdev/rte_event_timer_adapter.c
lib/flow_classify/rte_flow_classify.c
lib/graph/graph.c
lib/member/rte_member.c
lib/meson.build
lib/metrics/rte_metrics_telemetry.c
lib/net/rte_net_crc.c
lib/node/log.c
lib/pdump/rte_pdump.c
lib/rawdev/rte_rawdev.c
lib/rcu/rte_rcu_qsbr.c
lib/stack/rte_stack.c
lib/vhost/vhost.c