Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Sep 2017 16:18:06 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r323225 - head/bin/ps
Message-ID:  <201709061618.v86GI6Rc032057@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Wed Sep  6 16:18:06 2017
New Revision: 323225
URL: https://svnweb.freebsd.org/changeset/base/323225

Log:
  Reflect realtime and idle priorities in ps(1) state flags, same like
  we do for the usual nice values.  It could be argued that they should
  use another set of indicators, since the underlying mechanism is
  different, but they match the description in the manual page, and so
  I think it's ok to not overcomplicate things.
  
  PR:		81757
  MFC after:	2 weeks
  Sponsored by:	DARPA, AFRL

Modified:
  head/bin/ps/print.c

Modified: head/bin/ps/print.c
==============================================================================
--- head/bin/ps/print.c	Wed Sep  6 16:16:11 2017	(r323224)
+++ head/bin/ps/print.c	Wed Sep  6 16:18:06 2017	(r323225)
@@ -262,9 +262,9 @@ state(KINFO *k, VARENT *ve __unused)
 	cp++;
 	if (!(flag & P_INMEM))
 		*cp++ = 'W';
-	if (k->ki_p->ki_nice < NZERO)
+	if (k->ki_p->ki_nice < NZERO || k->ki_p->ki_pri.pri_class == PRI_REALTIME)
 		*cp++ = '<';
-	else if (k->ki_p->ki_nice > NZERO)
+	else if (k->ki_p->ki_nice > NZERO || k->ki_p->ki_pri.pri_class == PRI_IDLE)
 		*cp++ = 'N';
 	if (flag & P_TRACED)
 		*cp++ = 'X';



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