- Use rufetchcalc() rather than calcru() in ttyinfo so that we get

correct system and user time stats.

Approved by:	re
Reported by:	kris
Discussed with:	Attilio
This commit is contained in:
Jeff Roberson 2007-07-01 00:17:59 +00:00
parent d81b3a5588
commit 03d03260b2

View File

@ -2536,6 +2536,7 @@ ttyinfo(struct tty *tp)
int load, pctcpu;
pid_t pid;
char comm[MAXCOMLEN + 1];
struct rusage ru;
if (ttycheckoutq(tp,0) == 0)
return;
@ -2615,9 +2616,7 @@ ttyinfo(struct tty *tp)
PROC_SUNLOCK(pick);
PROC_LOCK(pick);
PGRP_UNLOCK(tp->t_pgrp);
PROC_SLOCK(pick);
calcru(pick, &utime, &stime);
PROC_SUNLOCK(pick);
rufetchcalc(pick, &ru, &utime, &stime);
pid = pick->p_pid;
bcopy(pick->p_comm, comm, sizeof(comm));
PROC_UNLOCK(pick);