perf: Cleanup {start,commit,cancel}_txn details
Clarify some of the transactional group scheduling API details and change it so that a successfull ->commit_txn also closes the transaction. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Steven Rostedt <rostedt@goodmis.org> LKML-Reference: <1274803086.5882.1752.camel@twins> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:

committed by
Ingo Molnar

parent
3af9e85928
commit
8d2cacbbb8
@@ -675,7 +675,6 @@ group_sched_in(struct perf_event *group_event,
|
||||
struct perf_event *event, *partial_group = NULL;
|
||||
const struct pmu *pmu = group_event->pmu;
|
||||
bool txn = false;
|
||||
int ret;
|
||||
|
||||
if (group_event->state == PERF_EVENT_STATE_OFF)
|
||||
return 0;
|
||||
@@ -703,15 +702,9 @@ group_sched_in(struct perf_event *group_event,
|
||||
}
|
||||
}
|
||||
|
||||
if (!txn)
|
||||
if (!txn || !pmu->commit_txn(pmu))
|
||||
return 0;
|
||||
|
||||
ret = pmu->commit_txn(pmu);
|
||||
if (!ret) {
|
||||
pmu->cancel_txn(pmu);
|
||||
return 0;
|
||||
}
|
||||
|
||||
group_error:
|
||||
/*
|
||||
* Groups can be scheduled in as one unit only, so undo any
|
||||
|
Reference in New Issue
Block a user