From owner-freebsd-hackers Sun Mar 12 21:31:56 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from sharmas.dhs.org (c62443-a.frmt1.sfba.home.com [24.0.69.165]) by hub.freebsd.org (Postfix) with ESMTP id A828537B545 for ; Sun, 12 Mar 2000 21:31:52 -0800 (PST) (envelope-from adsharma@sharmas.dhs.org) Received: (from adsharma@localhost) by sharmas.dhs.org (8.9.3/8.9.3) id VAA01702; Sun, 12 Mar 2000 21:31:34 -0800 Date: Sun, 12 Mar 2000 21:31:34 -0800 From: Arun Sharma Message-Id: <200003130531.VAA01702@sharmas.dhs.org> To: guazzibe@dcc.unicamp.br Cc: freebsd-hackers@freebsd.org Subject: Re: Getting CPU usage in FreeBSD In-Reply-To: References: Reply-To: adsharma@sharmas.dhs.org Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > On Linux this is what I do to get this value: Measure the number of > scheduled jiffies (hundreths of second), measure elapsed time since last > measurement, divide. I ran into the same problem as you - and took the time to implement it. My patches fix the SMP case as well as getting it via sysctl instead of kvm_read. See: http://www.FreeBSD.org/cgi/getmsg.cgi?fetch=169412+180922+/usr/local/www/db/text/1999/freebsd-hackers/19991212.freebsd-hackers http://www.freebsd.org/cgi/getmsg.cgi?fetch=293002+0+/usr/local/www/db/text/1999/freebsd-hackers/19991226.freebsd-hackers -Arun To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message