Community
cancel
Showing results for 
Search instead for 
Did you mean: 
fredwang00
Beginner
74 Views

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.
0 Kudos
3 Replies
Thomas_W_Intel
Employee
74 Views

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.

Thomas_W_Intel
Employee
74 Views

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).

Roman_D_Intel
Employee
74 Views

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).

Roman
Reply