Re: [RFC PATCH] perf_core: provide a kernel-internal interface to get to performance counters
From: Frédéric Weisbecker
Date: Mon Oct 05 2009 - 06:14:30 EST
2009/10/5 Ingo Molnar <mingo@xxxxxxx>:
>
> * 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
>
We could combine the above (single-channel/per-cpu page granularity) and the
abstract of wide perf events. That will avoid creating a new type that
wrap a set of
multiple events, which would be another kind of type to handle,
breaking the genericity
and add a lot of code.
--
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/