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 CC40FA04B0; Fri, 4 Dec 2020 10:09:31 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0967B37AF; Fri, 4 Dec 2020 10:09:30 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 5B172375B for ; Fri, 4 Dec 2020 10:09:28 +0100 (CET) IronPort-SDR: OGiHBCtGTMMtBuYPKzRILfEeevB4weKjXekrGSE+ZwfhI9tlN2mbWNjYx5EtveaK1lkK5Mc+0X cShjxPXCkS5g== X-IronPort-AV: E=McAfee;i="6000,8403,9824"; a="170782276" X-IronPort-AV: E=Sophos;i="5.78,392,1599548400"; d="scan'208";a="170782276" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2020 01:09:24 -0800 IronPort-SDR: +iEI+jf0onsdDKX+xAY/KnkrSYxJk6/DPlo3VkU8TLNy094JXEAX/1QaT8z76zBhFTivJ/2/Xk BLLMkce2a4nw== X-IronPort-AV: E=Sophos;i="5.78,392,1599548400"; d="scan'208";a="336312441" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.246.65]) ([10.213.246.65]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2020 01:09:23 -0800 To: Hideyuki Yamashita Cc: dev@dpdk.org, David Hunt References: <20201204075109.14694-1-yamashita.hideyuki@ntt-tx.co.jp> From: Ferruh Yigit Message-ID: <99198db3-5cbc-04f4-9d4e-db73244f04f0@intel.com> Date: Fri, 4 Dec 2020 09:09:20 +0000 MIME-Version: 1.0 In-Reply-To: <20201204075109.14694-1-yamashita.hideyuki@ntt-tx.co.jp> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH 0/5] add apistats function 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 12/4/2020 7:51 AM, Hideyuki Yamashita wrote: > In general, DPDK application consumes CPU usage because it polls > incoming packets using rx_burst API in infinite loop. > This makes difficult to estimate how much CPU usage is really > used to send/receive packets by the DPDK application. > > For example, even if no incoming packets arriving, CPU usage > looks nearly 100% when observed by top command. > > It is beneficial if developers can observe real CPU usage of the > DPDK application. > Such information can be exported to monitoring application like > prometheus/graphana and shows CPU usage graphically. > > To achieve above, this patch set provides apistats functionality. > apistats provides the followiing two counters for each lcore. > - rx_burst_counts[RTE_MAX_LCORE] > - tx_burst_counts[RTE_MAX_LCORE] > Those accumulates rx_burst/tx_burst counts since the application starts. > > By using those values, developers can roughly estimate CPU usage. > Let us assume a DPDK application is simply forwarding packets. > It calls tx_burst only if it receive packets. > If rx_burst_counts=1000 and tx_burst_count=1000 during certain > period of time, one can assume CPU usage is 100%. > If rx_burst_counts=1000 and tx_burst_count=100 during certain > period of time, one can assume CPU usage is 10%. > Here we assumes that tx_burst_count equals counts which rx_burst function > really receives incoming packets. > > > This patch set provides the following. > - basic API counting functionality(apistats) into librte_ethdev > - add code to testpmd to accumulate counter information > - add code to proc-info to retrieve above mentioned counter information > - add description in proc-info document about --apistats parameter > - modify MAINTAINERS file for apistats.c and apistats.h > > Hideyuki Yamashita (5): > maintainers: update maintainers file for apistats > app/proc-info: add to use apistats > app/test-pmd: add to use apistats > docs: add description of apistats parameter into proc-info > librte_ethdev: add to use apistats > > MAINTAINERS | 3 ++ > app/proc-info/main.c | 46 +++++++++++++++++++++++ > app/test-pmd/testpmd.c | 4 ++ > doc/guides/tools/proc_info.rst | 10 ++++- > lib/librte_ethdev/meson.build | 6 ++- > lib/librte_ethdev/rte_apistats.c | 64 ++++++++++++++++++++++++++++++++ > lib/librte_ethdev/rte_apistats.h | 64 ++++++++++++++++++++++++++++++++ > lib/librte_ethdev/rte_ethdev.h | 7 ++++ > lib/librte_ethdev/version.map | 5 +++ > 9 files changed, 205 insertions(+), 4 deletions(-) > create mode 100644 lib/librte_ethdev/rte_apistats.c > create mode 100644 lib/librte_ethdev/rte_apistats.h > cc'ed Dave Hunt. As far as I remember he did something for same goal in the past, but in a different way, he can comment better.