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 42AEDA053D for ; Fri, 17 Jul 2020 18:32:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3ABB91BEC0; Fri, 17 Jul 2020 18:32:51 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id 47B901BEC0 for ; Fri, 17 Jul 2020 18:32:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595003568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=216jYFg1gVHDWxuk3PO/qJkU7bifb0BKTaWmYh5jBb4=; b=ZWqFq5IBtqOM5zf1BZX4lrXtz9/JGuoMPz7MkHmjc4+6Bss6M1tluW5I9cwu/ByfEbTq7L eTdcBH3h+srx34s1ne7ElHxD0S6WVH0xCcab+q0kxo3fgUUkQyfZtYtRbJxA4QsZ98//6d yqH3VyhHdax2nF+vQHxEvzkzDds/ihU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-438-ugBNdGGtOJWBXtmnca8x6A-1; Fri, 17 Jul 2020 12:32:39 -0400 X-MC-Unique: ugBNdGGtOJWBXtmnca8x6A-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6B6E2100526A; Fri, 17 Jul 2020 16:32:38 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.168]) by smtp.corp.redhat.com (Postfix) with ESMTP id 871F372E48; Fri, 17 Jul 2020 16:32:37 +0000 (UTC) From: Kevin Traynor To: Georgiy Levashov Cc: Andrew Rybchenko , dpdk stable Date: Fri, 17 Jul 2020 17:31:57 +0100 Message-Id: <20200717163214.4839-9-ktraynor@redhat.com> In-Reply-To: <20200717163214.4839-1-ktraynor@redhat.com> References: <20200717163214.4839-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'examples: add flush after stats printing' has been queued to LTS release 18.11.10 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/23/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/7fe033b767c3cfd3bacf2664253b69afbc2d884c Thanks. Kevin. --- >From 7fe033b767c3cfd3bacf2664253b69afbc2d884c Mon Sep 17 00:00:00 2001 From: Georgiy Levashov Date: Tue, 28 Apr 2020 14:27:41 +0100 Subject: [PATCH] examples: add flush after stats printing [ upstream commit 3ee6f706519c0a7456f3d8a79048150dfa6d2581 ] When printf()'s stdout is line-buffered for terminal, it is fully buffered for pipes. So, stdout listener can only get the output when it is flushed (on program termination, when buffer is filled or manual flush). stdout buffer might fill slowly since every stats report could be small. Also when it is fully filled it might contain a part of the last stats report which makes it very inconvenient for any automation which reads and parses the output. Fixes: af75078fece3 ("first public release") Signed-off-by: Georgiy Levashov Signed-off-by: Andrew Rybchenko --- examples/bbdev_app/main.c | 2 ++ examples/kni/main.c | 2 ++ examples/l2fwd-crypto/main.c | 2 ++ examples/l2fwd-jobstats/main.c | 3 +++ examples/l2fwd-keepalive/main.c | 2 ++ examples/l2fwd/main.c | 2 ++ examples/link_status_interrupt/main.c | 2 ++ examples/tep_termination/main.c | 2 ++ examples/vhost/main.c | 2 ++ 9 files changed, 19 insertions(+) diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c index d68c06aefb..c81dfb6e19 100644 --- a/examples/bbdev_app/main.c +++ b/examples/bbdev_app/main.c @@ -642,4 +642,6 @@ print_stats(struct stats_lcore_params *stats_lcore) } + fflush(stdout); + free(xstats); free(xstats_names); diff --git a/examples/kni/main.c b/examples/kni/main.c index 54bd69491b..6f15741747 100644 --- a/examples/kni/main.c +++ b/examples/kni/main.c @@ -159,4 +159,6 @@ print_stats(void) } printf("====== ============== ============ ============ ============ ============\n"); + + fflush(stdout); } diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c index 2d79327875..36a0002c42 100644 --- a/examples/l2fwd-crypto/main.c +++ b/examples/l2fwd-crypto/main.c @@ -328,4 +328,6 @@ print_stats(void) total_packets_errors); printf("\n====================================================\n"); + + fflush(stdout); } diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c index 8443f685d3..39c73b9679 100644 --- a/examples/l2fwd-jobstats/main.c +++ b/examples/l2fwd-jobstats/main.c @@ -330,4 +330,7 @@ show_stats_cb(__rte_unused void *param) printf("\n====================================================\n"); + + fflush(stdout); + rte_eal_alarm_set(timer_period * US_PER_S, show_stats_cb, NULL); } diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c index e74eb1f53e..53fffda6af 100644 --- a/examples/l2fwd-keepalive/main.c +++ b/examples/l2fwd-keepalive/main.c @@ -161,4 +161,6 @@ print_stats(__attribute__((unused)) struct rte_timer *ptr_timer, total_packets_dropped); printf("\n====================================================\n"); + + fflush(stdout); } diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index 6ddf94b005..72f9fab5bc 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -147,4 +147,6 @@ print_stats(void) total_packets_dropped); printf("\n====================================================\n"); + + fflush(stdout); } diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c index 17e77427a9..97bc4a2d21 100644 --- a/examples/link_status_interrupt/main.c +++ b/examples/link_status_interrupt/main.c @@ -159,4 +159,6 @@ print_stats(void) total_packets_dropped); printf("\n====================================================\n"); + + fflush(stdout); } diff --git a/examples/tep_termination/main.c b/examples/tep_termination/main.c index 6db604ed8b..72216a81ce 100644 --- a/examples/tep_termination/main.c +++ b/examples/tep_termination/main.c @@ -1111,4 +1111,6 @@ print_stats(__rte_unused void *arg) } printf("\n================================================\n"); + + fflush(stdout); } diff --git a/examples/vhost/main.c b/examples/vhost/main.c index 2261f089f9..f2fa074f21 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -1334,4 +1334,6 @@ print_stats(__rte_unused void *arg) printf("===================================================\n"); + + fflush(stdout); } -- 2.21.3 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-07-17 17:17:00.495898763 +0100 +++ 0009-examples-add-flush-after-stats-printing.patch 2020-07-17 17:16:59.977771489 +0100 @@ -1 +1 @@ -From 3ee6f706519c0a7456f3d8a79048150dfa6d2581 Mon Sep 17 00:00:00 2001 +From 7fe033b767c3cfd3bacf2664253b69afbc2d884c Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 3ee6f706519c0a7456f3d8a79048150dfa6d2581 ] + @@ -18 +19,0 @@ -Cc: stable@dpdk.org @@ -24 +24,0 @@ - examples/ioat/ioatfwd.c | 2 ++ @@ -27 +26,0 @@ - examples/l2fwd-event/main.c | 2 ++ @@ -34 +33 @@ - 11 files changed, 23 insertions(+) + 9 files changed, 19 insertions(+) @@ -37 +36 @@ -index fb38dc3a72..68a46050c0 100644 +index d68c06aefb..c81dfb6e19 100644 @@ -40 +39 @@ -@@ -660,4 +660,6 @@ print_stats(struct stats_lcore_params *stats_lcore) +@@ -642,4 +642,6 @@ print_stats(struct stats_lcore_params *stats_lcore) @@ -47,11 +45,0 @@ -diff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c -index 53de231795..b66ee73bce 100644 ---- a/examples/ioat/ioatfwd.c -+++ b/examples/ioat/ioatfwd.c -@@ -295,4 +295,6 @@ print_stats(char *prgname) - print_total_stats(&delta_ts); - -+ fflush(stdout); -+ - ts.total_packets_tx += delta_ts.total_packets_tx; - ts.total_packets_rx += delta_ts.total_packets_rx; @@ -59 +47 @@ -index 80dd0353e7..f5d12a5b86 100644 +index 54bd69491b..6f15741747 100644 @@ -70 +58 @@ -index fcb55c370a..827da9b3e3 100644 +index 2d79327875..36a0002c42 100644 @@ -73 +61 @@ -@@ -335,4 +335,6 @@ print_stats(void) +@@ -328,4 +328,6 @@ print_stats(void) @@ -80,11 +67,0 @@ -diff --git a/examples/l2fwd-event/main.c b/examples/l2fwd-event/main.c -index 9593ef11e3..4fe500333c 100644 ---- a/examples/l2fwd-event/main.c -+++ b/examples/l2fwd-event/main.c -@@ -517,4 +517,6 @@ print_stats(struct l2fwd_resources *rsrc) - total_packets_dropped); - printf("\n====================================================\n"); -+ -+ fflush(stdout); - } - @@ -92 +69 @@ -index 396fd89db4..47a3b09765 100644 +index 8443f685d3..39c73b9679 100644 @@ -104 +81 @@ -index b7585d55e1..b2742633bc 100644 +index e74eb1f53e..53fffda6af 100644 @@ -107 +84 @@ -@@ -161,4 +161,6 @@ print_stats(__rte_unused struct rte_timer *ptr_timer, +@@ -161,4 +161,6 @@ print_stats(__attribute__((unused)) struct rte_timer *ptr_timer, @@ -115 +92 @@ -index f8d14b843a..4a41aac638 100644 +index 6ddf94b005..72f9fab5bc 100644 @@ -126 +103 @@ -index 25efe2b09a..9bbcadfcf8 100644 +index 17e77427a9..97bc4a2d21 100644 @@ -129 +106 @@ -@@ -163,4 +163,6 @@ print_stats(void) +@@ -159,4 +159,6 @@ print_stats(void) @@ -137 +114 @@ -index ab956ad7ce..b9fffca020 100644 +index 6db604ed8b..72216a81ce 100644 @@ -148 +125 @@ -index ab649bf147..312829e8b9 100644 +index 2261f089f9..f2fa074f21 100644 @@ -151 +128 @@ -@@ -1335,4 +1335,6 @@ print_stats(__rte_unused void *arg) +@@ -1334,4 +1334,6 @@ print_stats(__rte_unused void *arg)