From owner-freebsd-current@FreeBSD.ORG Mon Jan 14 21:39:19 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A19CDA29 for ; Mon, 14 Jan 2013 21:39:19 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 76BEECCA for ; Mon, 14 Jan 2013 21:39:19 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id DA5D7B945 for ; Mon, 14 Jan 2013 16:39:18 -0500 (EST) From: John Baldwin To: FreeBSD Current Subject: [PATCH] Add rusage reporting to procstat Date: Mon, 14 Jan 2013 16:39:17 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201301141639.17783.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 14 Jan 2013 16:39:18 -0500 (EST) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jan 2013 21:39:19 -0000 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.? -- John Baldwin