News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Cache watch in Visual Studio?

Started by Ralphy, February 15, 2022, 06:37:00 AM

Previous topic - Next topic

Ralphy

Hello, noob here with a question. How can I see the contents of a CPU core cache (data and code) during debugging? Is this possible with Visual Studio? I'm curious to see proof of effective use or fencing, alignment and non-temporal movs to find opportunities for optimization.

hutch--

Ralphy,

I think the clock is your friend here, its tedious but constructing test pieces and accurately timing them is probably the best you can do here.

Ralphy

Hi hutch,

  There must be a way :). We can prefetch data into a line, maybe there's an op in level 0 to read lines as well. Hard to believe kernel and driver devs don't sneak a peak. Timing is tricky now, CPUs use the same accountant that's calculating current inflation numbers for the fed. There must be a way..

johnsa

I think you'll find that the only way to interrogate this sort of information would be through model specific MSR registers. Access to these would be privileged, and their contents mostly irrelevant in a multi-tasking OS.
Really the best way to determine if code changes such as non temporal stores etc are having a performance impact is to measure time taken. You can get very accurate timing with high resolution timers and RDTSC etc.