mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-26 16:18:31 +00:00
T -CURRENT DO NOT CRASH UPON ^T K PLZ THX.
Also, use sched_pctcpu() instead of assuming td->td_kse is non-NULL.
This commit is contained in:
parent
453d919e1d
commit
a0ed09c0af
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=125794
@ -103,6 +103,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/resourcevar.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/filedesc.h>
|
||||
#include <sys/sched.h>
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
#include <vm/vm.h>
|
||||
@ -2467,7 +2468,7 @@ ttyinfo(struct tty *tp)
|
||||
else
|
||||
state = "unknown";
|
||||
calcru(pick, &utime, &stime, NULL);
|
||||
pctcpu = (td->td_kse->ke_pctcpu * 10000 + FSCALE / 2) >> FSHIFT;
|
||||
pctcpu = (sched_pctcpu(td) * 10000 + FSCALE / 2) >> FSHIFT;
|
||||
if (pick->p_state == PRS_NEW || pick->p_state == PRS_ZOMBIE)
|
||||
rss = 0;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user