linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] OProfile: Use profile_pc in oprofile_add_sample
@ 2005-01-28 19:05 Zwane Mwaikambo
  0 siblings, 0 replies; only message in thread
From: Zwane Mwaikambo @ 2005-01-28 19:05 UTC (permalink / raw)
  To: Linux Kernel; +Cc: John Levon, Andrew Morton, paul.mundt

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>

===== 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;
 }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-01-28 19:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-28 19:05 [PATCH] OProfile: Use profile_pc in oprofile_add_sample Zwane Mwaikambo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).