[PATCH] Add rusage reporting to procstat
Konstantin Belousov
kostikbel at gmail.com
Mon Jan 14 22:44:51 UTC 2013
On Mon, Jan 14, 2013 at 04:39:17PM -0500, John Baldwin wrote:
> This patch adds a new -r flag to dump the resource usage information (what you
> would get from getrusage() or wait()) for a given process. Sample output:
>
> % procstat -r $$
> PID COMM TYPE VALUE
> 1428 tcsh user time 00:00:00.050182
> 1428 tcsh system time 00:00:00.040145
> 1428 tcsh maximum RSS 3328 B
> 1428 tcsh integral shared memory 2844 B
> 1428 tcsh integral unshared data 6372 B
> 1428 tcsh integral unshared stack 1152 B
> 1428 tcsh page reclaims 1306
> 1428 tcsh page faults 12
> 1428 tcsh swaps 0
> 1428 tcsh block reads 50
> 1428 tcsh block writes 0
> 1428 tcsh messages sent 172
> 1428 tcsh messages received 0
> 1428 tcsh signals received 33
> 1428 tcsh voluntary context switches 1167
> 1428 tcsh involuntary context switches 1
>
> http://www.FreeBSD.org/~jhb/patches/procstat_rusage.patch
>
> Any thoughts, etc.?
It looks fine, but use of the human-oriented resource values, together
with spaces in names, makes the parsing of the output unfeasible.
The patch only reports the process-cumulative rusage, and not the per-thread
rusage, it seems.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20130115/515a0110/attachment.sig>
More information about the freebsd-current
mailing list