]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - include/linux/perf_event.h
perf: Reduce perf_disable() usage
[mv-sheeva.git] / include / linux / perf_event.h
index 09d048b52115bc86cfcc2f520490d2fbcd6c7554..243286a8ded76c54ff3bbf3bf854b57e0d70937d 100644 (file)
@@ -561,22 +561,29 @@ struct perf_event;
  * struct pmu - generic performance monitoring unit
  */
 struct pmu {
-       int (*enable)                   (struct perf_event *event);
+       struct list_head                entry;
+
+       /*
+        * Should return -ENOENT when the @event doesn't match this PMU.
+        */
+       int (*event_init)               (struct perf_event *event);
+
+       int  (*enable)                  (struct perf_event *event);
        void (*disable)                 (struct perf_event *event);
-       int (*start)                    (struct perf_event *event);
+       int  (*start)                   (struct perf_event *event);
        void (*stop)                    (struct perf_event *event);
        void (*read)                    (struct perf_event *event);
        void (*unthrottle)              (struct perf_event *event);
 
        /*
-        * Group events scheduling is treated as a transaction, add group
-        * events as a whole and perform one schedulability test. If the test
-        * fails, roll back the whole group
+        * Group events scheduling is treated as a transaction, add
+        * group events as a whole and perform one schedulability test.
+        * If the test fails, roll back the whole group
         */
 
        /*
-        * Start the transaction, after this ->enable() doesn't need
-        * to do schedulability tests.
+        * Start the transaction, after this ->enable() doesn't need to
+        * do schedulability tests.
         */
        void (*start_txn)       (struct pmu *pmu);
        /*
@@ -587,8 +594,8 @@ struct pmu {
         */
        int  (*commit_txn)      (struct pmu *pmu);
        /*
-        * Will cancel the transaction, assumes ->disable() is called for
-        * each successfull ->enable() during the transaction.
+        * Will cancel the transaction, assumes ->disable() is called
+        * for each successfull ->enable() during the transaction.
         */
        void (*cancel_txn)      (struct pmu *pmu);
 };
@@ -849,7 +856,8 @@ struct perf_output_handle {
  */
 extern int perf_max_events;
 
-extern struct pmu *hw_perf_event_init(struct perf_event *event);
+extern int perf_pmu_register(struct pmu *pmu);
+extern void perf_pmu_unregister(struct pmu *pmu);
 
 extern void perf_event_task_sched_in(struct task_struct *task);
 extern void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next);