]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - include/linux/perf_counter.h
perf_counter: Generic per counter interrupt throttle
[mv-sheeva.git] / include / linux / perf_counter.h
index 4cae01a50450808e500716725e60ca51c723cfda..e3a7585d3e43b67dbfbb6da4db92d38a7426e5db 100644 (file)
@@ -154,11 +154,11 @@ struct perf_counter_hw_event {
 
                                __reserved_1   : 51;
 
-       __u32                   extra_config_len;
        __u32                   wakeup_events;  /* wakeup every n events */
+       __u32                   __reserved_2;
 
-       __u64                   __reserved_2;
        __u64                   __reserved_3;
+       __u64                   __reserved_4;
 };
 
 /*
@@ -260,11 +260,21 @@ enum perf_event_type {
        /*
         * struct {
         *      struct perf_event_header        header;
+        *      u64                             time;
         *      u64                             irq_period;
         * };
         */
        PERF_EVENT_PERIOD               = 4,
 
+       /*
+        * struct {
+        *      struct perf_event_header        header;
+        *      u64                             time;
+        * };
+        */
+       PERF_EVENT_THROTTLE             = 5,
+       PERF_EVENT_UNTHROTTLE           = 6,
+
        /*
         * When header.misc & PERF_EVENT_MISC_OVERFLOW the event_type field
         * will be PERF_RECORD_*
@@ -366,6 +376,7 @@ struct pmu {
        int (*enable)                   (struct perf_counter *counter);
        void (*disable)                 (struct perf_counter *counter);
        void (*read)                    (struct perf_counter *counter);
+       void (*unthrottle)              (struct perf_counter *counter);
 };
 
 /**
@@ -451,9 +462,6 @@ struct perf_counter {
        struct perf_counter_context     *ctx;
        struct file                     *filp;
 
-       struct perf_counter             *parent;
-       struct list_head                child_list;
-
        /*
         * These accumulate total time (in nanoseconds) that children
         * counters have been enabled and running, respectively.
@@ -464,11 +472,16 @@ struct perf_counter {
        /*
         * Protect attach/detach and child_list:
         */
-       struct mutex                    mutex;
+       struct mutex                    child_mutex;
+       struct list_head                child_list;
+       struct perf_counter             *parent;
 
        int                             oncpu;
        int                             cpu;
 
+       struct list_head                owner_entry;
+       struct task_struct              *owner;
+
        /* mmap bits */
        struct mutex                    mmap_mutex;
        atomic_t                        mmap_count;
@@ -513,7 +526,6 @@ struct perf_counter_context {
        struct list_head        event_list;
        int                     nr_counters;
        int                     nr_active;
-       int                     nr_enabled;
        int                     is_active;
        atomic_t                refcount;
        struct task_struct      *task;
@@ -564,11 +576,10 @@ extern void perf_counter_task_sched_in(struct task_struct *task, int cpu);
 extern void perf_counter_task_sched_out(struct task_struct *task,
                                        struct task_struct *next, int cpu);
 extern void perf_counter_task_tick(struct task_struct *task, int cpu);
-extern void perf_counter_init_task(struct task_struct *child);
+extern int perf_counter_init_task(struct task_struct *child);
 extern void perf_counter_exit_task(struct task_struct *child);
 extern void perf_counter_do_pending(void);
 extern void perf_counter_print_debug(void);
-extern void perf_counter_unthrottle(void);
 extern void __perf_disable(void);
 extern bool __perf_enable(void);
 extern void perf_disable(void);
@@ -612,6 +623,7 @@ extern struct perf_callchain_entry *perf_callchain(struct pt_regs *regs);
 
 extern int sysctl_perf_counter_priv;
 extern int sysctl_perf_counter_mlock;
+extern int sysctl_perf_counter_limit;
 
 extern void perf_counter_init(void);
 
@@ -625,14 +637,14 @@ extern void perf_counter_init(void);
 static inline void
 perf_counter_task_sched_in(struct task_struct *task, int cpu)          { }
 static inline void
-perf_counter_task_sched_out(struct task_struct *task, int cpu)         { }
+perf_counter_task_sched_out(struct task_struct *task,
+                           struct task_struct *next, int cpu)          { }
 static inline void
 perf_counter_task_tick(struct task_struct *task, int cpu)              { }
-static inline void perf_counter_init_task(struct task_struct *child)   { }
+static inline int perf_counter_init_task(struct task_struct *child)    { }
 static inline void perf_counter_exit_task(struct task_struct *child)   { }
 static inline void perf_counter_do_pending(void)                       { }
 static inline void perf_counter_print_debug(void)                      { }
-static inline void perf_counter_unthrottle(void)                       { }
 static inline void perf_disable(void)                                  { }
 static inline void perf_enable(void)                                   { }
 static inline int perf_counter_task_disable(void)      { return -EINVAL; }