From nobody Sat Nov 25 00:34:26 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ScXst6KcGz525vx; Sat, 25 Nov 2023 00:34:26 +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 4ScXst5rwnz3Zfp; Sat, 25 Nov 2023 00:34:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700872466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sLbbqAKGRTPh5yj11ZZrwjprXV4Cc3D5RwnuKxKA3uk=; b=ED6mbrkFtoJSk88CuXw9zgWj38D3J53CF/2ADQPHfn57a0JP67zQL1BGqTVb8LmNw9/7kC 0ns6m33hB8aSWc3X1qUp7FprJHXO28y7XFrrBDHrVuts9JjkecfYlXZwb3CXLlyHabCHRN WHFWCLAByJaYbHkCOmzShHb3Y2J+nrS80bwi9RCUh2RPITUvvopq9b3AMwth6Ru94ky5F9 eJdof6sdfUH8+EQJdiFHYpQUP7SLedMYZe5HmZBMeyE7oHSPfhKl59GdgLxUr+xWxAOcmw ttOyCnXBVahFBvQiXWLSmPDZsURpZ7ABoFuA96IF3lMBeawkEq+DmKk8C4VcWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700872466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sLbbqAKGRTPh5yj11ZZrwjprXV4Cc3D5RwnuKxKA3uk=; b=nG/FKoagEQbLxvEH78oAHaHAv3SlPMHuUO7TlunioaWAj+LJoevq2EihHoVtQhsBZzdY1q +WFjZsl5JaKq2c/0l41Jug+zTLbD9CsG5cJbQ9+H2rLXEeaSwjmO9dULz4f0zkCqDPBKUN Vkmv+Tc+2z4pIMfMi5q/YYzL/iCexA3cqa+RYKmYCqwrKZvfU+34gkyH6ehaLBxAdLHiv5 SIPFjqEL8uL09mSJeJQVLuz+aAgS7YnIcQeSK2KIOOIqngebWIyGXyhon9v9giEF4/FDff Vhcbz4XP9y22WFf4sQi1P468R6de0/dx5N9GlZjpwxj3nVmy3cZkJRmSmctDsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700872466; a=rsa-sha256; cv=none; b=A7fZnDfNBu9AHUbT4gqIc2KDqHGN9qTBoh9aJDvhE7We3D3V3QZ5bXbjdiWrSJuo2wTky1 8ScCB9ensbcObYZZiR2fwxyk2fNiRHX4dj7ht9NZ0vjdpOtF4BzJYzsMl+HDtBpn6VVGkw QmRbiv1cLZgAq5LWBPtWirIe53iZDYy0NxtRuj74+jAJt7CnfJxZoxdmG8TkqxE3M2VvNi 2T7gU9ZFAFQdVc/PbLvyG0vYE6Nxu34/jv6YqR4XRo0D4yyQLtcCJXCxnp7tK6Z49v6Jog hNVT1Hp/rVgMCjeqTSVuQUAMOAlv6cs5pHsn7ZvMOXoV9GGDSGUlCgP/kwt1RQ== 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 4ScXst4vFgz16J8; Sat, 25 Nov 2023 00:34:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3AP0YQjc069203; Sat, 25 Nov 2023 00:34:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AP0YQei069200; Sat, 25 Nov 2023 00:34:26 GMT (envelope-from git) Date: Sat, 25 Nov 2023 00:34:26 GMT Message-Id: <202311250034.3AP0YQei069200@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 7826693aa546 - stable/14 - iostat: Tune formatting for higher disk speeds List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7826693aa546f261edcf1c3b72755641cbc77267 Auto-Submitted: auto-generated The branch stable/14 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=7826693aa546f261edcf1c3b72755641cbc77267 commit 7826693aa546f261edcf1c3b72755641cbc77267 Author: Alexander Motin AuthorDate: 2023-11-10 23:35:38 +0000 Commit: Alexander Motin CommitDate: 2023-11-25 00:34:19 +0000 iostat: Tune formatting for higher disk speeds MFC after: 2 weeks (cherry picked from commit 105c7c4b8dcec22567a5f137b9406a95fbd9f4f2) --- usr.sbin/iostat/iostat.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/usr.sbin/iostat/iostat.c b/usr.sbin/iostat/iostat.c index d4f7a2519a1b..c6ba6aa8a7a2 100644 --- a/usr.sbin/iostat/iostat.c +++ b/usr.sbin/iostat/iostat.c @@ -765,9 +765,9 @@ phdr(void) (void)printf(" blk xfr msps "); } else { if (Iflag == 0) - printf(" KB/t tps MB/s "); + printf("KB/t tps MB/s "); else - printf(" KB/t xfrs MB "); + printf("KB/t xfrs MB "); } printed++; } @@ -934,26 +934,30 @@ devstats(int perf_select, long double etime, int havelast) msdig, ms_per_transaction); else - printf("%4.1" PRIu64 "%4.1" PRIu64 "%5.*Lf ", + printf("%4" PRIu64 "%4" PRIu64 "%5.*Lf ", total_blocks, total_transfers, msdig, ms_per_transaction); } else { if (Iflag == 0) - printf(" %4.*Lf %4.0Lf %5.*Lf ", + printf("%4.*Lf %5.0Lf %5.*Lf ", kb_per_transfer >= 100 ? 0 : 1, kb_per_transfer, transfers_per_second, - mb_per_second >= 1000 ? 0 : 1, + mb_per_second >= 1000 ? 0 : + (total_mb >= 100 ? 1 : 2), mb_per_second); else { total_mb = total_bytes; total_mb /= 1024 * 1024; - printf(" %4.1Lf %4.1" PRIu64 " %5.2Lf ", + printf("%4.*Lf %5" PRIu64 " %5.*Lf ", + kb_per_transfer >= 100 ? 0 : 1, kb_per_transfer, total_transfers, + total_mb >= 1000 ? 0 : + (total_mb >= 100 ? 1 : 2), total_mb); } }