Make sure the value of "upr" (scheduling priority on return from system call)
is scaled in the same way that "pri" (scheduling priority) is scaled. Submitted by: Cyrille Lefevre
This commit is contained in:
parent
31172f6e1b
commit
820434b27f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=130974
@ -82,6 +82,7 @@ void tdev(KINFO *, VARENT *);
|
||||
void tname(KINFO *, VARENT *);
|
||||
void ucomm(KINFO *, VARENT *);
|
||||
void uname(KINFO *, VARENT *);
|
||||
void upr(KINFO *, VARENT *);
|
||||
void vsize(KINFO *, VARENT *);
|
||||
void wchan(KINFO *, VARENT *);
|
||||
__END_DECLS
|
||||
|
@ -197,8 +197,7 @@ static VAR var[] = {
|
||||
0},
|
||||
{"uid", "UID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_uid), UINT,
|
||||
UIDFMT, 0},
|
||||
{"upr", "UPR", NULL, 0, kvar, NULL, 3, KOFF(ki_pri.pri_user), UCHAR,
|
||||
"d", 0},
|
||||
{"upr", "UPR", NULL, 0, upr, NULL, 3, 0, CHAR, NULL, 0},
|
||||
{"uprocp", "UPROCP", NULL, 0, kvar, NULL, 8, KOFF(ki_paddr), KPTR,
|
||||
"lx", 0},
|
||||
{"user", "USER", NULL, LJUST|DSIZ, uname, s_uname, USERLEN, 0, CHAR,
|
||||
|
@ -265,15 +265,27 @@ state(KINFO *k, VARENT *ve)
|
||||
(void)printf("%-*s", v->width, buf);
|
||||
}
|
||||
|
||||
#define scalepri(x) ((x) - PZERO)
|
||||
|
||||
void
|
||||
pri(KINFO *k, VARENT *ve)
|
||||
{
|
||||
VAR *v;
|
||||
|
||||
v = ve->var;
|
||||
(void)printf("%*d", v->width, k->ki_p->ki_pri.pri_level - PZERO);
|
||||
(void)printf("%*d", v->width, scalepri(k->ki_p->ki_pri.pri_level));
|
||||
}
|
||||
|
||||
void
|
||||
upr(KINFO *k, VARENT *ve)
|
||||
{
|
||||
VAR *v;
|
||||
|
||||
v = ve->var;
|
||||
(void)printf("%*d", v->width, scalepri(k->ki_p->ki_pri.pri_user));
|
||||
}
|
||||
#undef scalepri
|
||||
|
||||
void
|
||||
uname(KINFO *k, VARENT *ve)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user