DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Thomas Monjalon <thomas@monjalon.net>
Cc: dev@dpdk.org, andrew.rybchenko@oktetlabs.ru,
	ferruh.yigit@intel.com,
	David Marchand <david.marchand@redhat.com>
Subject: Re: [dpdk-dev] [PATCH v3] log: register with standardized names
Date: Tue, 11 May 2021 12:49:11 +0100	[thread overview]
Message-ID: <YJpvN2TagX7lXIL5@bricha3-MOBL.ger.corp.intel.com> (raw)
In-Reply-To: <20210511100927.824319-1-thomas@monjalon.net>

On Tue, May 11, 2021 at 12:09:27PM +0200, Thomas Monjalon wrote:
> From: David Marchand <david.marchand@redhat.com>
> 
> 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, baseband, bus and
> mempool drivers.
> 
> $ git grep -l RTE_LOG_REGISTER drivers/ |
>   while read file; do
>     pattern=${file##drivers/};
>     class=${pattern%%/*};
>     pattern=${pattern#$class/};
>     pattern=pmd.$class.${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
> 
> $ 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>
> ---
> 
> Changes since v2:
> - use RTE_LOG_REGISTER_DEFAULT in baseband, bus, mempool
>   by adding the variable log_prefix in drivers/meson.build
> 
> Changes since v1:
> - moved default logtype generation in the build system,
> - rebased,
> - reverted net/bonding change,
> 
<snip>
> diff --git a/doc/guides/contributing/coding_style.rst b/doc/guides/contributing/coding_style.rst
> index 7601162c4f..f58ae948ff 100644
> --- a/doc/guides/contributing/coding_style.rst
> +++ b/doc/guides/contributing/coding_style.rst
> @@ -986,6 +986,12 @@ includes
>  
>  	includes += include_directories('base')
>  
> +log_prefix
> +	**Default Value = pmd.<class>**
> +	Some driver classes have a customized log prefix.
> +	This prefix is combined with the driver name
> +	when registering a default log name for the driver.
> +

I don't think this should be added here. This section is for elements to be
defined in the meson.build file of each individual driver. This value,
though, is to be defined per class, rather than per-driver. We don't have a
doc section for that, but perhaps one is needed.

For now, I'd just omit documenting this value as it should only be of
relevance for the couple of existing driver classes that use it. Nobody
else contributing new code to DPDK should need it.

/Bruce

  parent reply	other threads:[~2021-05-11 11:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09 12:43 [dpdk-dev] [PATCH] log: deduce log type from filename David Marchand
2021-04-09 13:01 ` Bruce Richardson
2021-04-13 15:07   ` David Marchand
2021-04-26 12:51 ` [dpdk-dev] [PATCH v2] log: register with standardized names David Marchand
2021-05-11 10:09 ` [dpdk-dev] [PATCH v3] " Thomas Monjalon
2021-05-11 11:15   ` David Marchand
2021-05-11 11:49   ` Bruce Richardson [this message]
2021-05-11 12:01     ` Thomas Monjalon
2021-05-11 11:59   ` Bruce Richardson
2021-05-11 12:10     ` Thomas Monjalon
2021-05-11 12:24       ` Bruce Richardson
2021-05-11 12:38 ` [dpdk-dev] [PATCH v4] " Thomas Monjalon
2021-05-11 12:52   ` Bruce Richardson
2021-05-11 13:21     ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YJpvN2TagX7lXIL5@bricha3-MOBL.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).