Hi, PEBS guarantees that you will get the IP of an instruction that follows one that caused the event. The reason you get the next instruction is because the machine state is recorded at retirement of the instruction, thus IP already points to the next instr.
Also note that the "sampled instruction" is not related to your sampling period either. There is some shadowing effects as well which may cause bias in your samples. In perf_events, the kernel can correct for the IP+1 skid. You need to use precise sampling with a value of 2. With a value of one you get IP+1. perf stat -e branch_instruction_retired:pp .... pp sets precise=2 p sets precise=1 Note that not all events support PEBS. This is PMU specific. The kernel rejects any attempts to use PEBS on events which do not support it. On Fri, Mar 18, 2011 at 2:40 AM, Arun Sharma <a...@sharma-home.net> wrote: > 2011/3/17 陳韋任 <che...@iis.sinica.edu.tw>: > >> The "better match" just means better than usual sampling mechanisms, >> right? Arun mentioned that "PEBS is known to be precise, but not >> accurate". So we still cannot get the exact IP which causes the event. >> Am I right? > > Appendix B.2.3.3 Precise Execution Events in this doc: > > http://www.intel.com/Assets/PDF/manual/248966.pdf > > explains what Intel calls the "Shadowing effect" in some detail. > > So yes, hardware can see the precise IP, but it doesn't let software > record it :( > > -Arun > ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ perfmon2-devel mailing list perfmon2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/perfmon2-devel