Skip to content

Commit

Permalink
perf_event: Make software events work again
Browse files Browse the repository at this point in the history
Commit 6bde9b6 ("perf: Add
group scheduling transactional APIs") added code to allow a
group to be scheduled in a single transaction.  However, it
introduced a bug in handling events whose pmu does not implement
transactions -- at the end of scheduling in the events in the
group, in the non-transactional case the code now falls through
to the group_error label, and proceeds to unschedule all the
events in the group and return failure.

This fixes it by returning 0 (success) in the non-transactional
case.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Lin Ming <ming.m.lin@intel.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: eranian@gmail.com
LKML-Reference: <20100508105800.GB10650@brick.ozlabs.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
paulusmack authored and Ingo Molnar committed May 8, 2010
1 parent ed82702 commit 6e85158
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,13 +664,13 @@ group_sched_in(struct perf_event *group_event,
}
}

if (txn) {
ret = pmu->commit_txn(pmu);
if (!ret) {
pmu->cancel_txn(pmu);
if (!txn)
return 0;

return 0;
}
ret = pmu->commit_txn(pmu);
if (!ret) {
pmu->cancel_txn(pmu);
return 0;
}

group_error:
Expand Down

0 comments on commit 6e85158

Please sign in to comment.