DPDK patches and discussions
 help / color / mirror / Atom feed
From: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
To: Olivier MATZ <olivier.matz@6wind.com>
Cc: "thomas.monjalon@6wind.com" <thomas.monjalon@6wind.com>,
	"stephen@networkplumber.org" <stephen@networkplumber.org>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v3] eal: redefine logtype values
Date: Wed, 19 Apr 2017 11:12:06 +0000	[thread overview]
Message-ID: <E115CCD9D858EF4F90C690B0DCB4D8974780C617@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <20170418115740.00d3b39f@glumotte.dev.6wind.com>



> -----Original Message-----
> From: Olivier MATZ [mailto:olivier.matz@6wind.com]
> Sent: Tuesday, April 18, 2017 10:58 AM
> To: De Lara Guarch, Pablo
> Cc: thomas.monjalon@6wind.com; stephen@networkplumber.org;
> dev@dpdk.org
> Subject: Re: [PATCH v3] eal: redefine logtype values
> 
> Hi Pablo,
> 
> On Thu, 13 Apr 2017 14:42:47 +0100, Pablo de Lara
> <pablo.de.lara.guarch@intel.com> wrote:
> > After the changes in commit c1b5fa94a46f
> > ("eal: support dynamic log types"), logtype is not treated as a
> > bitmask, but a decimal value. Therefore, values have to be
> > converted.
> >
> > Fixes: c1b5fa94a46f ("eal: support dynamic log types")
> >
> > Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> > ---
> >
> > Changes in v3:
> > - Created array of structures containing logtype id and string
> > - Added left shift to convert new decimal values to bitmask for backward
> compatibility
> >
> > Changes in v2:
> > - Used new RTE_LOGTYPE values in rte_log_init()
> >
> >  lib/librte_eal/common/eal_common_log.c  | 37 +++----------
> >  lib/librte_eal/common/include/rte_log.h | 94
> +++++++++++++++++++++++----------
> >  2 files changed, 73 insertions(+), 58 deletions(-)
> 
> [...]
> 
> 
> > @@ -111,6 +111,42 @@ extern struct rte_logs rte_logs;
> >  #define RTE_LOG_INFO     7U  /**< Informational.                    */
> >  #define RTE_LOG_DEBUG    8U  /**< Debug-level messages.             */
> >
> > +struct logtype {
> > +	uint32_t log_id;
> > +	char logtype[32];
> > +};
> > +
> > +static const struct logtype logtype_strings[] = {
> > +	{RTE_LOGTYPE_EAL,        "eal"},
> > +	{RTE_LOGTYPE_MALLOC,     "malloc"},
> > +	{RTE_LOGTYPE_RING,       "ring"},
> > +	{RTE_LOGTYPE_MEMPOOL,    "mempool"},
> > +	{RTE_LOGTYPE_TIMER,      "timer"},
> > +	{RTE_LOGTYPE_PMD,        "pmd"},
> > +	{RTE_LOGTYPE_HASH,       "hash"},
> > +	{RTE_LOGTYPE_LPM,        "lpm"},
> > +	{RTE_LOGTYPE_KNI,        "kni"},
> > +	{RTE_LOGTYPE_ACL,        "acl"},
> > +	{RTE_LOGTYPE_POWER,      "power"},
> > +	{RTE_LOGTYPE_METER,      "meter"},
> > +	{RTE_LOGTYPE_SCHED,      "sched"},
> > +	{RTE_LOGTYPE_PORT,       "port"},
> > +	{RTE_LOGTYPE_TABLE,      "table"},
> > +	{RTE_LOGTYPE_PIPELINE,   "pipeline"},
> > +	{RTE_LOGTYPE_MBUF,       "mbuf"},
> > +	{RTE_LOGTYPE_CRYPTODEV,  "cryptodev"},
> > +	{RTE_LOGTYPE_EFD,        "efd"},
> > +	{RTE_LOGTYPE_EVENTDEV,   "eventdev"},
> > +	{RTE_LOGTYPE_USER1,      "user1"},
> > +	{RTE_LOGTYPE_USER2,      "user2"},
> > +	{RTE_LOGTYPE_USER3,      "user3"},
> > +	{RTE_LOGTYPE_USER4,      "user4"},
> > +	{RTE_LOGTYPE_USER5,      "user5"},
> > +	{RTE_LOGTYPE_USER6,      "user6"},
> > +	{RTE_LOGTYPE_USER7,      "user7"},
> > +	{RTE_LOGTYPE_USER8,      "user8"}
> > +};
> > +
> >  /**
> >   * Change the stream that will be used by the logging system.
> >   *
> 
> Could it go in eal_common_log.c instead? I think we don't need it in
> the header file, and it would avoid to pollute the global namespace.
> 
> Apart from that, I tested the patch and it works. Thanks!

Sure, good idea. Will send a v4 shortly.

> 
> I wonder if we can now remove the use or USERx logs in apps.
> It still has to work for compat, but it would be better to register
> a new logtype instead. I have a patch to do that in testpmd, I'll
> send it today. Not sure it should go in the release or not.

Yes, I think we need to start moving the apps to use the new logs (and the libraries, right?).
Probably a bit late to do it in this release, I think it can wait until the next one.

Pablo
> 
> Regards,
> Olivier

  reply	other threads:[~2017-04-19 11:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-12 14:14 [dpdk-dev] [PATCH] " Pablo de Lara
2017-04-12 15:15 ` Thomas Monjalon
2017-04-12 15:22   ` De Lara Guarch, Pablo
2017-04-12 15:35 ` [dpdk-dev] [PATCH v2] " Pablo de Lara
2017-04-12 19:23   ` Olivier MATZ
2017-04-13  8:32     ` De Lara Guarch, Pablo
2017-04-13  9:09       ` De Lara Guarch, Pablo
2017-04-12 21:41   ` Stephen Hemminger
2017-04-13 13:43     ` De Lara Guarch, Pablo
2017-04-13 13:42   ` [dpdk-dev] [PATCH v3] " Pablo de Lara
2017-04-18  9:57     ` Olivier MATZ
2017-04-19 11:12       ` De Lara Guarch, Pablo [this message]
2017-04-19 11:22     ` [dpdk-dev] [PATCH] " Pablo de Lara
2017-04-19 11:23       ` De Lara Guarch, Pablo
2017-04-19 11:24     ` [dpdk-dev] [PATCH v4] " Pablo de Lara
2017-04-19 12:15       ` Olivier MATZ
2017-04-19 13:46         ` De Lara Guarch, Pablo
2017-04-19 14:06       ` [dpdk-dev] [PATCH v5] " Pablo de Lara
2017-04-19 14:16         ` Olivier MATZ
2017-04-19 22:49           ` 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=E115CCD9D858EF4F90C690B0DCB4D8974780C617@IRSMSX108.ger.corp.intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=dev@dpdk.org \
    --cc=olivier.matz@6wind.com \
    --cc=stephen@networkplumber.org \
    --cc=thomas.monjalon@6wind.com \
    /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).