Skip site navigation (1)Skip section navigation (2)
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

[-- Attachment #1 --]
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@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.

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (FreeBSD)

iEYEARECAAYFAkmchAEACgkQmprOCmdXAD1L/gCfVn828SouTXKgSeGGlxtTS6Fq
6KEAn2fQJKeFDilI/8Ca6wxpHjulB8G9
=Za0g
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090218215618.GV81076>