perf: Simplify group_sched_in()
Collate the error paths. Code duplication only leads to divergence and extra bugs. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20201029162901.972161394@infradead.org
This commit is contained in:
parent
8c7855d829
commit
251ff2d493
@ -2580,11 +2580,8 @@ group_sched_in(struct perf_event *group_event,
|
|||||||
|
|
||||||
pmu->start_txn(pmu, PERF_PMU_TXN_ADD);
|
pmu->start_txn(pmu, PERF_PMU_TXN_ADD);
|
||||||
|
|
||||||
if (event_sched_in(group_event, cpuctx, ctx)) {
|
if (event_sched_in(group_event, cpuctx, ctx))
|
||||||
pmu->cancel_txn(pmu);
|
goto error;
|
||||||
perf_mux_hrtimer_restart(cpuctx);
|
|
||||||
return -EAGAIN;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Schedule in siblings as one group (if any):
|
* Schedule in siblings as one group (if any):
|
||||||
@ -2613,10 +2610,9 @@ group_error:
|
|||||||
}
|
}
|
||||||
event_sched_out(group_event, cpuctx, ctx);
|
event_sched_out(group_event, cpuctx, ctx);
|
||||||
|
|
||||||
|
error:
|
||||||
pmu->cancel_txn(pmu);
|
pmu->cancel_txn(pmu);
|
||||||
|
|
||||||
perf_mux_hrtimer_restart(cpuctx);
|
perf_mux_hrtimer_restart(cpuctx);
|
||||||
|
|
||||||
return -EAGAIN;
|
return -EAGAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user