perf/x86/intel: Add Haswell TSX event aliases
authorAndi Kleen <ak@linux.intel.com>
Fri, 6 Sep 2013 03:37:40 +0000 (20:37 -0700)
committerIngo Molnar <mingo@kernel.org>
Thu, 12 Sep 2013 17:13:36 +0000 (19:13 +0200)
commit4b2c4f1f1b71fe18381f089c501ac21cd2167dfa
treef941de2124c524a8c5bb6bf675984d530fc5b77d
parent748e86aa90edfddfa6016f1cf383ff5bc6aada91
perf/x86/intel: Add Haswell TSX event aliases

Add TSX event aliases, and export them from the kernel to perf.

These are used by perf stat -T and to allow
more user friendly access to events. The events are designed to
be fairly generic and may also apply to other architectures
implementing HTM.  They all cover common situations that
happens during tuning of transactional code.

For Haswell we have to separate the HLE and RTM events,
as they are separate in the PMU.

This adds the following events:

 tx-start Count start transaction (used by perf stat -T)
 tx-commit Count commit of transaction
 tx-abort Count all aborts
 tx-conflict Count aborts due to conflict with another CPU.
 tx-capacity Count capacity aborts (transaction too large)

Then matching el-* events for HLE

 cycles-t Transactional cycles (used by perf stat -T)
  * also exists on POWER8

 cycles-ct Transactional cycles commited (used by perf stat -T)
  * according to Michael Ellerman POWER8 has a cycles-transactional-committed,
  * perf stat -T handles both cases

Note for useful abort profiling often precise has to be set,
as Haswell can only report the point inside the transaction
with precise=2.

For some classes of aborts, like conflicts, this is not needed,
as it makes more sense to look at the complete critical section.

This gives a clean set of generalized events to examine transaction
success and aborts. Haswell has additional events for TSX, but those
are more specialized for very specific situations.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1378438661-24765-4-git-send-email-andi@firstfloor.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/cpu/perf_event_intel.c