From owner-dev-commits-src-branches@freebsd.org Sun Aug 22 23:04:27 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BF8D265F735; Sun, 22 Aug 2021 23:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gt9tM5389z4hSd; Sun, 22 Aug 2021 23:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 958D91379; Sun, 22 Aug 2021 23:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17MN4ReD044113; Sun, 22 Aug 2021 23:04:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17MN4Rta044112; Sun, 22 Aug 2021 23:04:27 GMT (envelope-from git) Date: Sun, 22 Aug 2021 23:04:27 GMT Message-Id: <202108222304.17MN4Rta044112@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 5f468877862c - stable/12 - iostat: fix rounding errors in iostat -x MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5f468877862c4ee4e2d94146b924fa0463f926cb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 23:04:27 -0000 The branch stable/12 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=5f468877862c4ee4e2d94146b924fa0463f926cb commit 5f468877862c4ee4e2d94146b924fa0463f926cb Author: Alan Somers AuthorDate: 2021-07-08 16:16:32 +0000 Commit: Alan Somers CommitDate: 2021-08-22 23:04:09 +0000 iostat: fix rounding errors in iostat -x Better to round numbers instead of flooring them. Sponsored by: Axcient (cherry picked from commit 61631b24a1347a23cafe0657fba894622b1606e2) --- usr.sbin/iostat/iostat.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/usr.sbin/iostat/iostat.c b/usr.sbin/iostat/iostat.c index e5f746c15284..d1c35063c72f 100644 --- a/usr.sbin/iostat/iostat.c +++ b/usr.sbin/iostat/iostat.c @@ -888,17 +888,17 @@ devstats(int perf_select, long double etime, int havelast) mb_per_second_write > ((long double).0005)/1024 || busy_pct > 0.5) { if (Iflag == 0) - printf("%-8.8s %7d %7d %8.1Lf " - "%8.1Lf %5d %5d %5d %5d " - "%4" PRIu64 " %3.0Lf ", + printf("%-8.8s %7.0Lf %7.0Lf %8.1Lf " + "%8.1Lf %5.0Lf %5.0Lf %5.0Lf %5.0Lf" + " %4" PRIu64 " %3.0Lf ", devicename, - (int)transfers_per_second_read, - (int)transfers_per_second_write, + transfers_per_second_read, + transfers_per_second_write, mb_per_second_read * 1024, mb_per_second_write * 1024, - (int)ms_per_read, (int)ms_per_write, - (int)ms_per_other, - (int)ms_per_transaction, + ms_per_read, ms_per_write, + ms_per_other, + ms_per_transaction, queue_len, busy_pct); else printf("%-8.8s %11.1Lf %11.1Lf "