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>
This commit is contained in:
Robert Richter
2008-11-27 10:57:09 +01:00
parent e2ac8ef576
commit 7d468abee0
3 changed files with 22 additions and 12 deletions

View File

@@ -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