
From: Greg Banks <gnb@sgi.com>

Allow stack tracing to work when sampling on timer is forced using the
timer=1 boot option.  Reported by Akinobu Mita.

Signed-off-by: Greg Banks <gnb@melbourne.sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/drivers/oprofile/oprof.c     |    6 ++----
 25-akpm/drivers/oprofile/timer_int.c |    3 +++
 2 files changed, 5 insertions(+), 4 deletions(-)

diff -puN drivers/oprofile/oprof.c~oprofile-timer-backtrace-fix-2 drivers/oprofile/oprof.c
--- 25/drivers/oprofile/oprof.c~oprofile-timer-backtrace-fix-2	Thu Dec  9 14:37:07 2004
+++ 25-akpm/drivers/oprofile/oprof.c	Thu Dec  9 14:37:07 2004
@@ -155,13 +155,11 @@ static int __init oprofile_init(void)
 {
 	int err = 0;
 
-	/* this is our fallback case */
-	oprofile_timer_init(&oprofile_ops);
+	oprofile_arch_init(&oprofile_ops);
 
 	if (timer) {
 		printk(KERN_INFO "oprofile: using timer interrupt.\n");
-	} else {
-		oprofile_arch_init(&oprofile_ops);
+		oprofile_timer_init(&oprofile_ops);
 	}
 
 	err = oprofilefs_register();
diff -puN drivers/oprofile/timer_int.c~oprofile-timer-backtrace-fix-2 drivers/oprofile/timer_int.c
--- 25/drivers/oprofile/timer_int.c~oprofile-timer-backtrace-fix-2	Thu Dec  9 14:37:07 2004
+++ 25-akpm/drivers/oprofile/timer_int.c	Thu Dec  9 14:37:07 2004
@@ -37,6 +37,9 @@ static void timer_stop(void)
 
 void __init oprofile_timer_init(struct oprofile_operations * ops)
 {
+	ops->create_files = NULL;
+	ops->setup = NULL;
+	ops->shutdown = NULL;
 	ops->start = timer_start;
 	ops->stop = timer_stop;
 	ops->cpu_type = "timer";
_
