Re: [RFC][PATCH 2/9] perf: core, remove hw_perf_event_init

From: Peter Zijlstra
Date: Mon May 10 2010 - 05:41:16 EST


On Mon, 2010-05-10 at 17:26 +0800, Lin Ming wrote:
> +static struct pmu *perf_event_lookup_pmu(struct perf_event *event)
> +{
> + struct pmu *pmu;
> + int pmu_id = event->attr.pmu_id;
> +
> + list_for_each_entry(pmu, &pmus, entry) {
> + if (pmu->id == pmu_id)
> + return pmu;
> + }
> +
> + return NULL;
> +}

> +void perf_event_register_pmu(struct pmu *pmu)
> +{
> + pmu->id = pmu_id_curr++;
> + list_add_tail(&pmu->entry, &pmus);
> +}

That will be wanting some sort of synchronization
--
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/