From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 16F0D1DBD; Mon, 18 Mar 2019 12:35:59 +0100 (CET) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (webmail.solarflare.com [12.187.104.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id CC292780055; Mon, 18 Mar 2019 11:35:57 +0000 (UTC) Received: from ocex03.SolarFlarecom.com (10.20.40.36) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 18 Mar 2019 04:35:54 -0700 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Mon, 18 Mar 2019 04:35:53 -0700 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id x2IBZq8u008197; Mon, 18 Mar 2019 11:35:52 GMT Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id 762BA1627FE; Mon, 18 Mar 2019 11:35:52 +0000 (GMT) From: Andrew Rybchenko To: Wenzhuo Lu , Jingjing Wu , Bernard Iremonger CC: , Igor Romanov , Date: Mon, 18 Mar 2019 11:35:47 +0000 Message-ID: <1552908947-18120-1-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24496.005 X-TM-AS-Result: No-6.251200-4.000000-10 X-TMASE-MatchedRID: fFu+wrUioa1PT18L1PHrrVVN8laWo90M8x+JsCOVqikNgi5eVrkrGRFu p4CINH3JK9arbN0JZhuN2PAB92r10uztpCSqSkXK4pdq9sdj8LV9LQinZ4QefPcjNeVeWlqY+gt Hj7OwNO2BMV0kqc2hZEzJD0kbtlBDSXTxRQj1ex58iAcjRxwHH2f0wN78BSiPVlxr1FJij9s= X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--6.251200-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24496.005 X-MDID: 1552908958-eI0lWcSs659E Subject: [dpdk-dev] [PATCH] app/testpmd: fix stdout flush absence after printing stats 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: , X-List-Received-Date: Mon, 18 Mar 2019 11:35:59 -0000 From: Igor Romanov User can specify stats period(n). The statistics should be available to user every n second. But the print_stats() function does not force stdout to be flushed, so for instance, a user reading testpmd's stdout through pipe will not be able to read it untill the stdout buffer is filled. Fixes: cfea1f3048d1 ("app/testpmd: print statistics periodically") Cc: stable@dpdk.org Signed-off-by: Igor Romanov Signed-off-by: Andrew Rybchenko --- app/test-pmd/testpmd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index d9d0c16d4..216be47f9 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -3046,6 +3046,8 @@ print_stats(void) printf("\nPort statistics ===================================="); for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) nic_stats_display(fwd_ports_ids[i]); + + fflush(stdout); } static void -- 2.17.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 933E9A05FE for ; Mon, 18 Mar 2019 12:36:01 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 88D7725A1; Mon, 18 Mar 2019 12:36:00 +0100 (CET) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 16F0D1DBD; Mon, 18 Mar 2019 12:35:59 +0100 (CET) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (webmail.solarflare.com [12.187.104.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id CC292780055; Mon, 18 Mar 2019 11:35:57 +0000 (UTC) Received: from ocex03.SolarFlarecom.com (10.20.40.36) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 18 Mar 2019 04:35:54 -0700 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Mon, 18 Mar 2019 04:35:53 -0700 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id x2IBZq8u008197; Mon, 18 Mar 2019 11:35:52 GMT Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id 762BA1627FE; Mon, 18 Mar 2019 11:35:52 +0000 (GMT) From: Andrew Rybchenko To: Wenzhuo Lu , Jingjing Wu , Bernard Iremonger CC: , Igor Romanov , Date: Mon, 18 Mar 2019 11:35:47 +0000 Message-ID: <1552908947-18120-1-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24496.005 X-TM-AS-Result: No-6.251200-4.000000-10 X-TMASE-MatchedRID: fFu+wrUioa1PT18L1PHrrVVN8laWo90M8x+JsCOVqikNgi5eVrkrGRFu p4CINH3JK9arbN0JZhuN2PAB92r10uztpCSqSkXK4pdq9sdj8LV9LQinZ4QefPcjNeVeWlqY+gt Hj7OwNO2BMV0kqc2hZEzJD0kbtlBDSXTxRQj1ex58iAcjRxwHH2f0wN78BSiPVlxr1FJij9s= X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--6.251200-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24496.005 X-MDID: 1552908958-eI0lWcSs659E Subject: [dpdk-dev] [PATCH] app/testpmd: fix stdout flush absence after printing stats 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" Message-ID: <20190318113547.2Nq9agZtRoBoNjPfwOBk9Zgn8WNc9gm3l3Xupf32fwo@z> From: Igor Romanov User can specify stats period(n). The statistics should be available to user every n second. But the print_stats() function does not force stdout to be flushed, so for instance, a user reading testpmd's stdout through pipe will not be able to read it untill the stdout buffer is filled. Fixes: cfea1f3048d1 ("app/testpmd: print statistics periodically") Cc: stable@dpdk.org Signed-off-by: Igor Romanov Signed-off-by: Andrew Rybchenko --- app/test-pmd/testpmd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index d9d0c16d4..216be47f9 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -3046,6 +3046,8 @@ print_stats(void) printf("\nPort statistics ===================================="); for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) nic_stats_display(fwd_ports_ids[i]); + + fflush(stdout); } static void -- 2.17.1