Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Jul 2020 18:57:31 +0000 (UTC)
From:      Kirk McKusick <mckusick@FreeBSD.org>
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
Message-ID:  <202007141857.06EIvVZI035946@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202007141857.06EIvVZI035946>