[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1323121074.32012.40.camel@twins>
Date: Mon, 05 Dec 2011 22:37:54 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Stephane Eranian <eranian@...gle.com>
Cc: linux-kernel@...r.kernel.org, mingo@...e.hu, acme@...hat.com,
ming.m.lin@...el.com, andi@...stfloor.org, robert.richter@....com,
ravitillo@....gov, will.deacon@....com, paulus@...ba.org,
benh@...nel.crashing.org, rth@...ddle.net, ralf@...ux-mips.org,
davem@...emloft.net, lethal@...ux-sh.org
Subject: Re: [PATCH 09/12] perf_events: add hook to flush branch_stack on
context switch (v2)
On Fri, 2011-10-14 at 14:37 +0200, Stephane Eranian wrote:
> + /*
> + * check if the context has at least one
> + * event using PERF_SAMPLE_BRANCH_STACK
> + */
> + if (cpuctx->ctx.nr_branch_stack > 0
> + && pmu->flush_branch_stack) {
> +
> + pmu = cpuctx->ctx.pmu;
> +
> + perf_ctx_lock(cpuctx, cpuctx->task_ctx);
> +
> + perf_pmu_disable(pmu);
> +
> + pmu->flush_branch_stack();
> +
> + perf_pmu_enable(pmu);
> +
> + perf_ctx_unlock(cpuctx, cpuctx->task_ctx);
> + }
> + }
(what whitespace looks funny)
So all PMUs not supporting this branch stuff will fail to create a
has_branch_stack() event, right? Thus all ctx with !0 nr_branch_stack
support it. Doesn't this make the test for pmu->flush_branch_stack
redundant?
--
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