]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - include/linux/perf_event.h
perf: Deconstify struct pmu
[mv-sheeva.git] / include / linux / perf_event.h
index 4db61dded388d3386bb3db1b439c2b1a3ea6638d..09d048b52115bc86cfcc2f520490d2fbcd6c7554 100644 (file)
@@ -578,19 +578,19 @@ struct pmu {
         * Start the transaction, after this ->enable() doesn't need
         * to do schedulability tests.
         */
-       void (*start_txn)       (const struct pmu *pmu);
+       void (*start_txn)       (struct pmu *pmu);
        /*
         * 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)      (const struct pmu *pmu);
+       int  (*commit_txn)      (struct pmu *pmu);
        /*
         * Will cancel the transaction, assumes ->disable() is called for
         * each successfull ->enable() during the transaction.
         */
-       void (*cancel_txn)      (const struct pmu *pmu);
+       void (*cancel_txn)      (struct pmu *pmu);
 };
 
 /**
@@ -669,7 +669,7 @@ struct perf_event {
        int                             nr_siblings;
        int                             group_flags;
        struct perf_event               *group_leader;
-       const struct pmu                *pmu;
+       struct pmu              *pmu;
 
        enum perf_event_active_state    state;
        unsigned int                    attach_state;
@@ -808,6 +808,12 @@ struct perf_event_context {
        struct rcu_head                 rcu_head;
 };
 
+/*
+ * Number of contexts where an event can trigger:
+ *     task, softirq, hardirq, nmi.
+ */
+#define PERF_NR_CONTEXTS       4
+
 /**
  * struct perf_event_cpu_context - per cpu event context structure
  */
@@ -821,12 +827,8 @@ struct perf_cpu_context {
        struct mutex                    hlist_mutex;
        int                             hlist_refcount;
 
-       /*
-        * Recursion avoidance:
-        *
-        * task, softirq, irq, nmi context
-        */
-       int                             recursion[4];
+       /* Recursion avoidance in each contexts */
+       int                             recursion[PERF_NR_CONTEXTS];
 };
 
 struct perf_output_handle {
@@ -847,7 +849,7 @@ struct perf_output_handle {
  */
 extern int perf_max_events;
 
-extern const struct pmu *hw_perf_event_init(struct perf_event *event);
+extern struct pmu *hw_perf_event_init(struct perf_event *event);
 
 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);
@@ -983,7 +985,6 @@ extern void perf_callchain_user(struct perf_callchain_entry *entry,
                                struct pt_regs *regs);
 extern void perf_callchain_kernel(struct perf_callchain_entry *entry,
                                  struct pt_regs *regs);
-extern struct perf_callchain_entry *perf_callchain_buffer(void);
 
 
 static inline void
@@ -1082,7 +1083,7 @@ static inline void perf_event_disable(struct perf_event *event)           { }
 #define perf_cpu_notifier(fn)                                  \
 do {                                                           \
        static struct notifier_block fn##_nb __cpuinitdata =    \
-               { .notifier_call = fn, .priority = 20 };        \
+               { .notifier_call = fn, .priority = CPU_PRI_PERF }; \
        fn(&fn##_nb, (unsigned long)CPU_UP_PREPARE,             \
                (void *)(unsigned long)smp_processor_id());     \
        fn(&fn##_nb, (unsigned long)CPU_STARTING,               \