Blame SOURCES/0013-tc_util-Fix-format-of-TCA_STATS_BASIC_HW-statistics.patch

d8fb9e
From e1383085284f283538af8598c52401b7d5906164 Mon Sep 17 00:00:00 2001
d8fb9e
From: Andrea Claudi <aclaudi@redhat.com>
d8fb9e
Date: Mon, 8 Jun 2020 14:50:35 +0200
d8fb9e
Subject: [PATCH] tc_util: Fix format of TCA_STATS_BASIC_HW statistics
d8fb9e
d8fb9e
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1637437
d8fb9e
Upstream Status: RHEL-only
d8fb9e
d8fb9e
During the backport of commit 5ac138324e31c ("tc_util: Add support for showing
d8fb9e
TCA_STATS_BASIC_HW statistics") some code was modified to avoid backporting a
d8fb9e
large unrelated commit jsonifing the output of tc stats.
d8fb9e
d8fb9e
The format of TCA_STATS_BASIC_HW statistics was unintentionally altered missing
d8fb9e
a newline at the beginning of "Sent software" and "Sent hardware" lines.
d8fb9e
d8fb9e
This commit fix the output format.
d8fb9e
d8fb9e
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
d8fb9e
---
d8fb9e
 tc/tc_util.c | 4 ++--
d8fb9e
 1 file changed, 2 insertions(+), 2 deletions(-)
d8fb9e
d8fb9e
diff --git a/tc/tc_util.c b/tc/tc_util.c
d8fb9e
index ecc6fa1cca5f1..28dc06ffac784 100644
d8fb9e
--- a/tc/tc_util.c
d8fb9e
+++ b/tc/tc_util.c
d8fb9e
@@ -714,13 +714,13 @@ static void print_tcstats_basic_hw(FILE *f, struct rtattr **tbs, char *prefix)
d8fb9e
 			   sizeof(bs)));
d8fb9e
 
d8fb9e
 		if (bs.bytes >= bs_hw.bytes && bs.packets >= bs_hw.packets) {
d8fb9e
-			fprintf(f, "%s", prefix);
d8fb9e
+			fprintf(f, "\n%s", prefix);
d8fb9e
 			fprintf(f, "Sent software %llu bytes", bs.bytes - bs_hw.bytes);
d8fb9e
 			fprintf(f, " %u pkt", bs.packets - bs_hw.packets);
d8fb9e
 		}
d8fb9e
 	}
d8fb9e
 
d8fb9e
-	fprintf(f, "%s", prefix);
d8fb9e
+	fprintf(f, "\n%s", prefix);
d8fb9e
 	fprintf(f, "Sent hardware %llu bytes", bs_hw.bytes);
d8fb9e
 	fprintf(f, " %u pkt", bs_hw.packets);
d8fb9e
 }
d8fb9e
-- 
d8fb9e
2.26.2
d8fb9e