Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.

instruction retired sample begin/end

fredwang00
Beginner
714 Views
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
714 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.

0 Kudos
Thomas_W_Intel
Employee
714 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).

0 Kudos
Roman_D_Intel
Employee
714 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
0 Kudos
Reply