03-23-2010 01:05 PM
I am profiling a linux kernel module with vtune for RESOURCE_STALLS.STORE events on a 8-core Core i7 machine. Vtl shows a hot address on the following instruction:
> vtl view -ar a3::r1 -ha -mp /lib/modules/2.6.18-128.el5/extra -mn xyz | head
Address Module CPU_CLK_UNHALTED.THREAD samples RESOURCE_STALLS.STORE samples Symbols Available Resolved Module Path
0x291 xyz 116 866 NO ndm
0x6d04 xyz 32 116 NO ndm
I disassembled the module with objdump. The disassembled instruction at location 0x291 is:
291: 48 8b 07 mov (%rdi),%rax
There are a couple of things which are not clear to me:
1. the instruction is a load, not store
2. nothing in the immediate vicinity of the instruction should cause a high rate of store instruction
My question is this: does vtune accurately relate RESOURCE_STALLS.STORE events to instruction addresses? If not, how can I determine the actual location of those stalls?
03-23-2010 02:42 PM
Unless this is a precise event, "event skid" can occur. Basically, by the time the processor can interrupt the instruction flow, the EIP is pointing to an instruction following the one that generated the event. You need to examine the instructions in the loop. Most likely, there is a store instruction preceding the one with the samples attributed to it.