In the last episode (Nov 18), cronfy said:
> Is it possible to find out how much a process have used CPU user
> time/system time/IO operations for now by it's pid?  Like in sa, but for
> running process.

It's available to userland programs via the kern.proc.all syscall.  it
returns an array of "struct kinfo_proc", one for each process.  One of the
elements is ki_rusage, which contains the data that the sa command uses.

The ps command can easily be extended to print these fields.  See this patch
at http://lists.freebsd.org/pipermail/freebsd-hackers/2009-March/027918.html
for an example.  (I still need to file that PR...)

-- 
        Dan Nelson
        dnel...@allantgroup.com
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to