- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page