We should be using profile_pc in oprofile_add_sample so that lock 
contention is attibuted to the correct function in profile output. Also 
fix SH7750 support.

Signed-off-by: Zwane Mwaikambo <[EMAIL PROTECTED]>

===== drivers/oprofile/cpu_buffer.c 1.17 vs edited =====
--- 1.17/drivers/oprofile/cpu_buffer.c  2005-01-04 19:48:24 -07:00
+++ edited/drivers/oprofile/cpu_buffer.c        2005-01-28 11:08:37 -07:00
@@ -233,7 +233,7 @@ static void oprofile_end_trace(struct op
 void oprofile_add_sample(struct pt_regs * const regs, unsigned long event)
 {
        struct oprofile_cpu_buffer * cpu_buf = &cpu_buffer[smp_processor_id()];
-       unsigned long pc = instruction_pointer(regs);
+       unsigned long pc = profile_pc(regs);
        int is_kernel = !user_mode(regs);
 
        if (!backtrace_depth) {
===== arch/sh/oprofile/op_model_sh7750.c 1.1 vs edited =====
--- 1.1/arch/sh/oprofile/op_model_sh7750.c      2004-10-18 23:26:43 -06:00
+++ edited/arch/sh/oprofile/op_model_sh7750.c   2005-01-28 11:16:54 -07:00
@@ -112,14 +112,9 @@ static struct op_counter_config ctr[NR_C
  */
 
 static int sh7750_timer_notify(struct notifier_block *self,
-                              unsigned long val, void *data)
+                              unsigned long val, void *regs)
 {
-       struct pt_regs *regs = data;
-       unsigned long pc;
-
-       pc = instruction_pointer(regs);
-       oprofile_add_sample(pc, !user_mode(regs), 0, smp_processor_id());
-
+       oprofile_add_sample((struct pt_regs *)regs, 0);
        return 0;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to