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 2472BA04B0; Fri, 4 Dec 2020 08:51:43 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 72968375B; Fri, 4 Dec 2020 08:51:41 +0100 (CET) Received: from dish-sg.nttdocomo.co.jp (dish-sg.nttdocomo.co.jp [202.19.227.74]) by dpdk.org (Postfix) with ESMTP id 62C8634F3 for ; Fri, 4 Dec 2020 08:51:39 +0100 (CET) X-dD-Source: Outbound Received: from zssg-mailmd103.ddreams.local (zssg-mailmd900.ddreams.local [10.160.172.63]) by zssg-mailou103.ddreams.local (Postfix) with ESMTP id A281F120107 for ; Fri, 4 Dec 2020 16:51:37 +0900 (JST) Received: from zssg-mailmf101.ddreams.local (zssg-mailmf900.ddreams.local [10.160.172.84]) by zssg-mailmd103.ddreams.local (dDREAMS) with ESMTP id <0QKT00JM91TXFD60@dDREAMS>; Fri, 04 Dec 2020 16:51:37 +0900 (JST) Received: from zssg-mailmf101.ddreams.local (unknown [127.0.0.1]) by zssg-mailmf101.ddreams.local (Postfix) with ESMTP id 7114D7E603B; Fri, 4 Dec 2020 16:51:37 +0900 (JST) Received: from zssg-mailmf101.ddreams.local (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 703C38E605C; Fri, 4 Dec 2020 16:51:37 +0900 (JST) Received: from localhost (unknown [127.0.0.1]) by IMSVA (Postfix) with SMTP id 6E4168E6058; Fri, 4 Dec 2020 16:51:37 +0900 (JST) X-IMSS-HAND-OFF-DIRECTIVE: localhost:10026 Received: from zssg-mailmf101.ddreams.local (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7C16F8E6058; Fri, 4 Dec 2020 16:51:36 +0900 (JST) Received: from davinci.ntt-tx.co.jp (unknown [10.160.183.139]) by zssg-mailmf101.ddreams.local (Postfix) with ESMTP; Fri, 4 Dec 2020 16:51:36 +0900 (JST) From: Hideyuki Yamashita To: Cc: dev@dpdk.org, Hideyuki Yamashita Date: Fri, 04 Dec 2020 16:51:04 +0900 Message-id: <20201204075109.14694-1-yamashita.hideyuki@ntt-tx.co.jp> X-Mailer: git-send-email 2.28.0 MIME-version: 1.0 Content-transfer-encoding: 8bit X-TM-AS-GCONF: 00 Subject: [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" 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 -- 2.18.0