From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6C993A0583; Fri, 20 Mar 2020 07:13:43 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 49240F94; Fri, 20 Mar 2020 07:13:42 +0100 (CET) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by dpdk.org (Postfix) with ESMTP id 03150F90 for ; Fri, 20 Mar 2020 07:13:40 +0100 (CET) Received: by mail-io1-f68.google.com with SMTP id c25so4861402ioi.5 for ; Thu, 19 Mar 2020 23:13:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ob45FGL+Ff8q4lcnt2AqhlbAzfX/TZ3L1DHShkSw86M=; b=drCADIp1cbKWFah16EbFgqFi/lxy6DKkVAi3mi/2mNbrH6JtsLgHsX7nJ4IwwITjMj SWvL+AZTCWpJ8qElzj/toWHEddu95Y97OAfnq26VYIEhRmlDISyVhuBC3zlR0pV9WZ31 ZhpRI+hp2nAVkzojbvs03Hh0rZWRqnnJbZ8L7Lpt7VMPfk+BqE5j8+iFY1V6t3skOq2K jjUEe5E9uwPui8MWc8svRwdi0tinTOcXaF9OuWjUgK0SlyfxHMJ2L9e29AFdD3XNOMmR 4Gb+hK7CNxhfTvPQEjqs58sXerXujDoekPEl+nDkPBb8F7pttUaJuWjlMHXeJJd4/2uc czow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ob45FGL+Ff8q4lcnt2AqhlbAzfX/TZ3L1DHShkSw86M=; b=pkb0YiPE4qMVX156o9T0x80c2D49qyjrv79073LG42QsfTb9ma9ZUnVbMWpSJBXmyq 1v+tQfwHC4msX1Z7vfJCmaOCUDuHtCqOMmLzuZid2/xjmtpkBhGVqhi31KQhsmdBiy3R yKN0au5a8r4rsvklp8r1QW6Y7p8uaSEaA/AKW1jgaiCgVCJRCy9q8FBlUyewT1u/8nzW BQF6EY5+wT1WhOBIwa9YAyv1HgMbAgplkayVJRnRWQkZDgb5RA3pcsD7YR6DyEQhgKj1 YjO5HW0N1L/9z4NkEAXaBZt1lCeugw6Es/1wKJ6sVfwpb1x/Img2x/t1in6WEB52/pSD OgrQ== X-Gm-Message-State: ANhLgQ0Od0m2eHotY9nW6xrQSyPFgcA6RVHFL8ZTcwMDXYOSmAaB9l1Z gDxDHI306Px8rnB3n0hpaJO/RJnCLiOGuoj/gWI= X-Google-Smtp-Source: ADFU+vssHWiaaANHkVEP1hRJY7IaYPee62fhZH4yg/X7SNH9l3I0RmfuvfLW0IQg9wmEnEfGj7hEm9UuyC/b7TEp5lE= X-Received: by 2002:a05:6638:1ad:: with SMTP id b13mr6453433jaq.60.1584684820207; Thu, 19 Mar 2020 23:13:40 -0700 (PDT) MIME-Version: 1.0 References: <1561553317-16777-1-git-send-email-viacheslavo@mellanox.com> <1584625851-10291-1-git-send-email-viacheslavo@mellanox.com> <1584625851-10291-4-git-send-email-viacheslavo@mellanox.com> In-Reply-To: <1584625851-10291-4-git-send-email-viacheslavo@mellanox.com> From: Jerin Jacob Date: Fri, 20 Mar 2020 11:43:24 +0530 Message-ID: To: Viacheslav Ovsiienko Cc: dpdk-dev , Ferruh Yigit , Thomas Monjalon , Bernard Iremonger Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2 3/3] app/testpmd: qualify profiling statistics on burst size X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Mar 19, 2020 at 7:21 PM Viacheslav Ovsiienko 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 > +#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()) { }