From owner-svn-src-head@freebsd.org Tue Jul 14 18:57:32 2020 Return-Path: Delivered-To: svn-src-head@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 44CD236BF76; Tue, 14 Jul 2020 18:57:32 +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 4B5qWw0jgRz4N0H; Tue, 14 Jul 2020 18:57:32 +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 EB8DCADA5; Tue, 14 Jul 2020 18:57:31 +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 06EIvVfW035947; Tue, 14 Jul 2020 18:57:31 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06EIvVZI035946; Tue, 14 Jul 2020 18:57:31 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <202007141857.06EIvVZI035946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 14 Jul 2020 18:57:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363192 - in head: bin/ps sys/sys X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head: bin/ps sys/sys X-SVN-Commit-Revision: 363192 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jul 2020 18:57:32 -0000 Author: mckusick Date: Tue Jul 14 18:57:31 2020 New Revision: 363192 URL: https://svnweb.freebsd.org/changeset/base/363192 Log: Update to D25266, bin/ps: Make the rtprio option actually show realtime priorities The current `ps -axO rtprio' show threads running at interrupt priority such as the [intr] thread as '1:48' and threads running at kernel priority such as [pagedaemon] as normal:4294967260. This change shows [intr] as intr:48 and [pagedaemon] as kernel:4. Reviewed by: kib MFC after: 1 week (together with -r362369) Differential Revision: https://reviews.freebsd.org/D25660 Modified: head/bin/ps/print.c head/sys/sys/rtprio.h Modified: head/bin/ps/print.c ============================================================================== --- head/bin/ps/print.c Tue Jul 14 18:50:48 2020 (r363191) +++ head/bin/ps/print.c Tue Jul 14 18:57:31 2020 (r363192) @@ -723,11 +723,18 @@ priorityr(KINFO *k, VARENT *ve __unused) break; case RTP_PRIO_NORMAL: /* alias for PRI_TIMESHARE */ - asprintf(&str, "normal:%u", level - PRI_MIN_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 RTP_PRIO_IDLE: /* alias for PRI_IDLE */ asprintf(&str, "idle:%u", level - PRI_MIN_IDLE); + break; + 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: head/sys/sys/rtprio.h ============================================================================== --- head/sys/sys/rtprio.h Tue Jul 14 18:50:48 2020 (r363191) +++ head/sys/sys/rtprio.h Tue Jul 14 18:57:31 2020 (r363192) @@ -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 */