patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "谢华伟(此时此刻)" <huawei.xhw@alibaba-inc.com>
To: "谢华伟(此时此刻)" <huawei.xhw@alibaba-inc.com>
Cc: Kevin Laatz <kevin.laatz@intel.com>, stable@dpdk.org
Subject: [dpdk-stable] [PATCH 05/14] examples/ioat: fix stats print
Date: Fri, 09 Oct 2020 16:57:37 +0800	[thread overview]
Message-ID: <1602233866-9622-5-git-send-email-huawei.xhw@alibaba-inc.com> (raw)
In-Reply-To: <1602233866-9622-1-git-send-email-huawei.xhw@alibaba-inc.com>

From: Kevin Laatz <kevin.laatz@intel.com>

Currently some of the status string at the top of the stats output is being
cut off. To fix this, the status string array size has been increased.
In addition to this, the "\n" has been moved to the printf, rather than
having it in the last string, in case of future formatting issues due to
truncation.

Bugzilla ID: 536
Fixes: 632bcd9b5d4f ("examples/ioat: print statistics")
Cc: stable@dpdk.org

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 examples/ioat/ioatfwd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c
index e6d1d12..8cf606e 100644
--- a/examples/ioat/ioatfwd.c
+++ b/examples/ioat/ioatfwd.c
@@ -168,7 +168,7 @@ struct total_statistics {
 	struct rte_rawdev_xstats_name *names_xstats;
 	uint64_t *xstats;
 	unsigned int *ids_xstats, nb_xstats;
-	char status_string[120]; /* to print at the top of the output */
+	char status_string[255]; /* to print at the top of the output */
 	int status_strlen;
 	int ret;
 
@@ -194,7 +194,7 @@ struct total_statistics {
 		"Rx Queues = %d, ", nb_queues);
 	status_strlen += snprintf(status_string + status_strlen,
 		sizeof(status_string) - status_strlen,
-		"Ring Size = %d\n", ring_size);
+		"Ring Size = %d", ring_size);
 
 	/* Allocate memory for xstats names and values */
 	ret = rte_rawdev_xstats_names_get(
@@ -251,7 +251,7 @@ struct total_statistics {
 
 		memset(&delta_ts, 0, sizeof(struct total_statistics));
 
-		printf("%s", status_string);
+		printf("%s\n", status_string);
 
 		for (i = 0; i < cfg.nb_ports; i++) {
 			port_id = cfg.ports[i].rxtx_port;
-- 
1.8.3.1


           reply	other threads:[~2020-10-09  8:58 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1602233866-9622-1-git-send-email-huawei.xhw@alibaba-inc.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1602233866-9622-5-git-send-email-huawei.xhw@alibaba-inc.com \
    --to=huawei.xhw@alibaba-inc.com \
    --cc=kevin.laatz@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).