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 2ADD5A0518 for ; Fri, 24 Jul 2020 14:03:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 231F21BFE3; Fri, 24 Jul 2020 14:03:39 +0200 (CEST) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by dpdk.org (Postfix) with ESMTP id 69B6D1BFE3 for ; Fri, 24 Jul 2020 14:03:37 +0200 (CEST) Received: by mail-wm1-f45.google.com with SMTP id k20so389819wmi.5 for ; Fri, 24 Jul 2020 05:03:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZycIorqnsjn3s4gIUIgrbB9IC08SwOUnP0rj1GFvSTI=; b=Aaqm/PVAHPoXoT+yUCSw99/D28sc0VxEKE0YWybWvzeDoNkKADZMR/w6bBFbF+M3Hi YW8tAxj13gJoIALRIN3eGeisJf1l0nWCaTWEK9lR7xlyTgkBuv1nib6E9yv4OvqQ3K6B zW5rIrx4CxFY1E/41uVAsY9iFh4pf3mpG+0nsP4hWGycIwnBrpVoU68SMTpW+PJLDtyt 2RTX0rYhyIeZK2x0ttAxlOxOVAlQIBD8cPgoawZDPQqA53PWbi5clSln9GmUzkvua4do 22ns/+qm4FVZg4Pmt/TxZbNz/wQNGBikeBKQh+vzAQR/tur2NJpofpkThgT5JfeEN5tJ sRPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZycIorqnsjn3s4gIUIgrbB9IC08SwOUnP0rj1GFvSTI=; b=sNkXRCKLK8iBz80WpP13lwGQ/u0Gl8nVJ998G3bD5lPlsEALQTdn5EhbBRMTkMNSgO yOOl6TSgH8IjTi2Cmvl+mfAZQg8WwLvPxgT/BZTQuHJSFQpkgkh8QHiAeCECSF/kimy+ 7owb4f1RnSd8yfIO2voRK/hw8pR/xHusq970CTkmaByM7RkIcV1T4UZdr/QQyuRXC4z2 CUMZKvCzDHWmbrLpy+T+37P6il42vUKYKEdwKTq/QUPl5omSP8X4jXSXjI82LaF+V/zN sGaOAW4y8tr7ocjeonV/7tLqEpJIbdjnAHHqOaLe5i0AIh3DFdAVAkJjIoQkXahRnWeW B9PA== X-Gm-Message-State: AOAM532nUQDa1cmEu1jl5auMLxbgrSE5snYATg3IjQ4pPHQHkm7dOOwj L09nuv5+t+Hn3f1a8ITtxb1hfI1FCF+ycg== X-Google-Smtp-Source: ABdhPJz/9IzVFjuA/nLthR9T5uy9uAeYLro0em1kmz8vUCdAsSP89uS3YdEXRioDl4LqC+eaVXqkPw== X-Received: by 2002:a1c:cc12:: with SMTP id h18mr9115651wmb.56.1595592217093; Fri, 24 Jul 2020 05:03:37 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id z12sm1102081wrp.20.2020.07.24.05.03.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2020 05:03:35 -0700 (PDT) From: luca.boccassi@gmail.com To: Georgiy Levashov Cc: Andrew Rybchenko , dpdk stable Date: Fri, 24 Jul 2020 12:58:04 +0100 Message-Id: <20200724120030.1863487-46-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724120030.1863487-1-luca.boccassi@gmail.com> References: <20200724120030.1863487-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'examples: add flush after stats printing' has been queued to stable release 19.11.4 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 stable release 19.11.4 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/26/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. Thanks. Luca Boccassi --- >From 0f7c8f75f2028230812f41473a702177dbd5aee2 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/ioat/ioatfwd.c | 2 ++ examples/kni/main.c | 2 ++ examples/l2fwd-crypto/main.c | 2 ++ examples/l2fwd-event/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 ++ 11 files changed, 23 insertions(+) diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c index fb38dc3a7..68a46050c 100644 --- a/examples/bbdev_app/main.c +++ b/examples/bbdev_app/main.c @@ -659,6 +659,8 @@ print_stats(struct stats_lcore_params *stats_lcore) print_lcore_stats(stats_lcore->lconf[l_id].lcore_stats, l_id); } + fflush(stdout); + free(xstats); free(xstats_names); } diff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c index 53de23179..b66ee73bc 100644 --- a/examples/ioat/ioatfwd.c +++ b/examples/ioat/ioatfwd.c @@ -294,6 +294,8 @@ print_stats(char *prgname) printf("\n"); 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; ts.total_packets_dropped += delta_ts.total_packets_dropped; diff --git a/examples/kni/main.c b/examples/kni/main.c index d48a59fcb..7edc73ab9 100644 --- a/examples/kni/main.c +++ b/examples/kni/main.c @@ -158,6 +158,8 @@ print_stats(void) kni_stats[i].tx_dropped); } printf("====== ============== ============ ============ ============ ============\n"); + + fflush(stdout); } /* Custom handling of signals to handle stats and kni processing */ diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c index fcb55c370..827da9b3e 100644 --- a/examples/l2fwd-crypto/main.c +++ b/examples/l2fwd-crypto/main.c @@ -334,6 +334,8 @@ print_stats(void) total_packets_dropped, total_packets_errors); printf("\n====================================================\n"); + + fflush(stdout); } static int diff --git a/examples/l2fwd-event/main.c b/examples/l2fwd-event/main.c index 384b71238..7969a1c31 100644 --- a/examples/l2fwd-event/main.c +++ b/examples/l2fwd-event/main.c @@ -385,6 +385,8 @@ print_stats(struct l2fwd_resources *rsrc) total_packets_rx, total_packets_dropped); printf("\n====================================================\n"); + + fflush(stdout); } static void diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c index e0255080e..c2180c2d1 100644 --- a/examples/l2fwd-jobstats/main.c +++ b/examples/l2fwd-jobstats/main.c @@ -329,6 +329,9 @@ 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 3d59e2ca9..ba2745c91 100644 --- a/examples/l2fwd-keepalive/main.c +++ b/examples/l2fwd-keepalive/main.c @@ -160,6 +160,8 @@ print_stats(__attribute__((unused)) struct rte_timer *ptr_timer, total_packets_rx, total_packets_dropped); printf("\n====================================================\n"); + + fflush(stdout); } static void diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index fcef23273..e3767a315 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -146,6 +146,8 @@ print_stats(void) total_packets_rx, total_packets_dropped); printf("\n====================================================\n"); + + fflush(stdout); } static void diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c index 72f86e502..6b8c153b5 100644 --- a/examples/link_status_interrupt/main.c +++ b/examples/link_status_interrupt/main.c @@ -162,6 +162,8 @@ print_stats(void) total_packets_rx, total_packets_dropped); printf("\n====================================================\n"); + + fflush(stdout); } static void diff --git a/examples/tep_termination/main.c b/examples/tep_termination/main.c index ab956ad7c..b9fffca02 100644 --- a/examples/tep_termination/main.c +++ b/examples/tep_termination/main.c @@ -1110,6 +1110,8 @@ print_stats(__rte_unused void *arg) dev_ll = dev_ll->next; } printf("\n================================================\n"); + + fflush(stdout); } return NULL; diff --git a/examples/vhost/main.c b/examples/vhost/main.c index ab649bf14..312829e8b 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -1334,6 +1334,8 @@ print_stats(__rte_unused void *arg) } printf("===================================================\n"); + + fflush(stdout); } return NULL; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-07-24 12:53:50.386118180 +0100 +++ 0046-examples-add-flush-after-stats-printing.patch 2020-07-24 12:53:48.267006087 +0100 @@ -1,8 +1,10 @@ -From 3ee6f706519c0a7456f3d8a79048150dfa6d2581 Mon Sep 17 00:00:00 2001 +From 0f7c8f75f2028230812f41473a702177dbd5aee2 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 @@ -15,7 +17,6 @@ and parses the output. Fixes: af75078fece3 ("first public release") -Cc: stable@dpdk.org Signed-off-by: Georgiy Levashov Signed-off-by: Andrew Rybchenko @@ -60,7 +61,7 @@ ts.total_packets_rx += delta_ts.total_packets_rx; ts.total_packets_dropped += delta_ts.total_packets_dropped; diff --git a/examples/kni/main.c b/examples/kni/main.c -index 80dd0353e..f5d12a5b8 100644 +index d48a59fcb..7edc73ab9 100644 --- a/examples/kni/main.c +++ b/examples/kni/main.c @@ -158,6 +158,8 @@ print_stats(void) @@ -86,10 +87,10 @@ static int diff --git a/examples/l2fwd-event/main.c b/examples/l2fwd-event/main.c -index 9593ef11e..4fe500333 100644 +index 384b71238..7969a1c31 100644 --- a/examples/l2fwd-event/main.c +++ b/examples/l2fwd-event/main.c -@@ -516,6 +516,8 @@ print_stats(struct l2fwd_resources *rsrc) +@@ -385,6 +385,8 @@ print_stats(struct l2fwd_resources *rsrc) total_packets_rx, total_packets_dropped); printf("\n====================================================\n"); @@ -99,7 +100,7 @@ static void diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c -index 396fd89db..47a3b0976 100644 +index e0255080e..c2180c2d1 100644 --- a/examples/l2fwd-jobstats/main.c +++ b/examples/l2fwd-jobstats/main.c @@ -329,6 +329,9 @@ show_stats_cb(__rte_unused void *param) @@ -113,10 +114,10 @@ } diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c -index b7585d55e..b2742633b 100644 +index 3d59e2ca9..ba2745c91 100644 --- a/examples/l2fwd-keepalive/main.c +++ b/examples/l2fwd-keepalive/main.c -@@ -160,6 +160,8 @@ print_stats(__rte_unused struct rte_timer *ptr_timer, +@@ -160,6 +160,8 @@ print_stats(__attribute__((unused)) struct rte_timer *ptr_timer, total_packets_rx, total_packets_dropped); printf("\n====================================================\n"); @@ -126,7 +127,7 @@ static void diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c -index f8d14b843..4a41aac63 100644 +index fcef23273..e3767a315 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -146,6 +146,8 @@ print_stats(void) @@ -139,7 +140,7 @@ static void diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c -index 25efe2b09..9bbcadfcf 100644 +index 72f86e502..6b8c153b5 100644 --- a/examples/link_status_interrupt/main.c +++ b/examples/link_status_interrupt/main.c @@ -162,6 +162,8 @@ print_stats(void)