public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [mm patch] oprofile: backtrace operation does not initialized
@ 2004-12-08  9:30 Akinobu Mita
  2004-12-08  9:34 ` Akinobu Mita
  2004-12-08 16:00 ` John Levon
  0 siblings, 2 replies; 16+ messages in thread
From: Akinobu Mita @ 2004-12-08  9:30 UTC (permalink / raw)
  To: phil.el; +Cc: John Levon, linux-kernel

Hello.

When I forced the oprofile to use timer interrupt with specifying
"timer=1" module parameter. "oprofile_operations->backtrace" did
not initialized on i386.

Please apply this patch, or make oprofile initialize the backtrace
operation in case of using timer interrupt in your preferable way.

---

Signed-off-by: Akinobu Mita <amgta@yacht.ocn.ne.jp>

 arch/alpha/oprofile/common.c |    3 +++
 arch/arm/oprofile/init.c     |    3 +++
 arch/i386/oprofile/init.c    |    5 ++++-
 arch/ia64/oprofile/init.c    |    5 ++++-
 arch/ppc64/oprofile/common.c |    3 +++
 drivers/oprofile/oprof.c     |    4 ++--
 include/linux/oprofile.h     |    2 ++
 7 files changed, 21 insertions(+), 4 deletions(-)

diff -Nurp 2.6-mm.orig/arch/alpha/oprofile/common.c 2.6-mm/arch/alpha/oprofile/common.c
--- 2.6-mm.orig/arch/alpha/oprofile/common.c	2004-12-07 00:11:29.000000000 +0900
+++ 2.6-mm/arch/alpha/oprofile/common.c	2004-12-07 23:35:48.000000000 +0900
@@ -143,6 +143,9 @@ oprofile_arch_init(struct oprofile_opera
 {
 	struct op_axp_model *lmodel = NULL;
 
+	if (ops->force_timer)
+		return;
+
 	switch (implver()) {
 	case IMPLVER_EV4:
 		lmodel = &op_model_ev4;
diff -Nurp 2.6-mm.orig/arch/arm/oprofile/init.c 2.6-mm/arch/arm/oprofile/init.c
--- 2.6-mm.orig/arch/arm/oprofile/init.c	2004-12-07 00:11:32.000000000 +0900
+++ 2.6-mm/arch/arm/oprofile/init.c	2004-12-07 23:37:26.000000000 +0900
@@ -14,6 +14,9 @@
 
 void __init oprofile_arch_init(struct oprofile_operations *ops)
 {
+	if (ops->force_timer)
+		return;
+
 #ifdef CONFIG_CPU_XSCALE
 	pmu_init(ops, &op_xscale_spec);
 #endif
diff -Nurp 2.6-mm.orig/arch/i386/oprofile/init.c 2.6-mm/arch/i386/oprofile/init.c
--- 2.6-mm.orig/arch/i386/oprofile/init.c	2004-12-07 00:11:15.000000000 +0900
+++ 2.6-mm/arch/i386/oprofile/init.c	2004-12-07 23:29:31.000000000 +0900
@@ -25,6 +25,10 @@ void __init oprofile_arch_init(struct op
 {
 	int ret __attribute_used__ = -ENODEV;
 
+	ops->backtrace = x86_backtrace;
+	if (ops->force_timer)
+		return;
+
 #ifdef CONFIG_X86_LOCAL_APIC
 	ret = nmi_init(ops);
 #endif
@@ -32,7 +36,6 @@ void __init oprofile_arch_init(struct op
 	if (ret < 0)
 		ret = nmi_timer_init(ops);
 #endif
-	ops->backtrace = x86_backtrace;
 }
 
 
diff -Nurp 2.6-mm.orig/arch/ia64/oprofile/init.c 2.6-mm/arch/ia64/oprofile/init.c
--- 2.6-mm.orig/arch/ia64/oprofile/init.c	2004-12-07 00:11:29.000000000 +0900
+++ 2.6-mm/arch/ia64/oprofile/init.c	2004-12-07 23:35:02.000000000 +0900
@@ -18,11 +18,14 @@ extern void ia64_backtrace(struct pt_reg
 
 void __init oprofile_arch_init(struct oprofile_operations * ops)
 {
+	ops->backtrace = ia64_backtrace;
+	if (ops->force_timer)
+		return;
+
 #ifdef CONFIG_PERFMON
 	/* perfmon_init() can fail, but we have no way to report it */
 	perfmon_init(ops);
 #endif
-	ops->backtrace = ia64_backtrace;
 }
 
 
diff -Nurp 2.6-mm.orig/arch/ppc64/oprofile/common.c 2.6-mm/arch/ppc64/oprofile/common.c
--- 2.6-mm.orig/arch/ppc64/oprofile/common.c	2004-12-07 00:11:30.000000000 +0900
+++ 2.6-mm/arch/ppc64/oprofile/common.c	2004-12-07 23:36:59.000000000 +0900
@@ -129,6 +129,9 @@ void __init oprofile_arch_init(struct op
 {
 	unsigned int pvr;
 
+	if (ops->force_timer)
+		return;
+
 	pvr = mfspr(SPRN_PVR);
 
 	switch (PVR_VER(pvr)) {
diff -Nurp 2.6-mm.orig/drivers/oprofile/oprof.c 2.6-mm/drivers/oprofile/oprof.c
--- 2.6-mm.orig/drivers/oprofile/oprof.c	2004-12-07 00:12:07.000000000 +0900
+++ 2.6-mm/drivers/oprofile/oprof.c	2004-12-07 22:51:21.000000000 +0900
@@ -159,10 +159,10 @@ static int __init oprofile_init(void)
 	oprofile_timer_init(&oprofile_ops);
 
 	if (timer) {
+		oprofile_ops.force_timer = 1;
 		printk(KERN_INFO "oprofile: using timer interrupt.\n");
-	} else {
-		oprofile_arch_init(&oprofile_ops);
 	}
+	oprofile_arch_init(&oprofile_ops);
 
 	err = oprofilefs_register();
 	if (err)
diff -Nurp 2.6-mm.orig/include/linux/oprofile.h 2.6-mm/include/linux/oprofile.h
--- 2.6-mm.orig/include/linux/oprofile.h	2004-12-07 00:12:32.000000000 +0900
+++ 2.6-mm/include/linux/oprofile.h	2004-12-07 22:50:07.000000000 +0900
@@ -39,6 +39,8 @@ struct oprofile_operations {
 	void (*backtrace)(struct pt_regs * const regs, unsigned int depth);
 	/* CPU identification string. */
 	char * cpu_type;
+	/* Force use of timer interrupt */
+	int force_timer;
 };
 
 /**



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2004-12-09 15:28 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-08  9:30 [mm patch] oprofile: backtrace operation does not initialized Akinobu Mita
2004-12-08  9:34 ` Akinobu Mita
2004-12-08 11:13   ` Ingo Molnar
2004-12-08 11:37     ` Akinobu Mita
2004-12-08 16:00 ` John Levon
2004-12-08 22:31   ` Greg Banks
2004-12-08 23:56     ` Philippe Elie
2004-12-09  0:39       ` Greg Banks
2004-12-09  1:46         ` John Levon
2004-12-09  1:50           ` Greg Banks
2004-12-09  2:23             ` John Levon
2004-12-09 14:22             ` Akinobu Mita
2004-12-09 14:53               ` Akinobu Mita
2004-12-09 14:55                 ` John Levon
2004-12-09 15:27                   ` Greg Banks
2004-12-09 15:23               ` Greg Banks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox