From nobody Wed Jun 21 05:37:50 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 4QmC2R1SWYz4g1CH; Wed, 21 Jun 2023 05:37:51 +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 4QmC2R0t6Tz3Qs3; Wed, 21 Jun 2023 05:37:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687325871; 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=Inoc6kAtvG+gUQcD3e/8tdLrrc3pCoErJ8mk3ttqlRw=; b=I6tuUu/SYLcMIclT7/oKPe+RBelnvsuBpB8uRYIGO3w35k+r+bVjFqj6eh+WYyPFFkoW+S Tb9IYHc9QZ0B2LLXneRwsl/XwrHI5EkdmWJG/2SSbFS9FZkCaMnnKYjgV1TBh9P8WPNUve FOk265qmET3ZukKAWfoRO6LTAVkU42llWX7SVWiwoXbj9FJaqgUFPEHG88Q1YVrFXCOS9D vtpdqrr2Fpo/JVjXzVv52JCwSXrbJCFq6H5+IIadBOkV4eXP181/j/tPfPvBGvC0br79ml J+hLN2ORe/GzVb78O0HJ2We7Vjfee+/vJhttBhtbIeRhn9tgA2Ad59qxwWzKQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687325871; 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=Inoc6kAtvG+gUQcD3e/8tdLrrc3pCoErJ8mk3ttqlRw=; b=KYfO056ofABqqXAy5AkgCSo3YU8Rp+LqTzMzo9mTZi/ETGVuULfcuoxp9Bs54izOIbCqII u8eBfL2SZSofUgOIfPDs7Y2MJc30nJciHqZv4Jqnz61/MCQFAB8rNLuO19pgjhOBnga3p4 PrEqzfGubRX4OZXh6oY3oO69RA7TL3qLRpG3Jr1P457LV+7e6XzEoFBhOiu6+Zee3mDmAt 8KOevIE/kHDoKLaxmEpaTx9UG60fKWis/1O48LcJ+xywYmRSbmoO/eUfZATA1Ax37Mwv9f vDBI9WEpin8hB5Q18UZhELjOEBBzGPosuW6oR/0nN/DCiVKvYUWesfXamHtdEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687325871; a=rsa-sha256; cv=none; b=rhKPDMyMg+IErFIuMrC5uk5659iLqPapRGGXRhXvpzcsaFQT9PMgFwOeVfy6mDllW+rJ+c 4354WTpu3whHkHAkS4tXdepJjFQTAJMnYyB6RDOclEwKVpBmNv4SfMHGs61b/6CMQUx+Z1 H4LrRYFyLhW5f4jNK59ODnkDUDxr+oCvn7Yk717++surupOBuol00Tff7cWrjnvbQdq4Gy 77nr0Yon5TAicU/19d9bqbDRsMo6WivpW+HxhHBSLQUMxf5/pIqSrE4FtAYr0AVhbUaGKR NSQPS7+6HZPHrFDwx/7SbcgBzXUTL1mo/zfkcewtI0UkusLam9Mbl+5jvtkusQ== 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 4QmC2Q75dbzVW0; Wed, 21 Jun 2023 05:37:50 +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 35L5boTu048333; Wed, 21 Jun 2023 05:37:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35L5boZ0048332; Wed, 21 Jun 2023 05:37:50 GMT (envelope-from git) Date: Wed, 21 Jun 2023 05:37:50 GMT Message-Id: <202306210537.35L5boZ0048332@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: bc2ac2585aa8 - main - top(8): use designated initializers for sorted_state[] 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bc2ac2585aa89c110861972aeb243719ea5012b8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bc2ac2585aa89c110861972aeb243719ea5012b8 commit bc2ac2585aa89c110861972aeb243719ea5012b8 Author: Konstantin Belousov AuthorDate: 2023-06-19 13:52:05 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-21 05:36:45 +0000 top(8): use designated initializers for sorted_state[] Also correct comments for individual state, duplicating the S* constants descriptions from sys/proc.h [*]. Reviewed by: kevans (previous version) Noted by: Mark Millard [*] Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D40607 --- usr.bin/top/machine.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index c11851ebce63..033861d3f7fb 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -1262,13 +1262,12 @@ compare_tid(const void *p1, const void *p2) */ static const int sorted_state[] = { - 0, /* not used */ - 3, /* sleep */ - 1, /* ABANDONED (WAIT) */ - 6, /* run */ - 5, /* start */ - 2, /* zombie */ - 4 /* stop */ + [SIDL] = 3, /* being created */ + [SRUN] = 1, /* running/runnable */ + [SSLEEP] = 6, /* sleeping */ + [SSTOP] = 5, /* stopped/suspended */ + [SZOMB] = 2, /* zombie */ + [SWAIT] = 4, /* intr */ };