On Mon, May 4, 2020 at 10:38 PM David Marchand
<david.march...@redhat.com> wrote:
>
> On Mon, May 4, 2020 at 4:39 PM Jerin Jacob <jerinjac...@gmail.com> wrote:
> >
> > On Mon, May 4, 2020 at 7:34 PM David Marchand <david.march...@redhat.com> 
> > wrote:
> > >
> > > On Mon, May 4, 2020 at 4:47 AM Jerin Jacob <jerinjac...@gmail.com> wrote:
> > > >
> > > > On Mon, May 4, 2020 at 2:02 AM David Marchand 
> > > > <david.march...@redhat.com> wrote:
> > > > >
> > > > > RTE_TRACE_POINT_DEFINE and RTE_TRACE_POINT_REGISTER must come in 
> > > > > pairs.
> > > > > Merge them and let RTE_TRACE_POINT_REGISTER handle the constructor 
> > > > > part.
> > > >
> > > >
> > > > Initially, I thought of doing the same. But, later I realized that
> > > > this largely grows the number of constructors been called.
> > > > I had concerns about the boot time of the application and/or loading
> > > > the shared library, that the reason why spitting
> > > > as two so that constructor registers a burst of traces like rte_log.
> > >
> > > I am a bit skeptical.
> > > In terms of cycles and looking at __rte_trace_point_register() (which
> > > calls malloc), the cost of calling multiple constructors instead of
> > > one is negligible.
> >
> > We will have a lot tracepoints latter, each one translates to the
> > constructor may not be a good
> > improvement. The scope is limited only to register function so IMO it
> > is okay to have split
> > just like rte_log. I don't see any reason why it has to be a different
> > than rte_log.
>
> What is similar to rte_log?
> There is neither RTE_LOG_REGISTER macro, nor two-steps declaration of
> dynamic logtypes.


Here is an example of rte_log registration. Which has _one_
constructor and N number of
rte_log_register() underneath.

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);

}

>
>
> >
> > One of the thought process is, we probably remove the constructor
> > scheme to all other with DPDK
> > and replace it with a more register scheme. In such a case, we can
> > skip calling the constructor all tother
> > when trace is disabled.
>
> Sorry, but I have a hard time understanding your point.
> Are you talking about application boot time?

Yes. The optimization of application boottime time in case of static
binary and/or shared library(.so) load time.

>
>
> --
> David Marchand
>

Reply via email to