]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/oprofile/cpu_buffer.h
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[mv-sheeva.git] / drivers / oprofile / cpu_buffer.h
index e178dd2799c4f387f9fbff31805cbc34301792c6..63f81c44846ae28b5bf2020d8fe445e4e4377d7b 100644 (file)
@@ -35,13 +35,7 @@ struct op_sample {
        unsigned long data[0];
 };
 
-struct op_entry {
-       struct ring_buffer_event *event;
-       struct op_sample *sample;
-       unsigned long irq_flags;
-       unsigned long size;
-       unsigned long *data;
-};
+struct op_entry;
 
 struct oprofile_cpu_buffer {
        unsigned long buffer_size;
@@ -90,12 +84,30 @@ int op_cpu_buffer_add_data(struct op_entry *entry, unsigned long val)
        return entry->size;
 }
 
+/* returns the size of data in the entry */
+static inline
+int op_cpu_buffer_get_size(struct op_entry *entry)
+{
+       return entry->size;
+}
+
+/* returns 0 if empty or the size of data including the current value */
+static inline
+int op_cpu_buffer_get_data(struct op_entry *entry, unsigned long *val)
+{
+       int size = entry->size;
+       if (!size)
+               return 0;
+       *val = *entry->data;
+       entry->size--;
+       entry->data++;
+       return size;
+}
+
 /* extra data flags */
 #define KERNEL_CTX_SWITCH      (1UL << 0)
 #define IS_KERNEL              (1UL << 1)
 #define TRACE_BEGIN            (1UL << 2)
 #define USER_CTX_SWITCH                (1UL << 3)
-#define IBS_FETCH_BEGIN                (1UL << 4)
-#define IBS_OP_BEGIN           (1UL << 5)
 
 #endif /* OPROFILE_CPU_BUFFER_H */