summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2007-07-01 00:17:59 +0000
committerjeff <jeff@FreeBSD.org>2007-07-01 00:17:59 +0000
commit4392265a3a92d08b64e152fc5ebefd41fdcdfd17 (patch)
treef1c8e250a87609ff405475bd96a5e09552023368 /sys
parent76b4b5f6b064569bcf43b44df19092d7dccf525b (diff)
downloadFreeBSD-src-4392265a3a92d08b64e152fc5ebefd41fdcdfd17.zip
FreeBSD-src-4392265a3a92d08b64e152fc5ebefd41fdcdfd17.tar.gz
- 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
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/tty.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index 90b7c7a..95b092b 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -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);
OpenPOWER on IntegriCloud