Skip to contentSkip to conversation

perf: Default PMU ops

tip:perf/core tip-bot for Peter Zijlstra 1 participant 1 message Sep 9, 2010 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  ad5133b7030d04ce7701aa7cbe98f561347c79c2
Gitweb:     http://git.kernel.org/tip/ad5133b7030d04ce7701aa7cbe98f561347c79c2
Author:     Peter Zijlstra <[email protected]>
AuthorDate: Tue, 15 Jun 2010 12:22:39 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 9 Sep 2010 20:46:30 +0200

perf: Default PMU ops

Provide default implementations for the pmu txn methods, this allows us to remove some conditional code.

Cc paulus <[email protected]>
Cc stephane eranian <[email protected]>
Cc Robert Richter <[email protected]>
Cc Will Deacon <[email protected]>
Cc Paul Mundt <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Cyrill Gorcunov <[email protected]>
Cc Lin Ming <[email protected]>
Cc Yanmin <[email protected]>
Cc Deng-Cheng Zhu <[email protected]>
Cc David Miller <[email protected]>
Cc Michael Cree <[email protected]>

LKML-Reference: <new-submission>

---
 include/linux/perf_event.h |   10 +++---
 kernel/perf_event.c        |   64 +++++++++++++++++++++++++++++++++++--------
 2 files changed, 57 insertions(+), 17 deletions(-)
include/linux/perf_event.h +5 -5
index 6abf103..bf85733 100644
@@ -565,8 +565,8 @@ struct pmu {
 
 	int				*pmu_disable_count;
 
-	void (*pmu_enable)		(struct pmu *pmu);
-	void (*pmu_disable)		(struct pmu *pmu);
+	void (*pmu_enable)		(struct pmu *pmu); /* optional */
+	void (*pmu_disable)		(struct pmu *pmu); /* optional */
 
 	/*
 	 * Should return -ENOENT when the @event doesn't match this PMU.
@@ -590,19 +590,19 @@ struct pmu {
 	 * Start the transaction, after this ->enable() doesn't need to
 	 * do schedulability tests.
 	 */
-	void (*start_txn)	(struct pmu *pmu);
+	void (*start_txn)	(struct pmu *pmu); /* optional */
 	/*
 	 * If ->start_txn() disabled the ->enable() schedulability test
 	 * then ->commit_txn() is required to perform one. On success
 	 * the transaction is closed. On error the transaction is kept
 	 * open until ->cancel_txn() is called.
 	 */
-	int  (*commit_txn)	(struct pmu *pmu);
+	int  (*commit_txn)	(struct pmu *pmu); /* optional */
 	/*
 	 * Will cancel the transaction, assumes ->disable() is called
 	 * for each successfull ->enable() during the transaction.
 	 */
-	void (*cancel_txn)	(struct pmu *pmu);
+	void (*cancel_txn)	(struct pmu *pmu); /* optional */
 };
 
 /**
kernel/perf_event.c +52 -12

100 lines not on this page · raw message