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 DEB0BA04BC for ; Fri, 9 Oct 2020 10:58:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D0F2E1C205; Fri, 9 Oct 2020 10:58:07 +0200 (CEST) Received: from out0-148.mail.aliyun.com (out0-148.mail.aliyun.com [140.205.0.148]) by dpdk.org (Postfix) with ESMTP id 79D331C206 for ; Fri, 9 Oct 2020 10:58:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alibaba-inc.com; s=default; t=1602233878; h=From:To:Subject:Date:Message-Id; bh=k78F9jhd46r1OLH/kocN1udUTYNetYaQ4UxaUhfPxGo=; b=mt2UCUrVcyJNvK0l9JUW5+b9mEF2pp9R6O491XhvWuUn7uww577DtVoZXGG1PoAAmlhveuuQ3bUFyd+WdpgCkyUZMuNoar0kXZ1kM9FTj1WeD1AEXyzU3d6FPNjcY4fdO7vW+oFc7BPcNPs0B8rrcZJFUxxDMOitwHCVKQauFsk= X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R671e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=ay29a033018047192; MF=huawei.xhw@alibaba-inc.com; NM=1; PH=DS; RN=3; SR=0; TI=SMTPD_---.Ih.NyPR_1602233869; Received: from rs3a10040.et2sqa.z1.et2sqa.tbsite.net(mailfrom:huawei.xhw@alibaba-inc.com fp:SMTPD_---.Ih.NyPR_1602233869) by smtp.aliyun-inc.com(127.0.0.1); Fri, 09 Oct 2020 16:57:58 +0800 From: "=?UTF-8?B?6LCi5Y2O5LyfKOatpOaXtuatpOWIu++8iQ==?=" To: "=?UTF-8?B?6LCi5Y2O5LyfKOatpOaXtuatpOWIu++8iQ==?=" Cc: Kevin Laatz , stable@dpdk.org Date: Fri, 09 Oct 2020 16:57:37 +0800 Message-Id: <1602233866-9622-5-git-send-email-huawei.xhw@alibaba-inc.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1602233866-9622-1-git-send-email-huawei.xhw@alibaba-inc.com> References: <68ecd941-9c56-4de7-fae2-2ad15bdfd81a@alibaba-inc.com> <1602233866-9622-1-git-send-email-huawei.xhw@alibaba-inc.com> Subject: [dpdk-stable] [PATCH 05/14] examples/ioat: fix stats print 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" From: Kevin Laatz 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 Acked-by: Bruce Richardson --- 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