Skip to contentSkip to conversation

OProfile for Cell: Initial profiling support

RFC PATCH New Maynard Johnson 1 participant 1 message Nov 10, 2006 PowerPC

lore
Share & tools
lore
#0 lore raw

RFC PATCH 2/2 OProfile for Cell: Initial profiling support

Add PPU event-based and cycle-based profiling support to Oprofile for Cell.

arch/powerpc/kernel/cputable.c +3 -0
Index: linux-2.6.18/arch/powerpc/kernel/cputable.c
===================================================================
@@ -287,6 +287,9 @@
 			PPC_FEATURE_SMT,
 		.icache_bsize		= 128,
 		.dcache_bsize		= 128,
+		.num_pmcs		= 4,
+		.oprofile_cpu_type	= "ppc64/cell-be",
+		.oprofile_type		= PPC_OPROFILE_CELL,
 		.platform		= "ppc-cell-be",
 	},
 	{	/* PA Semi PA6T */
arch/powerpc/oprofile/common.c +6 -0
Index: linux-2.6.18/arch/powerpc/oprofile/common.c
===================================================================
@@ -136,6 +136,11 @@
 
 	switch (cur_cpu_spec->oprofile_type) {
 #ifdef CONFIG_PPC64
+#ifdef CONFIG_PPC_CELL
+		case PPC_OPROFILE_CELL:
+			model = &op_model_cell;
+			break;
+#endif
 		case PPC_OPROFILE_RS64:
 			model = &op_model_rs64;
 			break;
@@ -147,6 +152,7 @@
 			model = &op_model_7450;
 			break;
 #endif
+
 #ifdef CONFIG_FSL_BOOKE
 		case PPC_OPROFILE_BOOKE:
 			model = &op_model_fsl_booke;
arch/powerpc/oprofile/Makefile +1 -0
Index: linux-2.6.18/arch/powerpc/oprofile/Makefile
===================================================================
@@ -11,6 +11,7 @@
 		timer_int.o )
 
 oprofile-y := $(DRIVER_OBJS) common.o backtrace.o
+oprofile-$(CONFIG_PPC_CELL) += op_model_cell.o
 oprofile-$(CONFIG_PPC64) += op_model_rs64.o op_model_power4.o
 oprofile-$(CONFIG_FSL_BOOKE) += op_model_fsl_booke.o
 oprofile-$(CONFIG_PPC32) += op_model_7450.o
arch/powerpc/oprofile/op_model_cell.c new file +628 -0

628 lines not on this page · raw message

include/asm-powerpc/cputable.h +1 -0
Index: linux-2.6.18/include/asm-powerpc/cputable.h
===================================================================
@@ -45,6 +45,7 @@
 	PPC_OPROFILE_POWER4 = 2,
 	PPC_OPROFILE_G4 = 3,
 	PPC_OPROFILE_BOOKE = 4,
+	PPC_OPROFILE_CELL = 5,
 };
 
 struct cpu_spec {
include/asm-powerpc/oprofile_impl.h +1 -0
Index: linux-2.6.18/include/asm-powerpc/oprofile_impl.h
===================================================================
@@ -54,6 +54,7 @@
 extern struct op_powerpc_model op_model_rs64;
 extern struct op_powerpc_model op_model_power4;
 extern struct op_powerpc_model op_model_7450;
+extern struct op_powerpc_model op_model_cell;
 
 #ifndef CONFIG_FSL_BOOKE
 
arch/powerpc/configs/cell_defconfig +2 -1
Index: linux-2.6.18/arch/powerpc/configs/cell_defconfig
===================================================================
@@ -1102,7 +1102,8 @@
 #
 # Instrumentation Support
 #
-# CONFIG_PROFILING is not set
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=y
 # CONFIG_KPROBES is not set
 
 #