Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Feb 2009 08:16:54 +0530
From:      Joseph Koshy <joseph.koshy@gmail.com>
To:        =?ISO-8859-2?Q?Nikola_Kne=BEevi=E6?= <laladelausanne@gmail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Obtaining l2 misses and cpu utilization in a module
Message-ID:  <84dead720902181846o7c1ca09fx93fa156d262cc610@mail.gmail.com>
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
> 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.

At this point of time there isn't an in-kernel API for using hwpmc(4)
(but it is on the task list, see:
http://code.google.com/p/pmctools/issues/detail?id=17).

For now, you could configure hwpmc(4) to not touch specific PMC
registers using the OP_PMCADMIN request (i.e., use pmccontrol -d).
After this you can use those registers from your kernel module without
interference from hwpmc.

Koshy



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