Counting TLB and CPU cache misses

Hi guys,

I’m involved with a profiler tool that is intended to reduce number of page faults (TLB misses) as well as code / data misses in CPU cache. Is there any API / counters / techniques that would let me count such events, other than direct access to CPU registers?

TIA,

Vladimir

In user mode there’s the API that perfmon.exe uses. I forget what it’s
called, but it’s documented. I don’t know if it has what you are looking
for, but you might want to start perfmon.exe and see what’s available.

From both user and kernel mode, there’s ETW, though I don’t think that that
will help you with this sort of architectural information.

Good luck,

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Wednesday, March 30, 2011 6:12 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Counting TLB and CPU cache misses

Hi guys,

I’m involved with a profiler tool that is intended to reduce number of page
faults (TLB misses) as well as code / data misses in CPU cache. Is there any
API / counters / techniques that would let me count such events, other than
direct access to CPU registers?

TIA,

Vladimir


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Windows Vista and later you can use ETW tracing to start and configure the
NT kernel logger session which collects pagefault events. Some links:
http://msdn.microsoft.com/en-us/library/aa363691(v=vs.85).aspx
http://msdn.microsoft.com/en-us/library/dd765153(v=vs.85).aspx

For CPU cache misses, I think you have to delve in the CPU manuals.

//Daniel

wrote in message news:xxxxx@ntdev…
> Hi guys,
>
> I’m involved with a profiler tool that is intended to reduce number of
> page faults (TLB misses) as well as code / data misses in CPU cache. Is
> there any API / counters / techniques that would let me count such events,
> other than direct access to CPU registers?
>
> TIA,
>
> Vladimir
>