From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 19 16:53:38 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 782BD1065693 for ; Thu, 19 Nov 2009 16:53:38 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from email1.allantgroup.com (email1.emsphone.com [199.67.51.115]) by mx1.freebsd.org (Postfix) with ESMTP id 393EC8FC08 for ; Thu, 19 Nov 2009 16:53:38 +0000 (UTC) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by email1.allantgroup.com (8.14.0/8.14.0) with ESMTP id nAJGYgaL037160 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 19 Nov 2009 10:34:42 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.14.3/8.14.3) with ESMTP id nAJGYgNK031440 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 19 Nov 2009 10:34:42 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.3/8.14.3/Submit) id nAJGYfPX031309; Thu, 19 Nov 2009 10:34:41 -0600 (CST) (envelope-from dan) Date: Thu, 19 Nov 2009 10:34:40 -0600 From: Dan Nelson To: Koffie Yahoo Message-ID: <20091119163437.GE89004@dan.emsphone.com> References: <9cb658f10911190214j5a6bc17fq200a82ea0b4acaa8@mail.gmail.com> <86ocmy63ww.fsf@ds4.des.no> <9cb658f10911190652j555e4484u2427d2bed87871f8@mail.gmail.com> <4B056039.4040802@acm.poly.edu> <9cb658f10911190715p404da03er9446b5dc5c31cb78@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9cb658f10911190715p404da03er9446b5dc5c31cb78@mail.gmail.com> X-OS: FreeBSD 7.2-STABLE User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: ClamAV version 0.94.1, clamav-milter version 0.94.1 on email1.allantgroup.com X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (email1.allantgroup.com [199.67.51.78]); Thu, 19 Nov 2009 10:34:42 -0600 (CST) X-Scanned-By: MIMEDefang 2.45 Cc: freebsd-hackers@freebsd.org Subject: Re: Getting running time of child X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Nov 2009 16:53:38 -0000 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 dnelson@allantgroup.com