instruction retired sample begin/end

instruction retired sample begin/end

I have a need to sample the instruction retired at the begin and end of a particular method in C#. Ideally, I'd like to automate this so we can set a begin point, and end point, and a API to dump the number (and size) of the instructions used to a file.Is there an assembly instruction or operation on Intel Core i7 chipset to do this? Ideally, it would be a begin log instruction retired, end log instruction retired, and dump total instructions retired #.Thanks in advance.

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

This can be done by using the processor monitoring units in counting mode instead of sampling mode. However, programming the counters requires a little more than just one instruction. We are preparing an article that provides sample code. which should be posted soon.

The article about the Intel Performance counter Monitor is available now. You will find an archive attached to the article that contains sample routines for accessing the performance monitoring units (PMU).

Hi fredwang00,

The sample routinesin the Intel Performance Counter Monitorare written in C++, but as far as I know there are ways to call C++ code from C# (I am not an expert on this topic).


Leave a Comment

Please sign in to add a comment. Not a member? Join today