Re: [RFC PATCH] perf_core: provide a kernel-internal interface toget to performance counters

From: Ingo Molnar
Date: Mon Oct 05 2009 - 05:57:37 EST



* Frederic Weisbecker <fweisbec@xxxxxxxxx> wrote:

> Can't we instead modify the perf events to be able to run on multiple
> contexts?
>
> We could change struct perf_event::ctx into a list of context and then
> attach it to several cpu contexts.
>
> The perf event struct have been designed to run on only one context so
> its structure and handling does not deal with races due to concurrent
> uses I guess. But at a first glance, few things would need to be
> modified to handle that, and at a low cost.
>
> There might be bad corner cases I forget though...

Dunno, i assumed it wouldnt be possible sanely. If you tried a patch we
could argue about the particulars ...

This would in essence create a new event type: system-wide. It doesnt
scale in its naive implementation - which would be fine for low freq
events.

We could encode it via sys_perf_event_open(pid:-1, cpu:-1).

Ingo
--
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/