Messages in this thread | | | Date | Tue, 29 Jan 2013 02:00:29 +0100 | From | Andi Kleen <> | Subject | Re: [PATCH 07/12] perf, x86: Avoid checkpointed counters causing excessive TSX aborts v3 |
| |
On Tue, Jan 29, 2013 at 01:30:19AM +0100, Stephane Eranian wrote: > >> The counter is reinstated to its state before the critical section but > >> the PMI cannot be > >> cancelled and there is no state left behind to tell what to do with it. > > > > The PMI is effectively spurious, but we use it to set back. Don't know > > what you mean with "cancel". It already happened of course. > > > But when you do this, it seems you making INT_CP events unusable > for sampling, because you're resetting their value under the cover. > So what happens when you sample, especially with a fixed period?
Sampling is forbidden for checkpointed events, the setup code enforces that. It's unlikely to be useful anyways.
The main use case for checkpointing is perf stat -T and related counting usages.
> >> > >> > + if (event->attr.sample_period > 0 && > >> > + event->attr.sample_period < 0x7fffffff) > >> > + return -EIO; > >> > + } > Explain the 0x7fffffff to me? Is that the max period set by default when you > just count?
Originally I had just > 0, but then I found that perf stat from the guest doesn't work anymore because it sets an very high overflow to accumulate counters.
The 0x7fffffff is a somewhat arbitary threshold to detect this case.
-Andi -- ak@linux.intel.com -- Speaking for myself only.
| |