DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Jerin Jacob <jerinjacobk@gmail.com>,
	Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Cc: dpdk-dev <dev@dpdk.org>, Thomas Monjalon <thomas@monjalon.net>,
	Bernard Iremonger <bernard.iremonger@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2 3/3] app/testpmd: qualify profiling statistics on burst size
Date: Thu, 9 Apr 2020 12:46:09 +0100	[thread overview]
Message-ID: <b7787893-bb1d-4827-fb53-1cf2549b2546@intel.com> (raw)
In-Reply-To: <CALBAE1OeuvLLb+XGeKoZptfheh9yKfwnKw83iAGyjk3ooBov4A@mail.gmail.com>

On 3/20/2020 6:13 AM, Jerin Jacob wrote:
> On Thu, Mar 19, 2020 at 7:21 PM Viacheslav Ovsiienko
> <viacheslavo@mellanox.com> wrote:
>>
>> The execution time of rx/tx burst routine depends on the burst size.
>> It would be meaningful to research this dependency, the patch
>> provides an extra profiling data per rx/tx burst size.
>>
>> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
> 
>> +#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
>> +       if (!(fwdprof_flags & (nrx_tx ? RECORD_CORE_CYCLES_TX
>> +                                     : RECORD_CORE_CYCLES_RX)))
>> +               return;
>> +       for (nb_pkt = 0; nb_pkt < MAX_PKT_BURST; nb_pkt++) {
>> +               nb_burst = nrx_tx ? pbs->pkt_retry_spread[nb_pkt]
>> +                                 : pbs->pkt_burst_spread[nb_pkt];
>> +               if (nb_burst == 0)
>> +                       continue;
>> +               printf("  CPU cycles/%u packet burst=%u (total cycles="
>> +                      "%"PRIu64" / total %s bursts=%u)\n",
>> +                      (unsigned int)nb_pkt,
>> +                      (unsigned int)(pbs->pkt_ticks_spread[nb_pkt] / nb_burst),
>> +                      pbs->pkt_ticks_spread[nb_pkt],
>> +                      nrx_tx ? "TX" : "RX", nb_burst);
>> +       }
>> +#endif
> 
> 
> # Thanks for this feature, IMO, It worth to mention in release notes.
> 
> # I see a lot of code get added under RTE_TEST_PMD_RECORD_CORE_CYCLES.
> I agree that it should be under RTE_TEST_PMD_RECORD_CORE_CYCLES. Since
> this flag is not
> by default, there is a risk of compilation issue when this flag is get enabled.
> IMO, it is better to move to _if (0)_ semantics to enable
> - performance when compiler opt-out the code.
> - It forces the compiler to check the compilation errors irrespective
> of the RTE_TEST_PMD_RECORD_CORE_CYCLES state.
> 
> Something like below,
> 
> static __rte_always_inline int
> testpmd_has_stats_feature(void)
> {
> #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
>         return RTE_TEST_PMD_RECORD_CORE_CYCLES ;
> #else
>         return 0;
> #endif
> }
> 
> 
> if (testpmd_has_stats_feature()) {
> 
> }
> 

Hi Jerin,

In this usage, compiler will removed the "if (0) { }" block, right?
I think this is good idea, we can use it other places too, including this one.

  reply	other threads:[~2020-04-09 11:46 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-26 12:48 [dpdk-dev] [PATCH] app/testpmd: add profiling for Rx/Tx burst routines Viacheslav Ovsiienko
2019-06-26 12:57 ` Bruce Richardson
2019-06-26 13:19   ` Slava Ovsiienko
2019-06-26 13:21     ` Bruce Richardson
2019-06-27  4:48       ` Slava Ovsiienko
2019-06-28 13:45         ` Iremonger, Bernard
2019-06-28 14:20           ` Bruce Richardson
2019-07-01  4:57             ` Slava Ovsiienko
2019-07-01  8:15               ` Bruce Richardson
2019-09-30 12:32                 ` Yigit, Ferruh
2020-03-19 13:50 ` [dpdk-dev] [PATCH v2 0/3] app/testpmd: qualify Rx/Tx profiling data on burst size Viacheslav Ovsiienko
2020-03-19 13:50   ` [dpdk-dev] [PATCH v2 1/3] app/testpmd: add profiling flags set command Viacheslav Ovsiienko
2020-04-02 11:15     ` Thomas Monjalon
2020-04-09 11:56     ` Ferruh Yigit
2020-04-13  7:56       ` Slava Ovsiienko
2020-04-13 12:23         ` Thomas Monjalon
2020-04-14  9:07         ` Ferruh Yigit
2020-03-19 13:50   ` [dpdk-dev] [PATCH v2 2/3] app/testpmd: gather Rx and Tx routines profiling Viacheslav Ovsiienko
2020-04-02 11:20     ` Thomas Monjalon
2020-04-02 11:23       ` Slava Ovsiienko
2020-03-19 13:50   ` [dpdk-dev] [PATCH v2 3/3] app/testpmd: qualify profiling statistics on burst size Viacheslav Ovsiienko
2020-03-20  6:13     ` Jerin Jacob
2020-04-09 11:46       ` Ferruh Yigit [this message]
2020-04-09 12:49         ` Jerin Jacob
2020-03-20 16:03     ` Andrzej Ostruszka
2020-04-02 11:21     ` Thomas Monjalon
2020-04-09 12:03     ` Ferruh Yigit
2020-04-09 12:09       ` Thomas Monjalon
2020-04-02 11:13   ` [dpdk-dev] [PATCH v2 0/3] app/testpmd: qualify Rx/Tx profiling data " 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=b7787893-bb1d-4827-fb53-1cf2549b2546@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerinjacobk@gmail.com \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@mellanox.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).