summaryrefslogtreecommitdiff
path: root/drivers/oprofile/cpu_buffer.h
diff options
context:
space:
mode:
authorRobert Richter <robert.richter@amd.com>2008-11-27 12:57:09 +0300
committerRobert Richter <robert.richter@amd.com>2008-12-10 16:20:13 +0300
commit7d468abee0f1a7e918b5e2f23120436a54ba9f33 (patch)
tree397e40ca95ef2dcf70ed308cd1032c0f63f0508c /drivers/oprofile/cpu_buffer.h
parente2ac8ef576e45d9db7264abc51383e68d26067bb (diff)
downloadlinux-7d468abee0f1a7e918b5e2f23120436a54ba9f33.tar.xz
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>
Diffstat (limited to 'drivers/oprofile/cpu_buffer.h')
-rw-r--r--drivers/oprofile/cpu_buffer.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/oprofile/cpu_buffer.h b/drivers/oprofile/cpu_buffer.h
index d3cc26264db5..08706991fdd2 100644
--- a/drivers/oprofile/cpu_buffer.h
+++ b/drivers/oprofile/cpu_buffer.h
@@ -52,6 +52,18 @@ DECLARE_PER_CPU(struct oprofile_cpu_buffer, cpu_buffer);
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