diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2010-05-25 11:49:05 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-06-09 05:12:34 -0400 |
commit | 8d2cacbbb8deadfae78aa16e4e1ee619bdd7019e (patch) | |
tree | 79fcb319d1c99e348b0a04056e016c85c3666b35 /include/linux/perf_event.h | |
parent | 3af9e859281bda7eb7c20b51879cf43aa788ac2e (diff) |
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>
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r-- | include/linux/perf_event.h | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 36efad90cd43..f1b6ba0770e0 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -549,7 +549,10 @@ struct hw_perf_event { | |||
549 | 549 | ||
550 | struct perf_event; | 550 | struct perf_event; |
551 | 551 | ||
552 | #define PERF_EVENT_TXN_STARTED 1 | 552 | /* |
553 | * Common implementation detail of pmu::{start,commit,cancel}_txn | ||
554 | */ | ||
555 | #define PERF_EVENT_TXN 0x1 | ||
553 | 556 | ||
554 | /** | 557 | /** |
555 | * struct pmu - generic performance monitoring unit | 558 | * struct pmu - generic performance monitoring unit |
@@ -563,14 +566,28 @@ struct pmu { | |||
563 | void (*unthrottle) (struct perf_event *event); | 566 | void (*unthrottle) (struct perf_event *event); |
564 | 567 | ||
565 | /* | 568 | /* |
566 | * group events scheduling is treated as a transaction, | 569 | * Group events scheduling is treated as a transaction, add group |
567 | * add group events as a whole and perform one schedulability test. | 570 | * events as a whole and perform one schedulability test. If the test |
568 | * If test fails, roll back the whole group | 571 | * fails, roll back the whole group |
569 | */ | 572 | */ |
570 | 573 | ||
574 | /* | ||
575 | * Start the transaction, after this ->enable() doesn't need | ||
576 | * to do schedulability tests. | ||
577 | */ | ||
571 | void (*start_txn) (const struct pmu *pmu); | 578 | void (*start_txn) (const struct pmu *pmu); |
572 | void (*cancel_txn) (const struct pmu *pmu); | 579 | /* |
580 | * If ->start_txn() disabled the ->enable() schedulability test | ||
581 | * then ->commit_txn() is required to perform one. On success | ||
582 | * the transaction is closed. On error the transaction is kept | ||
583 | * open until ->cancel_txn() is called. | ||
584 | */ | ||
573 | int (*commit_txn) (const struct pmu *pmu); | 585 | int (*commit_txn) (const struct pmu *pmu); |
586 | /* | ||
587 | * Will cancel the transaction, assumes ->disable() is called for | ||
588 | * each successfull ->enable() during the transaction. | ||
589 | */ | ||
590 | void (*cancel_txn) (const struct pmu *pmu); | ||
574 | }; | 591 | }; |
575 | 592 | ||
576 | /** | 593 | /** |