aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Richter <robert.richter@amd.com>2008-12-24 10:53:53 -0500
committerRobert Richter <robert.richter@amd.com>2008-12-29 09:17:52 -0500
commit6d2c53f3cd81e33eec17aa99845d43e599986982 (patch)
treeba8462e472851065843396f1a5aaf3bbfc46ebb3
parentbd2172f58094b3f8afa017e68f3f0b57577824e1 (diff)
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: Robert Richter <robert.richter@amd.com>
-rw-r--r--drivers/oprofile/buffer_sync.c10
-rw-r--r--drivers/oprofile/cpu_buffer.c4
-rw-r--r--drivers/oprofile/cpu_buffer.h10
3 files changed, 12 insertions, 12 deletions
diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c
index 737bd9484822..d295d92b57f0 100644
--- a/drivers/oprofile/buffer_sync.c
+++ b/drivers/oprofile/buffer_sync.c
@@ -331,7 +331,7 @@ static void add_ibs_begin(int cpu, int code, struct mm_struct *mm)
331 off_t offset; 331 off_t offset;
332 struct op_sample *sample; 332 struct op_sample *sample;
333 333
334 sample = cpu_buffer_read_entry(cpu); 334 sample = op_cpu_buffer_read_entry(cpu);
335 if (!sample) 335 if (!sample)
336 goto Error; 336 goto Error;
337 rip = sample->eip; 337 rip = sample->eip;
@@ -370,7 +370,7 @@ static void add_ibs_begin(int cpu, int code, struct mm_struct *mm)
370 count = IBS_OP_CODE_SIZE; /*IBS OP is 5 int64s*/ 370 count = IBS_OP_CODE_SIZE; /*IBS OP is 5 int64s*/
371 371
372 for (i = 0; i < count; i++) { 372 for (i = 0; i < count; i++) {
373 sample = cpu_buffer_read_entry(cpu); 373 sample = op_cpu_buffer_read_entry(cpu);
374 if (!sample) 374 if (!sample)
375 goto Error; 375 goto Error;
376 add_event_entry(sample->eip); 376 add_event_entry(sample->eip);
@@ -537,11 +537,11 @@ void sync_buffer(int cpu)
537 537
538 add_cpu_switch(cpu); 538 add_cpu_switch(cpu);
539 539
540 cpu_buffer_reset(cpu); 540 op_cpu_buffer_reset(cpu);
541 available = cpu_buffer_entries(cpu); 541 available = op_cpu_buffer_entries(cpu);
542 542
543 for (i = 0; i < available; ++i) { 543 for (i = 0; i < available; ++i) {
544 struct op_sample *s = cpu_buffer_read_entry(cpu); 544 struct op_sample *s = op_cpu_buffer_read_entry(cpu);
545 if (!s) 545 if (!s)
546 break; 546 break;
547 547
diff --git a/drivers/oprofile/cpu_buffer.c b/drivers/oprofile/cpu_buffer.c
index fcf96f608d86..e52c085cd186 100644
--- a/drivers/oprofile/cpu_buffer.c
+++ b/drivers/oprofile/cpu_buffer.c
@@ -152,14 +152,14 @@ add_sample(struct oprofile_cpu_buffer *cpu_buf,
152 struct op_entry entry; 152 struct op_entry entry;
153 int ret; 153 int ret;
154 154
155 ret = cpu_buffer_write_entry(&entry); 155 ret = op_cpu_buffer_write_entry(&entry);
156 if (ret) 156 if (ret)
157 return ret; 157 return ret;
158 158
159 entry.sample->eip = pc; 159 entry.sample->eip = pc;
160 entry.sample->event = event; 160 entry.sample->event = event;
161 161
162 ret = cpu_buffer_write_commit(&entry); 162 ret = op_cpu_buffer_write_commit(&entry);
163 if (ret) 163 if (ret)
164 return ret; 164 return ret;
165 165
diff --git a/drivers/oprofile/cpu_buffer.h b/drivers/oprofile/cpu_buffer.h
index aacb0f0bc566..83d491e273fe 100644
--- a/drivers/oprofile/cpu_buffer.h
+++ b/drivers/oprofile/cpu_buffer.h
@@ -64,7 +64,7 @@ DECLARE_PER_CPU(struct oprofile_cpu_buffer, cpu_buffer);
64 * reset these to invalid values; the next sample collected will 64 * reset these to invalid values; the next sample collected will
65 * populate the buffer with proper values to initialize the buffer 65 * populate the buffer with proper values to initialize the buffer
66 */ 66 */
67static inline void cpu_buffer_reset(int cpu) 67static inline void op_cpu_buffer_reset(int cpu)
68{ 68{
69 struct oprofile_cpu_buffer *cpu_buf = &per_cpu(cpu_buffer, cpu); 69 struct oprofile_cpu_buffer *cpu_buf = &per_cpu(cpu_buffer, cpu);
70 70
@@ -72,7 +72,7 @@ static inline void cpu_buffer_reset(int cpu)
72 cpu_buf->last_task = NULL; 72 cpu_buf->last_task = NULL;
73} 73}
74 74
75static inline int cpu_buffer_write_entry(struct op_entry *entry) 75static inline int op_cpu_buffer_write_entry(struct op_entry *entry)
76{ 76{
77 entry->event = ring_buffer_lock_reserve(op_ring_buffer_write, 77 entry->event = ring_buffer_lock_reserve(op_ring_buffer_write,
78 sizeof(struct op_sample), 78 sizeof(struct op_sample),
@@ -88,13 +88,13 @@ static inline int cpu_buffer_write_entry(struct op_entry *entry)
88 return 0; 88 return 0;
89} 89}
90 90
91static inline int cpu_buffer_write_commit(struct op_entry *entry) 91static inline int op_cpu_buffer_write_commit(struct op_entry *entry)
92{ 92{
93 return ring_buffer_unlock_commit(op_ring_buffer_write, entry->event, 93 return ring_buffer_unlock_commit(op_ring_buffer_write, entry->event,
94 entry->irq_flags); 94 entry->irq_flags);
95} 95}
96 96
97static inline struct op_sample *cpu_buffer_read_entry(int cpu) 97static inline struct op_sample *op_cpu_buffer_read_entry(int cpu)
98{ 98{
99 struct ring_buffer_event *e; 99 struct ring_buffer_event *e;
100 e = ring_buffer_consume(op_ring_buffer_read, cpu, NULL); 100 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} 111}
112 112
113/* "acquire" as many cpu buffer slots as we can */ 113/* "acquire" as many cpu buffer slots as we can */
114static inline unsigned long cpu_buffer_entries(int cpu) 114static inline unsigned long op_cpu_buffer_entries(int cpu)
115{ 115{
116 return ring_buffer_entries_cpu(op_ring_buffer_read, cpu) 116 return ring_buffer_entries_cpu(op_ring_buffer_read, cpu)
117 + ring_buffer_entries_cpu(op_ring_buffer_write, cpu); 117 + ring_buffer_entries_cpu(op_ring_buffer_write, cpu);