Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1218803

Re: [[PATCH v6 02/10] perf: Add a flags parameter to pmu txn interfaces

From Michael Ellerman <mpe@ellerman.id.au>
Newsgroups linux.kernel
Subject Re: [[PATCH v6 02/10] perf: Add a flags parameter to pmu txn interfaces
Date 2015-09-04 12:10 +0200
Message-ID <q4W6u-7nE-13@gated-at.bofh.it> (permalink)
References <q4Py2-6nf-9@gated-at.bofh.it> <q4PHI-6yv-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, 2015-09-03 at 20:07 -0700, Sukadev Bhattiprolu wrote:
> 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 to the existing transactions,
> i.e. used to _schedule_ all the events on the PMU as a group. A second
> transaction type, PERF_PMU_TXN_READ, will be used in a follow-on patch,
> by the 24x7 counters to read several counters at once.
> 
> Extend the transaction interfaces to the PMU to accept a 'txn_flags'
> parameter and use this parameter to ignore any transactions that are
> not of type PERF_PMU_TXN_ADD.
> 
> Thanks to Peter Zijlstra for his input.
> 
> Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
> 
> ---
>  arch/powerpc/perf/core-book3s.c  |   30 +++++++++++++++++++++++++++++-

These powerpc changes look OK to me.

So for those you can have an:

Acked-by: Michael Ellerman <mpe@ellerman.id.au>


Having said that, we do end up repeating a lot of boiler plate for each arch,
which is a pity. eg:

> +static void power_pmu_start_txn(struct pmu *pmu, unsigned int txn_flags)
>  {
>  	struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events);
>
> +	WARN_ON_ONCE(cpuhw->txn_flags);		/* txn already in flight */
> +
> +	cpuhw->txn_flags = txn_flags;
> +	if (txn_flags & ~PERF_PMU_TXN_ADD)
> +		return;
> +

And so on.

But I can't think of an easy way to avoid that, so it's not a blocker, but
maybe someone can think of a nice solution to avoid it?

cheers



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH v6 0/10] perf: Implement group-read of events using txn interface Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> - 2015-09-04 05:20 +0200
  [[PATCH v6 06/10] perf: Invert perf_read_group() loops Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> - 2015-09-04 05:20 +0200
  [[PATCH v6 10/10] perf: Drop PERF_EVENT_TXN Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> - 2015-09-04 05:20 +0200
  [[PATCH v6 07/10] perf: Add return value for perf_event_read(). Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> - 2015-09-04 05:20 +0200
  [[PATCH v6 09/10] powerpc/perf/hv-24x7: Use PMU_TXN_READ interface Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> - 2015-09-04 05:20 +0200
  [[PATCH v6 03/10] perf: Split perf_event_read() and perf_event_count() Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> - 2015-09-04 05:20 +0200
  [[PATCH v6 01/10] sparc/perf: Remove unnecessary assignment Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> - 2015-09-04 05:20 +0200
  [[PATCH v6 08/10] Define PERF_PMU_TXN_READ interface Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> - 2015-09-04 05:20 +0200
  [[PATCH v6 02/10] perf: Add a flags parameter to pmu txn interfaces Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> - 2015-09-04 05:20 +0200
    Re: [[PATCH v6 02/10] perf: Add a flags parameter to pmu txn  interfaces Michael Ellerman <mpe@ellerman.id.au> - 2015-09-04 12:10 +0200

csiph-web