summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorKirk McKusick <mckusick@FreeBSD.org>2020-07-14 18:57:31 +0000
committerKirk McKusick <mckusick@FreeBSD.org>2020-07-14 18:57:31 +0000
commit4a022f0e0697bcfe84f02eaf9d5cf193e01feec0 (patch)
treec166446fa0cae3a16f85f687c804ea439729e01d /bin
parenta7f1b0cac972c5eba2e9602835e065b647f8a01f (diff)
downloadsrc-test-4a022f0e0697bcfe84f02eaf9d5cf193e01feec0.tar.gz
src-test-4a022f0e0697bcfe84f02eaf9d5cf193e01feec0.zip
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
Notes
Notes: svn path=/head/; revision=363192
Diffstat (limited to 'bin')
-rw-r--r--bin/ps/print.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/ps/print.c b/bin/ps/print.c
index b4458b453cdd7..3d3a543c8a5df 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -723,12 +723,19 @@ 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);
break;