
From: Zwane Mwaikambo <zwane@fsmlabs.com>

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 <zwane@fsmlabs.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/arch/sh/oprofile/op_model_sh7750.c |    9 ++-------
 25-akpm/drivers/oprofile/cpu_buffer.c      |    2 +-
 2 files changed, 3 insertions(+), 8 deletions(-)

diff -puN arch/sh/oprofile/op_model_sh7750.c~oprofile-use-profile_pc-in-oprofile_add_sample arch/sh/oprofile/op_model_sh7750.c
--- 25/arch/sh/oprofile/op_model_sh7750.c~oprofile-use-profile_pc-in-oprofile_add_sample	2005-01-28 14:21:05.764425456 -0800
+++ 25-akpm/arch/sh/oprofile/op_model_sh7750.c	2005-01-28 14:21:05.779423176 -0800
@@ -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;
 }
 
diff -puN drivers/oprofile/cpu_buffer.c~oprofile-use-profile_pc-in-oprofile_add_sample drivers/oprofile/cpu_buffer.c
--- 25/drivers/oprofile/cpu_buffer.c~oprofile-use-profile_pc-in-oprofile_add_sample	2005-01-28 14:21:05.773424088 -0800
+++ 25-akpm/drivers/oprofile/cpu_buffer.c	2005-01-28 14:21:05.778423328 -0800
@@ -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) {
_
