Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)
4994 Discussions

read performance counter values periodically

edisonying1984
Beginner
398 Views
Hi all,
I am a newbie to Intel forum. I'm not sure if this is the correct subforum to post this thread; if not, please forward it to the correct place.
I am working on a project using hardware performance monitoring counters. In my current implementation, the counter values are read through a file under /proc (thus I need to create a proc_entry before the sampling and read the values to this file during execution), and the samplings are implemented by inserting a task into the delayed work queue. By doing this, I am able to read the performance counter values at fixed time intervals, say, once a second.
However, I want to read the counters in another way. Namely, rather than collect those counters every second, I would like to read them after one million instructions are executed. That is, read the counter values when 1M, 2M, 3M....instructions are executed. I have no clue on this change.
Can anyone give me a hint on this? Any suggestions will be appreciated.
By the way, I am using Fedora 13 with kernel 2.6.33.
Thanks
0 Kudos
5 Replies
Peter_W_Intel
Employee
398 Views
It seems that you captures samples by using your implementation, not use VTune Amplifier XE. VTune captures samples when event counter registers underflow (set event number first, then decrease when event occurred).

Inyour project, youmay do same wayof VTune Amplifier XE - set event counter number (1M?) for Instruction Retired event (other event counter registers will be cleaned as zero), then your application will run - if1M instruction will be executed, underflow will happen, then read preferred performance counter values.

Regards, Peter
P.S> This forum isfor talking about usingVTune product, problem, solution, etc.
0 Kudos
edisonying1984
Beginner
398 Views
Hi Peter,
Thanks for quick response. Yes, I am using my own implementation rather than Vtune to measure the performance events. I know my problem could be solved by setting the corresponding conditions in Vtune; however, it is more difficult to do this with my own implementation. Probably I'll forward it to another subforum.
I appreciate you very much anaway.
0 Kudos
edisonying1984
Beginner
398 Views
Hi,
I am now using Vtune amplifier 2011 to analyze my applications. Since I aim at collecting counter values after every million instructions are executed, I defined my own "hardware event-based sampling" profile and set the "sample after" value of "inst_retired.any" to be 1000000, while the "sample after" values for other metrics are kept default. Here I have two questions:
1. Vtune will only report the final accumulated result for each counter when the program finishes running. Is there an approach that I can read the raw sampling statistics for each interval? In specific, when the fist 1M instructions finished execution, I'd like to know info like cache misses in this interval, and so on for the later intervals.
2. I want to read all preferred counter values when every 1M instructions are retired; however, by using the approach mentioned above, it seems each counter has different sampling frequency, or period. This is not what I want. I tried to change the sample after values for other metrics to zero, but this doesn't work. Can anyone tell me how to read all selected counters at each interval transition? (when 1M, 2M, 3M... instructions are retired)
I don't have too much experience in using vtune, please help...
Thanks,
Ying
0 Kudos
Peter_W_Intel
Employee
398 Views

Hi Ying,

Samples of all events (analysis type youchoose) will be collected respectively for their different intervals.
1. There is no mechanism to know other events after 1M instructions executed, because all events (including instructions retired) work independently.
2. The tool has timeline report at bottom of bottom-report, youmight select time range to zoom-in/filter results, you can verify if "instructions retired" is 1M, then observe other events data. Also you may redo or seek next 1M to 2M.
3. You meant that you can't changeSAV for some events. That is right! All SAVsin pre-definedanalysis typecan't be modified. Youmight create yourhardware event-based analysis to change SAVs, if like.

Regards, Peter
P.S>I assume that you are using VTune Amplifier XE 2011

0 Kudos
Thomas_W_Intel
Employee
398 Views
Ying,

The performance monitoring units (PMU) can also beused in a way that you only count the events that occur. This is however very different from the sampling that VTune is doing. In particular, you cannot tie back the information to the code section where the events were happening. How you can use the hardware counters in this way is described in this ISN article. However, the routines do not provide the capability to use the PMU to trigger interrupts.

Kind regards
Thomas
0 Kudos
Reply