I've been performing experiments with LBR (Last Branch Recording) tracing on a core i7 920, running Ubuntu 9.04. I am setting the LBR (0x1) bit in the IA32_DEBUGCTL register and LBR_SELECT is clear (0x0), so that all branches should be captured.
The problem is the following: based on the traces I see from reading the contents of MSR_LASTBRANCH_FROMX and MSR_LASTBRANCH_TOX registers, LBR is *NOT* logging near relative calls, near indirect calls and near returns. I cannot identify the cause.
By setting bits accordingly in LBR_SELECT I was able to verify that LBR is indeed tracing far jumps (LBR_SELECT=0xfc), near relative jumps (LBR_SELECT=0x17c), near indirect jumps (LBR_SELECT=0x1bc) and conditional branches (LBR_SELECT=0x1f8). However, when I set the register to 0x1dc (capture near returns), 0x1e6 (capture indirect calls) or 0x1f4 (capture relative calls), the trace is simply empty.
I was hoping that someone could give me a pointer as to why this is happening. Is it a known issue (cpu bug?) with the core i7 920? Or maybe some peculiarity of LBR/LBR_SELECT which was not described in the developer's manual?