Re: [PATCH] perf_events: improve x86 event scheduling

From: Frederic Weisbecker
Date: Sun Jan 17 2010 - 09:12:46 EST


On Wed, Jan 13, 2010 at 06:22:54PM +0100, Stephane Eranian wrote:
> Ok,
>
> Something like that should problably do it:
>
> static void event_sched_out(struct perf_event *event, int cpu)
> {
> event->state = PERF_EVENT_STATE_INACTIVE;
> event->oncpu = -1;
> }



You need to also call pmu->disable() if it is a software event,
because a breakpoint needs to be unregistered in hardware level
too.

And disable it in x86 level if it is an x86 event?



> hw_perf_group_sched_in()
> {
> ....
> n = 1;
> list_for_each_entry(sub, &leader->sibling_list, group_entry) {
> if (sub->state > PERF_EVENT_STATE_OFF) {
> ret = event_sched_in(sub, cpu);
> if (ret)
> goto undo;



Yeah we indeed really need to check that.

Thanks.

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