perf: Optimize group_sched_in()
authorPeter Zijlstra <peterz@infradead.org>
Mon, 24 Feb 2014 11:43:31 +0000 (12:43 +0100)
committerIngo Molnar <mingo@kernel.org>
Thu, 27 Feb 2014 11:43:26 +0000 (12:43 +0100)
Use the ctx pmu instead of the event pmu.

When a group leader is a software event but the group contains
hardware events, the entire group is on the hardware PMU.

Using the hardware PMU for the transaction makes most sense since
that's the most expensive one to programm (and software PMUs generally
don't have TXN support anyway).

Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-sctoo9t2f3nn2c9g568928q3@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/events/core.c

index 823a53d72d6a2677528951c7a43e19eea5d7ea25..661951ab8ae731a5094e1a29101bb7e0797794ed 100644 (file)
@@ -1733,7 +1733,7 @@ group_sched_in(struct perf_event *group_event,
               struct perf_event_context *ctx)
 {
        struct perf_event *event, *partial_group = NULL;
-       struct pmu *pmu = group_event->pmu;
+       struct pmu *pmu = ctx->pmu;
        u64 now = ctx->time;
        bool simulate = false;