Skip to contentSkip to conversation

ia64 perfmon OProfile support

PATCH New John Levon 1 participant 1 message Oct 14, 2003

lore
Share & tools
lore

John Levon

author
#0 lore raw

PATCH 1/1 ia64 perfmon OProfile support

Here's the kernel patch OProfile needs for perfmon support. The rest of the changes are all in userspace now, I think.

regards
john

Index: linux-cvs//arch/ia64/oprofile/Makefile =================================RCS file: /home/cvs/linux-2.5/arch/ia64/oprofile/Makefile,v retrieving revision 1.2

/arch/ia64/oprofile/Makefile +1 -0
diff -u -a -p -r1.2 Makefile
@@ -7,3 +7,4 @@ DRIVER_OBJS := $(addprefix ../../../driv
 		timer_int.o )
 
 oprofile-y := $(DRIVER_OBJS) init.o
+oprofile-$(CONFIG_PERFMON) += perfmon.o

Index: linux-cvs//arch/ia64/oprofile/init.c =================================RCS file: /home/cvs/linux-2.5/arch/ia64/oprofile/init.c,v retrieving revision 1.2

/arch/ia64/oprofile/init.c +8 -1
diff -u -a -p -r1.2 init.c
@@ -12,14 +12,21 @@
 #include <linux/init.h>
 #include <linux/errno.h>
  
-extern void timer_init(struct oprofile_operations ** ops);
+extern int perfmon_init(struct oprofile_operations ** ops);
+extern void perfmon_exit(void);
 
 int __init oprofile_arch_init(struct oprofile_operations ** ops)
 {
+#ifdef CONFIG_PERFMON
+	return perfmon_init(ops);
+#endif
 	return -ENODEV;
 }
 
 
 void oprofile_arch_exit(void)
 {
+#ifdef CONFIG_PERFMON
+	perfmon_exit();
+#endif
 }
arch/ia64/oprofile/perfmon.c new file +82 -0

82 lines not on this page · raw message

Index: linux-cvs//drivers/oprofile/oprof.c =================================RCS file: /home/cvs/linux-2.5/drivers/oprofile/oprof.c,v retrieving revision 1.9

/drivers/oprofile/oprof.c +3 -2
diff -u -a -p -r1.9 oprof.c
@@ -88,7 +88,7 @@ int oprofile_start(void)
  
 	oprofile_reset_stats();
 
-	if ((err = oprofile_ops->start()))
+	if (oprofile_ops->start && (err = oprofile_ops->start()))
 		goto out;
 
 	oprofile_started = 1;
@@ -104,7 +104,8 @@ void oprofile_stop(void)
 	down(&start_sem);
 	if (!oprofile_started)
 		goto out;
-	oprofile_ops->stop();
+	if (oprofile_ops->stop)
+		oprofile_ops->stop();
 	oprofile_started = 0;
 	/* wake up the daemon to read what remains */
 	wake_up_buffer_waiter();