DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Jerin Jacob" <jerinjacobk@gmail.com>
Cc: "Jerin Jacob" <jerinj@marvell.com>,
	"Sunil Kumar Kori" <skori@marvell.com>, <dev@dpdk.org>,
	<techboard@dpdk.org>, "Ferruh Yigit" <ferruh.yigit@amd.com>
Subject: RE: [PATCH v2] eal: add build-time option to omit trace
Date: Thu, 19 Sep 2024 18:08:48 +0200	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F705@smartserver.smartshare.dk> (raw)
In-Reply-To: <CALBAE1NwtP6DEaJjNDr7Dx9FAjr7FtjJrF9nrz43E1L0io_zDQ@mail.gmail.com>

> From: Jerin Jacob [mailto:jerinjacobk@gmail.com]
> Sent: Thursday, 19 September 2024 17.49
> 
> On Thu, Sep 19, 2024 at 9:05 PM Morten Brørup <mb@smartsharesystems.com>
> wrote:
> >
> > > Could you share data with a real-world application of the elf size?
> > > 1)Without any change
> >
> > Size of the statically linked executable on the target file system:
> > 3,800,528 byte
> >
> > > 2)Only disabling via __rte_trace_point_emit_header_generic() .. aka below
> > > patch.
> >
> > 3,572,032 byte
> >
> > > 3)Full disable.
> >
> > 3,572,032 byte
> >
> > >
> > > I think, size command will spit out with different section's size.
> > > This data can be used to take decision and to know how much % it
> > > adding up?
> >
> > I.e. trace adds 228,496 byte = 6.4 % to the size of this specific
> executable.
> >
> > ~200 KB might not seem as much, but this is just omitting one module.
> > If other unused modules also add ~200 KB, it adds up.
> >
> > And I haven't done any significant additional memory footprint tuning.
> >
> >
> > > > > #define __rte_trace_point_emit_header_generic(t) \
> > > > > void *mem; \
> > > > > do { \
> > > > >   +      if (RTE_TRACE == 0) \
> > > > >   +             return \
> >
> > Tested without the RTE_TRACE==0 check, simply:
> >   void *mem; \
> >   do { \
> > +         return; \
> >           const uint64_t val = rte_atomic_load_explicit(t,
> rte_memory_order_acquire); \
> >
> > > > >         const uint64_t val = rte_atomic_load_explicit(t,
> > > > > rte_memory_order_acquire); \
> > > > >         if (likely(!(val & __RTE_TRACE_FIELD_ENABLE_MASK))) \
> > > > >                 return; \
> > > > >         mem = __rte_trace_mem_get(val); \
> > > > >         if (unlikely(mem == NULL)) \
> > > > >                 return; \
> > > > >         mem = __rte_trace_point_emit_ev_header(mem, val); \
> > > > > } while (0)
> >
> > I don't understand why your method uses as little memory as mine...
> 
> Compiler is start enough to understand those functions are NOP.

Yes, I understand why the compiler understands that this code is NOP.

But I don't understand why the tracepoints' values and names are not registered by the unmodified RTE_TRACE_POINT_REGISTER().

> 
> 
> > My method should also omit the trace points themselves, with their names and
> numbers, and their initialization.
> >
> > I haven't looked deeper into it.
> >
> > If your method of omitting trace is as efficient as all my ifdefs, I also
> prefer your method.
> > Simpler is better.
> >

  reply	other threads:[~2024-09-19 16:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-18  8:55 [PATCH] " Morten Brørup
2024-09-18  9:49 ` Jerin Jacob
2024-09-18 10:23   ` Morten Brørup
2024-09-19  8:06 ` [PATCH v2] " Morten Brørup
2024-09-19  8:51   ` Jerin Jacob
2024-09-19 13:15     ` Morten Brørup
2024-09-19 13:54       ` Jerin Jacob
2024-09-19 15:35         ` Morten Brørup
2024-09-19 15:49           ` Jerin Jacob
2024-09-19 16:08             ` Morten Brørup [this message]
2024-09-19 16:34               ` Jerin Jacob

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=98CBD80474FA8B44BF855DF32C47DC35E9F705@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=jerinj@marvell.com \
    --cc=jerinjacobk@gmail.com \
    --cc=skori@marvell.com \
    --cc=techboard@dpdk.org \
    /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).