Obtaining l2 misses and cpu utilization in a module
David Wolfskill
david at catwhisker.org
Wed Feb 18 13:56:20 PST 2009
On Wed, Feb 18, 2009 at 08:18:20PM +0100, Nikola Kne??evi?? wrote:
> Hi,
>
> I would like to obtain fore mentioned data from within my module. I
> need these performance metrics to see how certain code executes, and
> make decisions during the runtime. pmc(3) seems complete, but it also
> seems to be intended for use in the userland.
>
> How to use pmc from modules? Is there any other way? Also, module is
> 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
--
David H. Wolfskill david at 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20090218/2d5a3db0/attachment.pgp
More information about the freebsd-hackers
mailing list