From owner-freebsd-hackers Sun Mar 12 7:44:41 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from mimer.webgiro.com (mimer.webgiro.com [212.209.29.5]) by hub.freebsd.org (Postfix) with ESMTP id 908F237BE1F; Sun, 12 Mar 2000 07:44:37 -0800 (PST) (envelope-from abial@webgiro.com) Received: by mimer.webgiro.com (Postfix, from userid 66) id 2F2162DC07; Sun, 12 Mar 2000 16:49:07 +0100 (CET) Received: by mx.webgiro.com (Postfix, from userid 1001) id 3F7477811; Sun, 12 Mar 2000 16:42:28 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mx.webgiro.com (Postfix) with ESMTP id 3965810E16; Sun, 12 Mar 2000 16:42:28 +0100 (CET) Date: Sun, 12 Mar 2000 16:42:26 +0100 (CET) From: Andrzej Bialecki To: Kris Kennaway Cc: freebsd-hackers@FreeBSD.ORG, jkh@freebsd.org Subject: Re: Getting CPU usage in FreeBSD In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1673614147-952875746=:23703" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --0-1673614147-952875746=:23703 Content-Type: TEXT/PLAIN; charset=US-ASCII On Sat, 11 Mar 2000, Kris Kennaway wrote: > On Sun, 12 Mar 2000, Oliver Fromme wrote: > > > Then look up the definition of kread() in the same file, and > > how the contents of cur.cp_time are used in the cpustats() > > function. Note that "cur" is a "struct statinfo", which is > > defined in /usr/include/devstat.h. The CPU states are defined > > in /usr/include/sys/dkstat.h. > > We probably should make this into a sysctl to divorce the binaries from > having to read kvm. I'm definitely for it... If I can get permission from Jordan, perhaps the attached patches can make it into upcoming release. Andrzej Bialecki // WebGiro AB, Sweden (http://www.webgiro.com) // ------------------------------------------------------------------- // ------ FreeBSD: The Power to Serve. http://www.freebsd.org -------- // --- Small & Embedded FreeBSD: http://www.freebsd.org/~picobsd/ ---- --0-1673614147-952875746=:23703 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="sysctl.diff" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="sysctl.diff" SW5kZXg6IHN5c2N0bC5jDQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQpSQ1Mg ZmlsZTogL2hvbWUvbmN2cy9zcmMvc2Jpbi9zeXNjdGwvc3lzY3RsLmMsdg0K cmV0cmlldmluZyByZXZpc2lvbiAxLjI1DQpkaWZmIC11IC1yMS4yNSBzeXNj dGwuYw0KLS0tIHN5c2N0bC5jCTE5OTkvMTEvMjIgMDg6NDM6MDAJMS4yNQ0K KysrIHN5c2N0bC5jCTIwMDAvMDMvMTIgMTU6MzU6MTINCkBAIC00Niw2ICs0 Niw3IEBADQogI2VuZGlmIC8qIG5vdCBsaW50ICovDQogDQogI2luY2x1ZGUg PHN5cy90eXBlcy5oPg0KKyNpbmNsdWRlIDxzeXMvZGtzdGF0Lmg+DQogI2lu Y2x1ZGUgPHN5cy9zdGF0Lmg+DQogI2luY2x1ZGUgPHN5cy9zeXNjdGwuaD4N CiAjaW5jbHVkZSA8c3lzL3Jlc291cmNlLmg+DQpAQCAtMjE5LDYgKzIyMCwy OSBAQA0KIC8qIFRoZXNlIGZ1bmN0aW9ucyB3aWxsIGR1bXAgb3V0IHZhcmlv dXMgaW50ZXJlc3Rpbmcgc3RydWN0dXJlcy4gKi8NCiANCiBzdGF0aWMgaW50 DQorU19jcHVfdGltZShpbnQgbDIsIHZvaWQgKnApDQorew0KKwlsb25nICpj cHQ9KGxvbmcgKilwOw0KKwlkb3VibGUgZCx0b3RhbDsNCisJaW50IGk7DQor DQorCXRvdGFsPTA7DQorCWZvcihpPTA7aTxDUFVTVEFURVM7aSsrKQ0KKwkJ dG90YWwrPSooY3B0K2kpOw0KKwlkPTEwMCoqKGNwdCtDUF9VU0VSKS90b3Rh bDsNCisJcHJpbnRmKCJ7IHVzZXI9JS4wZiUlICIsZCk7DQorCWQ9MTAwKioo Y3B0K0NQX05JQ0UpL3RvdGFsOw0KKwlwcmludGYoIm5pY2U9JS4wZiUlICIs ZCk7DQorCWQ9MTAwKiooY3B0K0NQX1NZUykvdG90YWw7DQorCXByaW50Zigi c3lzPSUuMGYlJSAiLGQpOw0KKwlkPTEwMCoqKGNwdCtDUF9JTlRSKS90b3Rh bDsNCisJcHJpbnRmKCJpbnRyPSUuMGYlJSAiLGQpOw0KKwlkPTEwMCoqKGNw dCtDUF9JRExFKS90b3RhbDsNCisJcHJpbnRmKCJpZGxlPSUuMGYlJSB9Iixk KTsNCisJcmV0dXJuKDApOw0KK30NCisNCitzdGF0aWMgaW50DQogU19jbG9j a2luZm8oaW50IGwyLCB2b2lkICpwKQ0KIHsNCiAJc3RydWN0IGNsb2NraW5m byAqY2kgPSAoc3RydWN0IGNsb2NraW5mbyopcDsNCkBAIC00MTcsNiArNDQx LDcgQEANCiAJY2FzZSAnUyc6DQogCQlpID0gMDsNCiAJCWlmICghc3RyY21w KGZtdCwgIlMsY2xvY2tpbmZvIikpCWZ1bmMgPSBTX2Nsb2NraW5mbzsNCisJ CWVsc2UgaWYgKCFzdHJjbXAoZm10LCAiUyxjcHVfdGltZSIpKQlmdW5jID0g U19jcHVfdGltZTsNCiAJCWVsc2UgaWYgKCFzdHJjbXAoZm10LCAiUyx0aW1l dmFsIikpCWZ1bmMgPSBTX3RpbWV2YWw7DQogCQllbHNlIGlmICghc3RyY21w KGZtdCwgIlMsbG9hZGF2ZyIpKQlmdW5jID0gU19sb2FkYXZnOw0KIAkJZWxz ZSBpZiAoIXN0cmNtcChmbXQsICJULGRldl90IikpCWZ1bmMgPSBUX2Rldl90 Ow0K --0-1673614147-952875746=:23703 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="kern_clock.diff" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="kern_clock.diff" SW5kZXg6IGtlcm5fY2xvY2suYw0KPT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0K UkNTIGZpbGU6IC9ob21lL25jdnMvc3JjL3N5cy9rZXJuL2tlcm5fY2xvY2su Yyx2DQpyZXRyaWV2aW5nIHJldmlzaW9uIDEuMTA1DQpkaWZmIC11IC1yMS4x MDUga2Vybl9jbG9jay5jDQotLS0ga2Vybl9jbG9jay5jCTIwMDAvMDIvMTMg MTA6NTY6MzIJMS4xMDUNCisrKyBrZXJuX2Nsb2NrLmMJMjAwMC8wMy8xMiAx NTozNTo0NA0KQEAgLTEwNSw2ICsxMDUsOSBAQA0KIFNZU0NUTF9TVFJVQ1Qo X2tlcm4sIEtFUk5fQk9PVFRJTUUsIGJvb3R0aW1lLCBDVExGTEFHX1JELA0K ICAgICAmYm9vdHRpbWUsIHRpbWV2YWwsICJTeXN0ZW0gYm9vdHRpbWUiKTsN CiANCitTWVNDVExfT1BBUVVFKF9rZXJuLCBPSURfQVVUTywgY3B1X3RpbWUs IENUTEZMQUdfUkQsICZjcF90aW1lLA0KKwlzaXplb2YoY3BfdGltZSksICJT LGNwdV90aW1lIiwgIkNQVSB0aW1lcyIpOw0KKw0KIC8qDQogICogV2hpY2gg dXBkYXRlIHBvbGljeSB0byB1c2UuDQogICogICAwIC0gZXZlcnkgdGljaywg YmFkIGhhcmR3YXJlIG1heSBmYWlsIHdpdGggImNhbGNydSBuZWdhdGl2ZS4u LiINCg== --0-1673614147-952875746=:23703-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message