[PATCH] OProfile driver in 2.6

From: Jens Schmalzing
Date: Wed Jun 02 2004 - 04:20:53 EST


Hi,

I noticed that the driver for the OProfile profiling system, which
existed in the linuxppc-2.5-benh tree, is disabled in the mainline,
even though the driver still exists. Is there a reason for this? The
attached patch re-enables the driver.

Regards, Jens.

diff -Nur kernel-source-2.6.6/arch/ppc/Kconfig linuxppc-2.5-benh/arch/ppc/Kconfig
--- kernel-source-2.6.6/arch/ppc/Kconfig 2004-04-05 11:49:23.000000000 +0200
+++ linuxppc-2.5-benh/arch/ppc/Kconfig 2004-03-29 08:34:26.000000000 +0200
@@ -1121,6 +1121,7 @@

source "lib/Kconfig"

+source "arch/ppc/oprofile/Kconfig"

menu "Kernel hacking"

diff -Nur kernel-source-2.6.6/arch/ppc/oprofile/Kconfig linuxppc-2.5-benh/arch/ppc/oprofile/Kconfig
--- kernel-source-2.6.6/arch/ppc/oprofile/Kconfig 1970-01-01 01:00:00.000000000 +0100
+++ linuxppc-2.5-benh/arch/ppc/oprofile/Kconfig 2003-12-31 03:50:43.000000000 +0100
@@ -0,0 +1,23 @@
+
+menu "Profiling support"
+ depends on EXPERIMENTAL
+
+config PROFILING
+ bool "Profiling support (EXPERIMENTAL)"
+ help
+ Say Y here to enable the extended profiling support mechanisms used
+ by profilers such as OProfile.
+
+
+config OPROFILE
+ tristate "OProfile system profiling (EXPERIMENTAL)"
+ depends on PROFILING
+ help
+ OProfile is a profiling system capable of profiling the
+ whole system, include the kernel, kernel modules, libraries,
+ and applications.
+
+ If unsure, say N.
+
+endmenu
+
diff -Nur kernel-source-2.6.6/arch/ppc/oprofile/Makefile linuxppc-2.5-benh/arch/ppc/oprofile/Makefile
--- kernel-source-2.6.6/arch/ppc/oprofile/Makefile 1970-01-01 01:00:00.000000000 +0100
+++ linuxppc-2.5-benh/arch/ppc/oprofile/Makefile 2003-12-31 03:50:44.000000000 +0100
@@ -0,0 +1,9 @@
+obj-$(CONFIG_OPROFILE) += oprofile.o
+
+DRIVER_OBJS := $(addprefix ../../../drivers/oprofile/, \
+ oprof.o cpu_buffer.o buffer_sync.o \
+ event_buffer.o oprofile_files.o \
+ oprofilefs.o oprofile_stats.o \
+ timer_int.o )
+
+oprofile-y := $(DRIVER_OBJS) init.o
diff -Nur kernel-source-2.6.6/arch/ppc/oprofile/init.c linuxppc-2.5-benh/arch/ppc/oprofile/init.c
--- kernel-source-2.6.6/arch/ppc/oprofile/init.c 1970-01-01 01:00:00.000000000 +0100
+++ linuxppc-2.5-benh/arch/ppc/oprofile/init.c 2003-12-31 03:50:45.000000000 +0100
@@ -0,0 +1,25 @@
+/**
+ * @file init.c
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon <levon@xxxxxxxxxxxxxxxxx>
+ */
+
+#include <linux/kernel.h>
+#include <linux/oprofile.h>
+#include <linux/init.h>
+#include <linux/errno.h>
+
+extern void timer_init(struct oprofile_operations ** ops);
+
+int __init oprofile_arch_init(struct oprofile_operations ** ops)
+{
+ return -ENODEV;
+}
+
+
+void oprofile_arch_exit(void)
+{
+}

--
J'qbpbe, le m'en fquz pe j'qbpbe!
Le veux aimeb et mqubib panz je pézqbpbe je djuz tqtaj!