From 42e4359156778c5392a805e59e80dc139c81f48d Mon Sep 17 00:00:00 2001 From: Yaroslav Tykhiy Date: Tue, 25 Jul 2006 22:39:57 +0000 Subject: [PATCH] Rev. 1.44 of this file didn't introduce a right solution, but we don't seem to have one yet, so just add an XXX comment on passing rux_runtime to bintime2timeval() wrongly. Spotted by: gcc(1) (warning) --- lib/libkvm/kvm_proc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c index 250cb44f20bd..acf040c579df 100644 --- a/lib/libkvm/kvm_proc.c +++ b/lib/libkvm/kvm_proc.c @@ -374,6 +374,13 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt) kp->ki_lockname, LOCKNAMELEN); kp->ki_lockname[LOCKNAMELEN] = 0; } + /* + * XXX: This is plain wrong, rux_runtime has nothing + * to do with struct bintime, rux_runtime is just a 64-bit + * integer counter of cputicks. What we need here is a way + * to convert cputicks to usecs. The kernel does it in + * kern/kern_tc.c, but the function can't be just copied. + */ bintime2timeval(&proc.p_rux.rux_runtime, &tv); kp->ki_runtime = (u_int64_t)tv.tv_sec * 1000000 + tv.tv_usec; kp->ki_pid = proc.p_pid;