DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerinjacobk@gmail.com>
To: David Marchand <david.marchand@redhat.com>
Cc: Thomas Monjalon <thomas@monjalon.net>, dpdk-dev <dev@dpdk.org>,
	Jerin Jacob <jerinj@marvell.com>,
	 Sunil Kumar Kori <skori@marvell.com>,
	John McNamara <john.mcnamara@intel.com>,
	 Marko Kovacevic <marko.kovacevic@intel.com>,
	Declan Doherty <declan.doherty@intel.com>,
	 Ferruh Yigit <ferruh.yigit@intel.com>,
	Andrew Rybchenko <arybchenko@solarflare.com>,
	 Olivier Matz <olivier.matz@6wind.com>
Subject: Re: [dpdk-dev] [PATCH 2/8] trace: simplify trace point registration
Date: Tue, 5 May 2020 22:16:24 +0530	[thread overview]
Message-ID: <CALBAE1PJTfdHij_aNnOxiYgqVjBSgptdV2ebJJ86bu3gCsT9cQ@mail.gmail.com> (raw)
In-Reply-To: <CAJFAV8yDoMTSR9wOv9tp3r8aDKvzKFMv1J_JV1ThU45TRaGpew@mail.gmail.com>

On Tue, May 5, 2020 at 9:58 PM David Marchand <david.marchand@redhat.com> wrote:
>
> On Tue, May 5, 2020 at 5:25 PM Jerin Jacob <jerinjacobk@gmail.com> wrote:
> >
> > On Tue, May 5, 2020 at 5:56 PM Jerin Jacob <jerinjacobk@gmail.com> wrote:
> > >
> > > On Tue, May 5, 2020 at 5:06 PM David Marchand <david.marchand@redhat.com> wrote:
> > > >
> > > > On Tue, May 5, 2020 at 12:13 PM Jerin Jacob <jerinjacobk@gmail.com> wrote:
> > > > > > > Please share the data.
> > > > > >
> > > > > > Measured time between first rte_trace_point_register and last one with
> > > > > > a simple patch:
> > > > >
> > > > > I will try to reproduce this, once we finalize on the above synergy
> > > > > with rte_log.
> > > >
> > > > I took the time to provide measure but you won't take the time to look at this.
> > >
> > > I will spend time on this. I would like to test with a shared library
> > > also and more tracepoints.
> > > I was looking for an agreement on using the constructor for rte_log as
> > > well(Just make sure the direction is correct).
> > >
> > > Next steps:
> > > - I will analyze the come back on this overhead on this thread.
> >
> > I have added 500 constructors for testing the overhead with the shared
> > build and static build.
> > My results inline with your results aka negligible overhead.
> >
> > David,
> > Do you have plan for similar RTE_LOG_REGISTER as mentioned earlier?
> > I would like to have rte_log and rte_trace semantics similar to registration.
> > If you are not planning to submit the rte_log patch then I can send
> > one for RC2 cleanup.
>
> It won't be possible for me.

I can do that if we agree on the specifics.


>
> Relying on the current rte_log_register is buggy with shared builds,
> as drivers are calling rte_log_register, then impose a default level
> without caring about what the user passed.
> So if we introduce a RTE_LOG_REGISTER macro now at least this must be fixed too.
>
> What I wanted to do:
> - merge rte_log_register_and_pick_level() (experimental) into
> rte_log_register, doing this should be fine from my pov,
> - reconsider the relevance of a fallback logtype when registration fails,
> - shoot the default level per component thing: levels meaning is
> fragmented across the drivers/libraries because of it, but this will
> open a big box of stuff,

This you are referring to internal implementation improvement. Right?
I was referring to remove the current clutter[1]
If we stick the following as the interface. Then you can do other
improvements when you get time
that won't change the consumer code or interference part.

#define RTE_LOG_REGISTER(type, name, level)

[1]
> > -/**
> > - * @internal
> > - */
> > -int otx2_logtype_base;
> > -/**
> > - * @internal
> > - */
> > -int otx2_logtype_mbox;
> > -/**
> > - * @internal
> > - */
> > -int otx2_logtype_npa;
> > -/**
> > - * @internal
> > - */
> > -int otx2_logtype_nix;
> > -/**
> > - * @internal
> > - */
> > -int otx2_logtype_npc;
> > -/**
> > - * @internal
> > - */
> > -int otx2_logtype_tm;
> > -/**
> > - * @internal
> > - */
> > -int otx2_logtype_sso;
> > -/**
> > - * @internal
> > - */
> > -int otx2_logtype_tim;
> > -/**
> > - * @internal
> > - */
> > -int otx2_logtype_dpi;
> > -/**
> > - * @internal
> > - */
> > -int otx2_logtype_ep;
> > -
> > -RTE_INIT(otx2_log_init);
> > -static void
> > -otx2_log_init(void)
> > -{
> > -       otx2_logtype_base = rte_log_register("pmd.octeontx2.base");
> > -       if (otx2_logtype_base >= 0)
> > -               rte_log_set_level(otx2_logtype_base, RTE_LOG_NOTICE);
> > -
> > -       otx2_logtype_mbox = rte_log_register("pmd.octeontx2.mbox");
> > -       if (otx2_logtype_mbox >= 0)
> > -               rte_log_set_level(otx2_logtype_mbox, RTE_LOG_NOTICE);
> > -
> > -       otx2_logtype_npa = rte_log_register("pmd.mempool.octeontx2");
> > -       if (otx2_logtype_npa >= 0)
> > -               rte_log_set_level(otx2_logtype_npa, RTE_LOG_NOTICE);
> > -
> > -       otx2_logtype_nix = rte_log_register("pmd.net.octeontx2");
> > -       if (otx2_logtype_nix >= 0)
> > -               rte_log_set_level(otx2_logtype_nix, RTE_LOG_NOTICE);
> > -
> > -       otx2_logtype_npc = rte_log_register("pmd.net.octeontx2.flow");
> > -       if (otx2_logtype_npc >= 0)
> > -               rte_log_set_level(otx2_logtype_npc, RTE_LOG_NOTICE);
> > -
> > -       otx2_logtype_tm = rte_log_register("pmd.net.octeontx2.tm");
> > -       if (otx2_logtype_tm >= 0)
> > -               rte_log_set_level(otx2_logtype_tm, RTE_LOG_NOTICE);
> > -
> > -       otx2_logtype_sso = rte_log_register("pmd.event.octeontx2");
> > -       if (otx2_logtype_sso >= 0)
> > -               rte_log_set_level(otx2_logtype_sso, RTE_LOG_NOTICE);
> > -
> > -       otx2_logtype_tim = rte_log_register("pmd.event.octeontx2.timer");
> > -       if (otx2_logtype_tim >= 0)
> > -               rte_log_set_level(otx2_logtype_tim, RTE_LOG_NOTICE);
> > -
> > -       otx2_logtype_dpi = rte_log_register("pmd.raw.octeontx2.dpi");
> > -       if (otx2_logtype_dpi >= 0)
> > -               rte_log_set_level(otx2_logtype_dpi, RTE_LOG_NOTICE);
> > -
> > -       otx2_logtype_ep = rte_log_register("pmd.raw.octeontx2.ep");
> > -       if (otx2_logtype_ep >= 0)
> > -               rte_log_set_level(otx2_logtype_ep, RTE_LOG_NOTICE);
> > -
> > -}
> > +RTE_LOG_REGISTER(otx2_logtype_base, pmd.octeontx2.base, NOTICE);
> > +RTE_LOG_REGISTER(otx2_logtype_mbox, pmd.octeontx2.mbox, NOTICE);
> > +RTE_LOG_REGISTER(otx2_logtype_npa, pmd.mempool.octeontx2, NOTICE);
> > +RTE_LOG_REGISTER(otx2_logtype_nix, pmd.net.octeontx2, NOTICE);
> > +RTE_LOG_REGISTER(otx2_logtype_npc, pmd.net.octeontx2.flow, NOTICE);
> > +RTE_LOG_REGISTER(otx2_logtype_tm, pmd.net.octeontx2.tm, NOTICE);
> > +RTE_LOG_REGISTER(otx2_logtype_sso, pmd.event.octeontx2, NOTICE);
> > +RTE_LOG_REGISTER(otx2_logtype_tim, pmd.event.octeontx2.timer, NOTICE);
> > +RTE_LOG_REGISTER(otx2_logtype_dpi, pmd.raw.octeontx2.dpi, NOTICE);
> > +RTE_LOG_REGISTER(otx2_logtype_ep, pmd.raw.octeontx2.ep, NOTICE);
> >
> > diff --git a/lib/librte_eal/include/rte_log.h b/lib/librte_eal/include/rte_log.h
> > index 1789ede56..22fc3802f 100644
> > --- a/lib/librte_eal/include/rte_log.h
> > +++ b/lib/librte_eal/include/rte_log.h
> > @@ -376,6 +376,15 @@ int rte_vlog(uint32_t level, uint32_t logtype,
> > const char *format, va_list ap)
> >                  RTE_LOGTYPE_ ## t, # t ": " __VA_ARGS__) :     \
> >          0)
> >
> > +#define RTE_LOG_REGISTER(type, name, level)                            \
> > +int type;                                                              \
> > +RTE_INIT(__##type)                                                     \
> > +{                                                                      \
> > +       type = rte_log_register(RTE_STR(name));                         \
> > +       if (type >= 0)                                                  \
> > +               rte_log_set_level(type, RTE_LOG_##level);               \
> > +}
> > +
>



>
>
>
> --
> David Marchand
>

  reply	other threads:[~2020-05-05 16:46 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-03 20:31 [dpdk-dev] [PATCH 0/8] Traces cleanup for rc2 David Marchand
2020-05-03 20:31 ` [dpdk-dev] [PATCH 1/8] cryptodev: fix trace points registration David Marchand
2020-05-04  7:41   ` [dpdk-dev] [EXT] " Sunil Kumar Kori
2020-05-03 20:31 ` [dpdk-dev] [PATCH 2/8] trace: simplify trace point registration David Marchand
2020-05-04  2:46   ` Jerin Jacob
2020-05-04 14:02     ` Thomas Monjalon
2020-05-04 14:04     ` David Marchand
2020-05-04 14:39       ` Jerin Jacob
2020-05-04 17:08         ` David Marchand
2020-05-04 17:19           ` Jerin Jacob
2020-05-04 17:40             ` David Marchand
2020-05-04 17:54               ` Jerin Jacob
2020-05-04 21:31                 ` Thomas Monjalon
2020-05-05  3:43                   ` Jerin Jacob
2020-05-05  7:01                     ` Thomas Monjalon
2020-05-05  7:17                       ` Jerin Jacob
2020-05-05  7:24                         ` Thomas Monjalon
2020-05-05  7:33                           ` Jerin Jacob
2020-05-05  8:23                             ` David Marchand
2020-05-05 10:12                               ` Jerin Jacob
2020-05-05 10:26                                 ` Thomas Monjalon
2020-05-05 10:46                                   ` Jerin Jacob
2020-05-05 11:48                                     ` Olivier Matz
2020-05-05 11:35                                 ` David Marchand
2020-05-05 12:26                                   ` Jerin Jacob
2020-05-05 15:25                                     ` Jerin Jacob
2020-05-05 16:28                                       ` David Marchand
2020-05-05 16:46                                         ` Jerin Jacob [this message]
2020-05-05 16:58                                           ` Thomas Monjalon
2020-05-05 17:08                                             ` Jerin Jacob
2020-05-05 17:09                                               ` Jerin Jacob
2020-05-05 17:20                                                 ` Thomas Monjalon
2020-05-05 17:28                                                   ` Jerin Jacob
2020-05-05 20:10                                                     ` Thomas Monjalon
2020-05-06  6:11                                                       ` Jerin Jacob
2020-07-04 14:31   ` Jerin Jacob
2020-07-04 15:14   ` [dpdk-dev] [PATCH v2] " David Marchand
2020-07-05 19:41     ` Thomas Monjalon
2020-05-03 20:31 ` [dpdk-dev] [PATCH 3/8] trace: simplify trace point headers David Marchand
2020-05-04  6:12   ` Jerin Jacob
2020-05-03 20:31 ` [dpdk-dev] [PATCH 4/8] trace: avoid confusion on optarg David Marchand
2020-05-04  7:55   ` [dpdk-dev] [EXT] " Sunil Kumar Kori
2020-05-04 14:09     ` David Marchand
2020-05-05  5:45       ` Sunil Kumar Kori
2020-05-05  5:47         ` Sunil Kumar Kori
2020-05-03 20:31 ` [dpdk-dev] [PATCH 5/8] trace: remove unneeded checks in internal API David Marchand
2020-05-04  8:16   ` [dpdk-dev] [EXT] " Sunil Kumar Kori
2020-05-03 20:31 ` [dpdk-dev] [PATCH 6/8] trace: remove limitation on patterns number David Marchand
2020-05-04  8:48   ` [dpdk-dev] [EXT] " Sunil Kumar Kori
2020-05-04 14:14     ` David Marchand
2020-05-05  5:54       ` Sunil Kumar Kori
2020-05-03 20:31 ` [dpdk-dev] [PATCH 7/8] trace: remove string duplication David Marchand
2020-05-04  9:01   ` [dpdk-dev] [EXT] " Sunil Kumar Kori
2020-05-03 20:31 ` [dpdk-dev] [PATCH 8/8] trace: fix build with gcc 10 David Marchand
2020-05-06 13:06 ` [dpdk-dev] [PATCH 0/8] Traces cleanup for rc2 David Marchand

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=CALBAE1PJTfdHij_aNnOxiYgqVjBSgptdV2ebJJ86bu3gCsT9cQ@mail.gmail.com \
    --to=jerinjacobk@gmail.com \
    --cc=arybchenko@solarflare.com \
    --cc=david.marchand@redhat.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jerinj@marvell.com \
    --cc=john.mcnamara@intel.com \
    --cc=marko.kovacevic@intel.com \
    --cc=olivier.matz@6wind.com \
    --cc=skori@marvell.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).