aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJeff Roberson <jeff@FreeBSD.org>2007-07-01 00:17:59 +0000
committerJeff Roberson <jeff@FreeBSD.org>2007-07-01 00:17:59 +0000
commit03d03260b2d5fd8621db866cc7143ae78271b19a (patch)
treef1c8e250a87609ff405475bd96a5e09552023368 /sys
parentd81b3a5588d407699925c3a0f30d2c5fc9279281 (diff)
downloadsrc-03d03260b2d5fd8621db866cc7143ae78271b19a.tar.gz
src-03d03260b2d5fd8621db866cc7143ae78271b19a.zip
- 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
Notes
Notes: svn path=/head/; revision=171126
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 90b7c7a7accf..95b092b8fffe 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);