Date: Wed, 18 Feb 2009 13:56:18 -0800 From: David Wolfskill <david@catwhisker.org> To: Nikola Kne??evi?? <laladelausanne@gmail.com> Cc: freebsd-hackers@freebsd.org Subject: Re: Obtaining l2 misses and cpu utilization in a module Message-ID: <20090218215618.GV81076@albert.catwhisker.org> In-Reply-To: <E8C5F8E2-9482-45FE-B5F8-4232193B263C@gmail.com> References: <E8C5F8E2-9482-45FE-B5F8-4232193B263C@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--xoUDadTz98C4LPSf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 18, 2009 at 08:18:20PM +0100, Nikola Kne??evi?? wrote: > Hi, >=20 > I would like to obtain fore mentioned data from within my module. I =20 > need these performance metrics to see how certain code executes, and =20 > make decisions during the runtime. pmc(3) seems complete, but it also =20 > seems to be intended for use in the userland. >=20 > How to use pmc from modules? Is there any other way? Also, module is =20 > amd64 only, so I don't care about portability. I'm not sure what you mean by "module" ini this context. But CPU utilization my be found in the kern.cp_time sysctl value; per-core utilization may be found in the kern.cp_times sysctl value. Note that these are arrays of counters; a given set of values will be foir "user", "nice", "system", "interrupt", and "idle" CPU time (in that order). The differences between respective counters at each end of a time interval of interest will be informative. Peace, david --=20 David H. Wolfskill david@catwhisker.org Depriving a girl or boy of an opportunity for education is evil. See http://www.catwhisker.org/~david/publickey.gpg for my public key. --xoUDadTz98C4LPSf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkmchAEACgkQmprOCmdXAD1L/gCfVn828SouTXKgSeGGlxtTS6Fq 6KEAn2fQJKeFDilI/8Ca6wxpHjulB8G9 =Za0g -----END PGP SIGNATURE----- --xoUDadTz98C4LPSf--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090218215618.GV81076>