oprofile: adding cpu buffer r/w access functions
This is in preparation for changes in the cpu buffer implementation.
Signed-off-by: Robert Richter <robert.richter@amd.com>
diff --git a/drivers/oprofile/cpu_buffer.h b/drivers/oprofile/cpu_buffer.h
index d3cc262..0870699 100644
--- a/drivers/oprofile/cpu_buffer.h
+++ b/drivers/oprofile/cpu_buffer.h
@@ -52,6 +52,18 @@
void cpu_buffer_reset(struct oprofile_cpu_buffer *cpu_buf);
+static inline
+struct op_sample *cpu_buffer_write_entry(struct oprofile_cpu_buffer *cpu_buf)
+{
+ return &cpu_buf->buffer[cpu_buf->head_pos];
+}
+
+static inline
+struct op_sample *cpu_buffer_read_entry(struct oprofile_cpu_buffer *cpu_buf)
+{
+ return &cpu_buf->buffer[cpu_buf->tail_pos];
+}
+
/* transient events for the CPU buffer -> event buffer */
#define CPU_IS_KERNEL 1
#define CPU_TRACE_BEGIN 2