aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/perf_event.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2010-05-08 06:58:00 -0400
committerIngo Molnar <mingo@elte.hu>2010-05-08 07:16:55 -0400
commit6e85158cf5a2385264316870256fb6ad681156a0 (patch)
tree39d5a0c81c4cc54c8051a9f62b587f17b0a2077a /kernel/perf_event.c
parented82702155b6343727ee732f7eae6d72e8b453fe (diff)
perf_event: Make software events work again
Commit 6bde9b6ce0127e2a56228a2071536d422be31336 ("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>
Diffstat (limited to 'kernel/perf_event.c')
-rw-r--r--kernel/perf_event.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index bb06382f98e7..180151ff8376 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -664,13 +664,13 @@ group_sched_in(struct perf_event *group_event,
664 } 664 }
665 } 665 }
666 666
667 if (txn) { 667 if (!txn)
668 ret = pmu->commit_txn(pmu); 668 return 0;
669 if (!ret) {
670 pmu->cancel_txn(pmu);
671 669
672 return 0; 670 ret = pmu->commit_txn(pmu);
673 } 671 if (!ret) {
672 pmu->cancel_txn(pmu);
673 return 0;
674 } 674 }
675 675
676group_error: 676group_error: