From nobody Wed May 22 14:47:56 2024 X-Original-To: dev-commits-src-main@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 4VkvL51HfQz5Lqv9; Wed, 22 May 2024 14:47:57 +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 4VkvL45ksgz4KKy; Wed, 22 May 2024 14:47:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716389276; 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=cqt+IbyqqaH1mJ8rd38cubPEVPCuljqih54NBaMbSyU=; b=H/2JR0sdUqOUxBPgv5/lfXM+QdTdJHcEC6j3M5i2LoHr4Y6XVaaP2x8gbE+c/duNSz4nBc LF+NXGa//HXnBDw0bSEQFX4FZDw5K9NvjsyxWBLewBAw5IqCn1IGBa0/0vlA6hRh1hbfPT qKCdJlrpMLUF3+gYC8nXK3JGq0Agr9XE6M/YAZKclxwbOjuIaMNMUzzvLotX7g8QsbcKnm SEcALXJAf3/8miqXroiug0SoX+6lA6PB7vjhp2993d+SYU+t3+qT3mRUV7lmTvzHM6u8Hi faspnACiNqPhU/R9UTMV32qv4gPuHd5xRspufwbpoy8lrerVl4ZEzLENGPY82A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716389276; a=rsa-sha256; cv=none; b=trsPKWXec/KtS+X01vp7Y5njv+DHzMq3aCJQ94BYCNdgIb1uWA9W08O13Pac9o/fZ7pfeX AJWNC3a/OU/ZppajGYv0iIvlC66iami2Bu8M9ScT2n/n59ygQ9y74FCEkipU47EGdjZ57j ziTTvBjdhRIYycomohgixjj0+Pdp1ybDUGnfET/IRafOm50tTDu/9i6kdpOw0hWIBJfDc5 TcJknmZ6cOLEO2BOkfENNbAjHJrlPc1cQd2g+D7VnFVbZumesJS0GzSzeIDQ6elU+Lb5Ym JXgAVHEKVwjJmvgqRxckcEZ2GF3+tH9hf8uv/79+XT5JWhWS1IZnKZ9+ZL9lpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716389276; 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=cqt+IbyqqaH1mJ8rd38cubPEVPCuljqih54NBaMbSyU=; b=Eejoq7sPljS24MLDz96lFqF55TfH0GQByb/6nfCcRvjIKHhR54QOFKKbxgUZxBOY1sSOby 1em4u6foabI8iiyYALEQXFnagznHcpMj1fnSza3/TktZG6dbv/JcNMMzO+6jkrK6KcScuK rEwt0JIR3CBWachOKNaytzcflRIA4Y4V0ti7QQElNGNLQUA4MdorpzQdqcbiyBx0gWg3GM 9oLV9UiGqPZbUBV+l9hCq/5d10aQB+9GWs+sjsJNAa2vKzmQe3sOc1islCWPPLwa7VFFIy nujbiUUMSDPExFw++qhFJ2gBUX9onMeWIX9GK51J6AZdhBHzQzgieAdgzxG8Qw== 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 4VkvL45BQBz18CZ; Wed, 22 May 2024 14:47:56 +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 44MElumo036836; Wed, 22 May 2024 14:47:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MEluXH036833; Wed, 22 May 2024 14:47:56 GMT (envelope-from git) Date: Wed, 22 May 2024 14:47:56 GMT Message-Id: <202405221447.44MEluXH036833@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Kubaj Subject: git: b7f62c6042f8 - main - usr.bin/top: fix displaying load average for loads of at least 100 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pkubaj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b7f62c6042f8b4b322d9fa20a8c6a81a9a58c164 Auto-Submitted: auto-generated The branch main has been updated by pkubaj: URL: https://cgit.FreeBSD.org/src/commit/?id=b7f62c6042f8b4b322d9fa20a8c6a81a9a58c164 commit b7f62c6042f8b4b322d9fa20a8c6a81a9a58c164 Author: Piotr Kubaj AuthorDate: 2024-05-21 10:28:35 +0000 Commit: Piotr Kubaj CommitDate: 2024-05-22 14:47:46 +0000 usr.bin/top: fix displaying load average for loads of at least 100 After top registers load average of at least 100 which then gets reduced to below 100, there are left stray digits. Supporting load over 100 requires increasing the width only to 6, but since we support over 1000 CPU's now, let's increase it to 7. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D45284 --- usr.bin/top/display.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/top/display.c b/usr.bin/top/display.c index 32b8b12798dc..b6cde0e63aa7 100644 --- a/usr.bin/top/display.c +++ b/usr.bin/top/display.c @@ -252,7 +252,7 @@ i_loadave(int mpid, double avenrun[]) for (i = 0; i < 3; i++) { - printf("%c %5.2f", + printf("%c %7.2f", i == 0 ? ':' : ',', avenrun[i]); } @@ -289,7 +289,7 @@ u_loadave(int mpid, double *avenrun) /* we should optimize this and only display changes */ for (i = 0; i < 3; i++) { - printf("%s%5.2f", + printf("%s%7.2f", i == 0 ? "" : ", ", avenrun[i]); }