[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150716222015.GO3644@twins.programming.kicks-ass.net>
Date: Fri, 17 Jul 2015 00:20:15 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Michael Ellerman <mpe@...erman.id.au>,
linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
linux-s390@...r.kernel.org, sparclinux@...r.kernel.org
Subject: Re: [PATCH v3 7/8] perf: Define PMU_TXN_READ interface
On Tue, Jul 14, 2015 at 08:01:54PM -0700, Sukadev Bhattiprolu wrote:
> +/*
> + * Use the transaction interface to read the group of events in @leader.
> + * PMUs like the 24x7 counters in Power, can use this to queue the events
> + * in the ->read() operation and perform the actual read in ->commit_txn.
> + *
> + * Other PMUs can ignore the ->start_txn and ->commit_txn and read each
> + * PMU directly in the ->read() operation.
> + */
> +static int perf_event_read_group(struct perf_event *leader)
> +{
> + int ret;
> + struct perf_event *sub;
> + struct pmu *pmu;
> +
> + pmu = leader->pmu;
> +
> + pmu->start_txn(pmu, PERF_PMU_TXN_READ);
> +
> + perf_event_read(leader);
There should be a lockdep assert with that list iteration.
> + list_for_each_entry(sub, &leader->sibling_list, group_entry)
> + perf_event_read(sub);
> +
> + ret = pmu->commit_txn(pmu);
> +
> + return ret;
> +}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists