From nobody Fri Nov 10 23:40:54 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 4SRwLZ2vZmz511nw; Fri, 10 Nov 2023 23:40:54 +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 4SRwLZ2TWyz3cxZ; Fri, 10 Nov 2023 23:40:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699659654; 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=3vKOEYT/Gs35pesdglGm+twXJ7IeQ2mNuZk5VWQFlo4=; b=s3YtOm4F4rpnKI6ppF1JfLnex/+SnbRqLnA+nhCgrUXGAg9niCsrsRyyiUBTrndtiUInBq kA1HMaaH+XT/TWRu3qjkE93FVqtRQykr6Ujo7FopritEoegwozXN1quimSXwkd47g+aKKR 5EScTpu7qUp8y+0x5k+/qXbeICTzBHdDAwQt/hlXSIp6GSWnEadtBn7PyoQaRODCrCtx+d TyWnu2qZTZcBWf1Dv3oPz5gHFBiaOGXVdDHgzbD1cbkwNE1AMzJcy/eghEsWBRDtofw3C4 y0ia4L5QVSg0+fzuAqVRvxWtRroDmJ34wZ8CmXK3qS+hXw46JwquVAS/fpUnxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699659654; 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=3vKOEYT/Gs35pesdglGm+twXJ7IeQ2mNuZk5VWQFlo4=; b=FILbUZdsqQ1JP2n2qjWJ4YvvzpnaJcya3QbhFH2SUBXh25E47TeByifIX7JozOFIgBx5Ka CgmQqne8RxZ+XGewMy2pvNS6vNIKBnSjQJc4TUE5o2XWBZ8/Oy4LnsVqL9qnv9SdIIIUNH alKFkHiNF75nxVN7ZHbklOGLLYv5E/thLe3yZKfbxHmV4b5jJO62mr+bhDwRk6VOlPtefE 1wT589u9IjpmDCjAE39te1FeCF1m4A6WgLPmMZAspQtxaRdg/+9u6n8OYaqf7nPAVgqluO iHAi2u1GsHK9Ra5qbXNSNgW0jciZJ94FWdKvHNkzTOtq56Q0x9CtV13CLbO3aQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1699659654; a=rsa-sha256; cv=none; b=kvUuPKc77/bxfnZ8w6zNqxfjk/wGkj5pRxFdnjJhu+ysNG+N5wq9+73IZHRknZGCLalnfJ oMhYYMl+R4dEP4aXhLEEjGHDpKc4kqN6fidVGdFtwRVhdWezT6gCd/GzAqiUw1NV+T1uks 8EkIWhU6zA2mSwriRDVbv0h3+OA8xFg0WEqovWiX0RxKohOSX0z9BaVL34iRinC1EmXf/E iQ3vEA3ltHvvF469ThCR74aGDl6U1rIFt5Vca6yMGzaQAchDaVfdqupFUGeZnbtLL+tqKL bnMQPK2JKJRoj3Rne3WA5I86Rt7YoxcD/kFoB3fQcNz60A2TQ5V4YEMn20Samw== 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 4SRwLZ1Xqmz343; Fri, 10 Nov 2023 23:40:54 +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 3AANesKj080279; Fri, 10 Nov 2023 23:40:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AANesFH080274; Fri, 10 Nov 2023 23:40:54 GMT (envelope-from git) Date: Fri, 10 Nov 2023 23:40:54 GMT Message-Id: <202311102340.3AANesFH080274@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 105c7c4b8dce - main - 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/main X-Git-Reftype: branch X-Git-Commit: 105c7c4b8dcec22567a5f137b9406a95fbd9f4f2 Auto-Submitted: auto-generated The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=105c7c4b8dcec22567a5f137b9406a95fbd9f4f2 commit 105c7c4b8dcec22567a5f137b9406a95fbd9f4f2 Author: Alexander Motin AuthorDate: 2023-11-10 23:35:38 +0000 Commit: Alexander Motin CommitDate: 2023-11-10 23:35:38 +0000 iostat: Tune formatting for higher disk speeds MFC after: 2 weeks --- 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); } }