Messages in this thread |  | | | Date | Sat, 10 Jul 2010 15:36:52 +0200 | | From | Frederic Weisbecker <> | | Subject | Re: [RFC][PATCH 13/13] perf: Rework the PMU methods |
| |
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.
|  |