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 DD95CA04B7; Thu, 17 Sep 2020 15:11:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0A8CA1D61B; Thu, 17 Sep 2020 15:11:39 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 5E3D31D619 for ; Thu, 17 Sep 2020 15:11:36 +0200 (CEST) IronPort-SDR: fNjNmEMBhNAnAQFgcislppNcFWIBKZ8jMnj2ivL/H5FAfAhi2w+kiE1HSq48BSzXNez4K9GFBP zApVtrq8ikWg== X-IronPort-AV: E=McAfee;i="6000,8403,9746"; a="221238899" X-IronPort-AV: E=Sophos;i="5.76,437,1592895600"; d="scan'208";a="221238899" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Sep 2020 06:11:33 -0700 IronPort-SDR: TIO8JGBcBvV5GS40mbmQUO/G2l+8vCh8jB0IWvjMNjtghNjfBowORPjPRPrmHVd/YU0x0CCDRK Bfn+wMFGcp3A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,437,1592895600"; d="scan'208";a="452293680" Received: from silpixa00399838.ir.intel.com ([10.237.213.224]) by orsmga004.jf.intel.com with ESMTP; 17 Sep 2020 06:11:32 -0700 From: Kevin Laatz To: dev@dpdk.org Cc: marcinx.baran@intel.com, pawelx.modrak@intel.com, bruce.richardson@intel.com, Kevin Laatz Date: Thu, 17 Sep 2020 14:07:40 +0100 Message-Id: <20200917130740.207443-1-kevin.laatz@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200917110221.205960-1-kevin.laatz@intel.com> References: <20200917110221.205960-1-kevin.laatz@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2] examples/ioat: fix stats print X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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") Signed-off-by: Kevin Laatz --- v2: - Increased string array by larger value - ie. up to 255. - Moved the "\n" to avoid future formatting issues from truncation. --- 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 43a19843ee..4e971dc054 100644 --- a/examples/ioat/ioatfwd.c +++ b/examples/ioat/ioatfwd.c @@ -168,7 +168,7 @@ print_stats(char *prgname) 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 @@ print_stats(char *prgname) "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 @@ print_stats(char *prgname) 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; -- 2.25.1