aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/oprofile/cpu_buffer.h
diff options
context:
space:
mode:
authorRobert Richter <robert.richter@amd.com>2008-11-27 04:57:09 -0500
committerRobert Richter <robert.richter@amd.com>2008-12-10 08:20:13 -0500
commit7d468abee0f1a7e918b5e2f23120436a54ba9f33 (patch)
tree397e40ca95ef2dcf70ed308cd1032c0f63f0508c /drivers/oprofile/cpu_buffer.h
parente2ac8ef576e45d9db7264abc51383e68d26067bb (diff)
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);
52 52
53void cpu_buffer_reset(struct oprofile_cpu_buffer *cpu_buf); 53void cpu_buffer_reset(struct oprofile_cpu_buffer *cpu_buf);
54 54
55static inline
56struct op_sample *cpu_buffer_write_entry(struct oprofile_cpu_buffer *cpu_buf)
57{
58 return &cpu_buf->buffer[cpu_buf->head_pos];
59}
60
61static inline
62struct op_sample *cpu_buffer_read_entry(struct oprofile_cpu_buffer *cpu_buf)
63{
64 return &cpu_buf->buffer[cpu_buf->tail_pos];
65}
66
55/* transient events for the CPU buffer -> event buffer */ 67/* transient events for the CPU buffer -> event buffer */
56#define CPU_IS_KERNEL 1 68#define CPU_IS_KERNEL 1
57#define CPU_TRACE_BEGIN 2 69#define CPU_TRACE_BEGIN 2