summaryrefslogtreecommitdiff
path: root/drivers/oprofile/buffer_sync.c
diff options
context:
space:
mode:
authorBarry Kasindorf <barry.kasindorf@amd.com>2008-07-15 02:10:36 +0400
committerRobert Richter <robert.richter@amd.com>2008-10-20 15:44:21 +0400
commit9b1f261166f56d4b2c33fdf5aad64edd5e30b46f (patch)
tree748011b45dc178a218df9146921ca027fa99b2cc /drivers/oprofile/buffer_sync.c
parent4bd9b9dc97e344670e9e5762399a07dcd5f15311 (diff)
downloadlinux-9b1f261166f56d4b2c33fdf5aad64edd5e30b46f.tar.xz
OProfile: Fix buffer synchronization for IBS
The patch is needed since there is some IBS code in add_ibs_begin() that handles more than one sample per iteration. This requires calling get_slots() during each loop. This fixes the current problem, but a proper solution that reworks the cpu buffer synchronization is needed here in the future. Signed-off-by: Barry Kasindorf <barry.kasindorf@amd.com> Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'drivers/oprofile/buffer_sync.c')
-rw-r--r--drivers/oprofile/buffer_sync.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c
index 33bfa60b0c66..6c0c92a745dd 100644
--- a/drivers/oprofile/buffer_sync.c
+++ b/drivers/oprofile/buffer_sync.c
@@ -564,9 +564,11 @@ void sync_buffer(int cpu)
struct task_struct *new;
unsigned long cookie = 0;
int in_kernel = 1;
- unsigned int i;
sync_buffer_state state = sb_buffer_start;
+#ifndef CONFIG_OPROFILE_IBS
+ unsigned int i;
unsigned long available;
+#endif
mutex_lock(&buffer_mutex);
@@ -574,9 +576,13 @@ void sync_buffer(int cpu)
/* Remember, only we can modify tail_pos */
+#ifndef CONFIG_OPROFILE_IBS
available = get_slots(cpu_buf);
for (i = 0; i < available; ++i) {
+#else
+ while (get_slots(cpu_buf)) {
+#endif
struct op_sample *s = &cpu_buf->buffer[cpu_buf->tail_pos];
if (is_code(s->eip)) {