I've looked but not found (and I hope I'm in the right group here): Is
there a way to get the user time and system time of a /running/ child
from its parent (without having to mount procfs)? As far as I was able
to tell, I can get the total of user and system time using
kvm_getprocs, but it doesn't seem possible to get both values
separately.
Regards,
Jay
_______________________________________________
freebsd...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hacke...@freebsd.org"
If you have only one child, there's getrusage(2).
DES
--
Dag-Erling Smørgrav - d...@des.no
Unfortunately, that only works for children that have terminated, not
for active children. I'm interested in active children.
Jay
Hmm, we could probably add a ptrace(2) operation, but ptrace(2) is
inherently evil.
DES
--
Dag-Erling Smørgrav - d...@des.no
-Boris
Read the original post.
DES
--
Dag-Erling Smørgrav - d...@des.no
Unfortunately, as far as I can see the kinfo_proc structure only contains
the sum of user time and system time and not the two values separately,
or have I missed something?
Jay
On Thu, Nov 19, 2009 at 5:34 PM, Dan Nelson <dne...@allantgroup.com> wrote:
> In the last episode (Nov 19), Koffie Yahoo said:
>> > It's not as portable as getrusage(2), but you could probably get the
>> > information you want using libkvm's kvm_getprocs(3) function. The
>> > information available is defined in the kinfo_proc structure in
>> > /usr/include/sys/user.h.
>>
>> Unfortunately, as far as I can see the kinfo_proc structure only contains
>> the sum of user time and system time and not the two values separately,
>> or have I missed something?
>
> Take a look at the the ki_rusage struct inside kinfo_proc.
>
> --
> � � � �Dan Nelson
> � � � �dne...@allantgroup.com