From owner-svn-src-all@freebsd.org Tue Jul 21 23:23:09 2020 Return-Path: Delivered-To: svn-src-all@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 7D8B236ACEA; Tue, 21 Jul 2020 23:23:09 +0000 (UTC) (envelope-from mckusick@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBF592nQQz4P1X; Tue, 21 Jul 2020 23:23:09 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2AE6826355; Tue, 21 Jul 2020 23:23:09 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06LNN9rB055916; Tue, 21 Jul 2020 23:23:09 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06LNN8Za055914; Tue, 21 Jul 2020 23:23:08 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <202007212323.06LNN8Za055914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 21 Jul 2020 23:23:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363405 - in stable/12: bin/ps sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in stable/12: bin/ps sys/sys X-SVN-Commit-Revision: 363405 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2020 23:23:09 -0000 Author: mckusick Date: Tue Jul 21 23:23:08 2020 New Revision: 363405 URL: https://svnweb.freebsd.org/changeset/base/363405 Log: MFC of 362369 (by Lorenzo Salvadore) and 363192 Refinement of /bin/ps rtprio output Modified: stable/12/bin/ps/print.c stable/12/bin/ps/ps.1 stable/12/sys/sys/rtprio.h Directory Properties: stable/12/ (props changed) Modified: stable/12/bin/ps/print.c ============================================================================== --- stable/12/bin/ps/print.c Tue Jul 21 22:47:02 2020 (r363404) +++ stable/12/bin/ps/print.c Tue Jul 21 23:23:08 2020 (r363405) @@ -717,17 +717,24 @@ priorityr(KINFO *k, VARENT *ve __unused) class = lpri->pri_class; level = lpri->pri_level; switch (class) { - case PRI_ITHD: - asprintf(&str, "intr:%u", level); + case RTP_PRIO_REALTIME: + /* alias for PRI_REALTIME */ + asprintf(&str, "real:%u", level - PRI_MIN_REALTIME); break; - case PRI_REALTIME: - asprintf(&str, "real:%u", level); + case RTP_PRIO_NORMAL: + /* alias for PRI_TIMESHARE */ + if (level >= PRI_MIN_TIMESHARE) + asprintf(&str, "normal:%u", level - PRI_MIN_TIMESHARE); + else + asprintf(&str, "kernel:%u", level - PRI_MIN_KERN); break; - case PRI_TIMESHARE: - asprintf(&str, "normal"); + case RTP_PRIO_IDLE: + /* alias for PRI_IDLE */ + asprintf(&str, "idle:%u", level - PRI_MIN_IDLE); break; - case PRI_IDLE: - asprintf(&str, "idle:%u", level); + case RTP_PRIO_ITHD: + /* alias for PRI_ITHD */ + asprintf(&str, "intr:%u", level - PRI_MIN_ITHD); break; default: asprintf(&str, "%u:%u", class, level); Modified: stable/12/bin/ps/ps.1 ============================================================================== --- stable/12/bin/ps/ps.1 Tue Jul 21 22:47:02 2020 (r363404) +++ stable/12/bin/ps/ps.1 Tue Jul 21 23:23:08 2020 (r363405) @@ -649,7 +649,8 @@ group name (from rgid) .It Cm rss resident set size .It Cm rtprio -realtime priority (101 = not a realtime process) +realtime priority (see +.Xr rtprio 1) .It Cm ruid real user ID .It Cm ruser Modified: stable/12/sys/sys/rtprio.h ============================================================================== --- stable/12/sys/sys/rtprio.h Tue Jul 21 22:47:02 2020 (r363404) +++ stable/12/sys/sys/rtprio.h Tue Jul 21 23:23:08 2020 (r363405) @@ -44,6 +44,7 @@ /* priority types. Start at 1 to catch uninitialized fields. */ +#define RTP_PRIO_ITHD PRI_ITHD /* Interrupt thread. */ #define RTP_PRIO_REALTIME PRI_REALTIME /* real time process */ #define RTP_PRIO_NORMAL PRI_TIMESHARE /* time sharing process */ #define RTP_PRIO_IDLE PRI_IDLE /* idle process */