lkml.org 
[lkml]   [2011]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 09/12] perf_events: add hook to flush branch_stack on context switch (v2)
From
Date
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?




\
 
 \ /
  Last update: 2011-12-05 22:41    [W:0.728 / U:0.808 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site