diff options
| author | David Marchand <[email protected]> | 2021-04-26 14:51:08 +0200 |
|---|---|---|
| committer | Thomas Monjalon <[email protected]> | 2021-05-11 15:17:55 +0200 |
| commit | eeded2044af5bbe88220120b14933536cbb3edb6 (patch) | |
| tree | 8a3687f81d55b1d4aa1accaa71e943db5f7c3289 /lib/bbdev | |
| parent | be81f77d807720f01e72e38502c2ca613b36b726 (diff) | |
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 <[email protected]>
Signed-off-by: Thomas Monjalon <[email protected]>
Acked-by: Bruce Richardson <[email protected]>
Diffstat (limited to 'lib/bbdev')
| -rw-r--r-- | lib/bbdev/rte_bbdev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bbdev/rte_bbdev.c b/lib/bbdev/rte_bbdev.c index 5ba891c232..fc37236195 100644 --- a/lib/bbdev/rte_bbdev.c +++ b/lib/bbdev/rte_bbdev.c @@ -29,7 +29,7 @@ /* BBDev library logging ID */ -RTE_LOG_REGISTER(bbdev_logtype, lib.bbdev, NOTICE); +RTE_LOG_REGISTER_DEFAULT(bbdev_logtype, NOTICE); /* Helper macro for logging */ #define rte_bbdev_log(level, fmt, ...) \ |
