powerpc, perf/powerpc/hv-24x7: Use PMU_TXN_READ interface
authorSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Fri, 4 Sep 2015 03:07:52 +0000 (20:07 -0700)
committerIngo Molnar <mingo@kernel.org>
Sun, 13 Sep 2015 09:27:29 +0000 (11:27 +0200)
commit88a486132dffeb010d659e00361c4d114de09972
treed44dc591016ad6c80ce3ffb0dda0d486cde10919
parent4a00c16e552ea5e71756cd29cd2df7557ec9cac4
powerpc, perf/powerpc/hv-24x7: Use PMU_TXN_READ interface

The 24x7 counters in Powerpc allow monitoring a large number of counters
simultaneously. They also allow reading several counters in a single
HCALL so we can get a more consistent snapshot of the system.

Use the PMU's transaction interface to monitor and read several event
counters at once. The idea is that users can group several 24x7 events
into a single group of events. We use the following logic to submit
the group of events to the PMU and read the values:

pmu->start_txn() // Initialize before first event

for each event in group
pmu->read(event); // Queue each event to be read

pmu->commit_txn() // Read/update all queuedcounters

The ->commit_txn() also updates the event counts in the respective
perf_event objects.  The perf subsystem can then directly get the
event counts from the perf_event and can avoid submitting a new
->read() request to the PMU.

Thanks to input from Peter Zijlstra.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Link: http://lkml.kernel.org/r/1441336073-22750-10-git-send-email-sukadev@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/powerpc/perf/hv-24x7.c