Re: [PATCH v3 3/8] perf: Add a flags parameter to pmu txn interfaces

2015-07-16 Thread Sukadev Bhattiprolu
Peter Zijlstra [pet...@infradead.org] wrote: | On Tue, Jul 14, 2015 at 08:01:50PM -0700, Sukadev Bhattiprolu wrote: | > @@ -1604,6 +1613,12 @@ static void power_pmu_start_txn(struct pmu *pmu) | > static void power_pmu_cancel_txn(struct pmu *pmu) | > { | > struct cpu_hw_events *cpuhw = this_cp

Re: [PATCH v3 3/8] perf: Add a flags parameter to pmu txn interfaces

2015-07-16 Thread Peter Zijlstra
On Tue, Jul 14, 2015 at 08:01:50PM -0700, Sukadev Bhattiprolu wrote: > +DEFINE_PER_CPU(int, nop_txn_flags); > + > +static int nop_txn_flags_get_and_clear(void) > +{ > + int *flagsp; > + int flags; > + > + flagsp = &get_cpu_var(nop_txn_flags); > + > + flags = *flagsp; > + *f

Re: [PATCH v3 3/8] perf: Add a flags parameter to pmu txn interfaces

2015-07-16 Thread Peter Zijlstra
On Tue, Jul 14, 2015 at 08:01:50PM -0700, Sukadev Bhattiprolu wrote: > @@ -1604,6 +1613,12 @@ static void power_pmu_start_txn(struct pmu *pmu) > static void power_pmu_cancel_txn(struct pmu *pmu) > { > struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events); > + int txn_flags; > + > +

[PATCH v3 3/8] perf: Add a flags parameter to pmu txn interfaces

2015-07-14 Thread Sukadev Bhattiprolu
Currently, the PMU interface allows reading only one counter at a time. But some PMUs like the 24x7 counters in Power, support reading several counters at once. To leveage this functionality, extend the transaction interface to support a "transaction type". The first type, PERF_PMU_TXN_ADD, refers