From c92960fccb9f32a1d6110f6dcfe483ed96c62beb Mon Sep 17 00:00:00 2001 From: Robert Richter Date: Fri, 5 Sep 2008 17:12:36 +0200 Subject: oprofile: whitespace fixes Signed-off-by: Robert Richter --- drivers/oprofile/buffer_sync.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/oprofile/buffer_sync.c') diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c index ed982273fb8b..564577307a5e 100644 --- a/drivers/oprofile/buffer_sync.c +++ b/drivers/oprofile/buffer_sync.c @@ -41,7 +41,6 @@ static cpumask_t marked_cpus = CPU_MASK_NONE; static DEFINE_SPINLOCK(task_mortuary); static void process_task_mortuary(void); - /* Take ownership of the task struct and place it on the * list for processing. Only after two full buffer syncs * does the task eventually get freed, because by then -- cgit v1.2.3 From 8655a3b8725d5598adc438ec94916568afcc5ec9 Mon Sep 17 00:00:00 2001 From: Robert Richter Date: Mon, 28 Jul 2008 18:13:10 +0200 Subject: x86/oprofile: removing unused function parameter in add_ibs_begin() Signed-off-by: Robert Richter --- drivers/oprofile/buffer_sync.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'drivers/oprofile/buffer_sync.c') diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c index 564577307a5e..33bfa60b0c66 100644 --- a/drivers/oprofile/buffer_sync.c +++ b/drivers/oprofile/buffer_sync.c @@ -340,7 +340,7 @@ static void add_trace_begin(void) * Add IBS fetch and op entries to event buffer */ static void add_ibs_begin(struct oprofile_cpu_buffer *cpu_buf, int code, - int in_kernel, struct mm_struct *mm) + struct mm_struct *mm) { unsigned long rip; int i, count; @@ -592,12 +592,10 @@ void sync_buffer(int cpu) #ifdef CONFIG_OPROFILE_IBS } else if (s->event == IBS_FETCH_BEGIN) { state = sb_bt_start; - add_ibs_begin(cpu_buf, - IBS_FETCH_CODE, in_kernel, mm); + add_ibs_begin(cpu_buf, IBS_FETCH_CODE, mm); } else if (s->event == IBS_OP_BEGIN) { state = sb_bt_start; - add_ibs_begin(cpu_buf, - IBS_OP_CODE, in_kernel, mm); + add_ibs_begin(cpu_buf, IBS_OP_CODE, mm); #endif } else { struct mm_struct *oldmm = mm; -- cgit v1.2.3 From 9b1f261166f56d4b2c33fdf5aad64edd5e30b46f Mon Sep 17 00:00:00 2001 From: Barry Kasindorf Date: Tue, 15 Jul 2008 00:10:36 +0200 Subject: 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 Signed-off-by: Robert Richter --- drivers/oprofile/buffer_sync.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'drivers/oprofile/buffer_sync.c') 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)) { -- cgit v1.2.3