Date: Sun, 12 Mar 2000 16:42:26 +0100 (CET) From: Andrzej Bialecki <abial@webgiro.com> To: Kris Kennaway <kris@hub.freebsd.org> Cc: freebsd-hackers@FreeBSD.ORG, jkh@freebsd.org Subject: Re: Getting CPU usage in FreeBSD Message-ID: <Pine.BSF.4.20.0003121640390.23703-300000@mx.webgiro.com> In-Reply-To: <Pine.BSF.4.21.0003112336140.85709-100000@hub.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 // <abial@webgiro.com> 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: <Pine.BSF.4.20.0003121642260.23703@mx.webgiro.com> Content-Description: Content-Disposition: attachment; filename="sysctl.diff" SW5kZXg6IHN5c2N0bC5jDQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQpSQ1Mg ZmlsZTogL2hvbWUvbmN2cy9zcmMvc2Jpbi9zeXNjdGwvc3lzY3RsLmMsdg0K cmV0cm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PTEwMCoqKGNw 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: <Pine.BSF.4.20.0003121642261.23703@mx.webgiro.com> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.20.0003121640390.23703-300000>