Re: [RFC][PATCH 13/13] perf: Rework the PMU methods

From: Frederic Weisbecker
Date: Sat Jul 10 2010 - 09:37:31 EST


On Fri, Jul 09, 2010 at 10:21:30AM +0200, Peter Zijlstra wrote:
> -static void x86_pmu_pmu_enable(struct pmu *pmu)
> +static void x86_pmu_enable(struct pmu *pmu)
> {
> struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
> struct perf_event *event;
> @@ -839,7 +839,14 @@ static void x86_pmu_pmu_enable(struct pm
> match_prev_assignment(hwc, cpuc, i))
> continue;
>
> - x86_pmu_stop(event);
> + /*
> + * Ensure we don't accidentally enable a stopped
> + * counter simply because we rescheduled.
> + */
> + if (hwc->state & PERF_HES_STOPPED)
> + hwc->state |= PERF_HES_ARCH;



So, if I understood well, this is to avoid enabling an event from perf_pmu_enable()
while the event was already stopped.

Looks good but why this ARCH name then? This should be a kind of PERF_HES_ONCPU
or so.

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