Commit 6d2c53f3 authored by Robert Richter's avatar Robert Richter

oprofile: rename cpu buffer functions

This patch renames cpu buffer functions to something more oprofile
specific names. Functions will be moved to the global name space.

Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
parent bd2172f5
...@@ -331,7 +331,7 @@ static void add_ibs_begin(int cpu, int code, struct mm_struct *mm) ...@@ -331,7 +331,7 @@ static void add_ibs_begin(int cpu, int code, struct mm_struct *mm)
off_t offset; off_t offset;
struct op_sample *sample; struct op_sample *sample;
sample = cpu_buffer_read_entry(cpu); sample = op_cpu_buffer_read_entry(cpu);
if (!sample) if (!sample)
goto Error; goto Error;
rip = sample->eip; rip = sample->eip;
...@@ -370,7 +370,7 @@ static void add_ibs_begin(int cpu, int code, struct mm_struct *mm) ...@@ -370,7 +370,7 @@ static void add_ibs_begin(int cpu, int code, struct mm_struct *mm)
count = IBS_OP_CODE_SIZE; /*IBS OP is 5 int64s*/ count = IBS_OP_CODE_SIZE; /*IBS OP is 5 int64s*/
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
sample = cpu_buffer_read_entry(cpu); sample = op_cpu_buffer_read_entry(cpu);
if (!sample) if (!sample)
goto Error; goto Error;
add_event_entry(sample->eip); add_event_entry(sample->eip);
...@@ -537,11 +537,11 @@ void sync_buffer(int cpu) ...@@ -537,11 +537,11 @@ void sync_buffer(int cpu)
add_cpu_switch(cpu); add_cpu_switch(cpu);
cpu_buffer_reset(cpu); op_cpu_buffer_reset(cpu);
available = cpu_buffer_entries(cpu); available = op_cpu_buffer_entries(cpu);
for (i = 0; i < available; ++i) { for (i = 0; i < available; ++i) {
struct op_sample *s = cpu_buffer_read_entry(cpu); struct op_sample *s = op_cpu_buffer_read_entry(cpu);
if (!s) if (!s)
break; break;
......
...@@ -152,14 +152,14 @@ add_sample(struct oprofile_cpu_buffer *cpu_buf, ...@@ -152,14 +152,14 @@ add_sample(struct oprofile_cpu_buffer *cpu_buf,
struct op_entry entry; struct op_entry entry;
int ret; int ret;
ret = cpu_buffer_write_entry(&entry); ret = op_cpu_buffer_write_entry(&entry);
if (ret) if (ret)
return ret; return ret;
entry.sample->eip = pc; entry.sample->eip = pc;
entry.sample->event = event; entry.sample->event = event;
ret = cpu_buffer_write_commit(&entry); ret = op_cpu_buffer_write_commit(&entry);
if (ret) if (ret)
return ret; return ret;
......
...@@ -64,7 +64,7 @@ DECLARE_PER_CPU(struct oprofile_cpu_buffer, cpu_buffer); ...@@ -64,7 +64,7 @@ DECLARE_PER_CPU(struct oprofile_cpu_buffer, cpu_buffer);
* reset these to invalid values; the next sample collected will * reset these to invalid values; the next sample collected will
* populate the buffer with proper values to initialize the buffer * populate the buffer with proper values to initialize the buffer
*/ */
static inline void cpu_buffer_reset(int cpu) static inline void op_cpu_buffer_reset(int cpu)
{ {
struct oprofile_cpu_buffer *cpu_buf = &per_cpu(cpu_buffer, cpu); struct oprofile_cpu_buffer *cpu_buf = &per_cpu(cpu_buffer, cpu);
...@@ -72,7 +72,7 @@ static inline void cpu_buffer_reset(int cpu) ...@@ -72,7 +72,7 @@ static inline void cpu_buffer_reset(int cpu)
cpu_buf->last_task = NULL; cpu_buf->last_task = NULL;
} }
static inline int cpu_buffer_write_entry(struct op_entry *entry) static inline int op_cpu_buffer_write_entry(struct op_entry *entry)
{ {
entry->event = ring_buffer_lock_reserve(op_ring_buffer_write, entry->event = ring_buffer_lock_reserve(op_ring_buffer_write,
sizeof(struct op_sample), sizeof(struct op_sample),
...@@ -88,13 +88,13 @@ static inline int cpu_buffer_write_entry(struct op_entry *entry) ...@@ -88,13 +88,13 @@ static inline int cpu_buffer_write_entry(struct op_entry *entry)
return 0; return 0;
} }
static inline int cpu_buffer_write_commit(struct op_entry *entry) static inline int op_cpu_buffer_write_commit(struct op_entry *entry)
{ {
return ring_buffer_unlock_commit(op_ring_buffer_write, entry->event, return ring_buffer_unlock_commit(op_ring_buffer_write, entry->event,
entry->irq_flags); entry->irq_flags);
} }
static inline struct op_sample *cpu_buffer_read_entry(int cpu) static inline struct op_sample *op_cpu_buffer_read_entry(int cpu)
{ {
struct ring_buffer_event *e; struct ring_buffer_event *e;
e = ring_buffer_consume(op_ring_buffer_read, cpu, NULL); e = ring_buffer_consume(op_ring_buffer_read, cpu, NULL);
...@@ -111,7 +111,7 @@ static inline struct op_sample *cpu_buffer_read_entry(int cpu) ...@@ -111,7 +111,7 @@ static inline struct op_sample *cpu_buffer_read_entry(int cpu)
} }
/* "acquire" as many cpu buffer slots as we can */ /* "acquire" as many cpu buffer slots as we can */
static inline unsigned long cpu_buffer_entries(int cpu) static inline unsigned long op_cpu_buffer_entries(int cpu)
{ {
return ring_buffer_entries_cpu(op_ring_buffer_read, cpu) return ring_buffer_entries_cpu(op_ring_buffer_read, cpu)
+ ring_buffer_entries_cpu(op_ring_buffer_write, cpu); + ring_buffer_entries_cpu(op_ring_buffer_write, cpu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment