linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Andrew Morton <akpm@osdl.org>
Cc: linuxppc-dev list <linuxppc-dev@ozlabs.org>,
	Linus Torvalds <torvalds@osdl.org>
Subject: [PATCH] ppc32: Fix pmac kernel build with oprofile
Date: Mon, 17 Jan 2005 17:34:25 +1100	[thread overview]
Message-ID: <1105943665.4534.4.camel@gaston> (raw)

Hi !

The recent oprofile changes for Motorola e500 broke oprofile for other
CPUs. This patch fixes the build.

Proper support for the G3/G4 PMCs would be interesting, and making sure the basic
interrupt PC sampling still works on CPUs that don't have supported PMCs too...

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Index: linux-work/arch/ppc/oprofile/Makefile
===================================================================
--- linux-work.orig/arch/ppc/oprofile/Makefile	2005-01-17 14:07:24.000000000 +1100
+++ linux-work/arch/ppc/oprofile/Makefile	2005-01-17 14:08:51.000000000 +1100
@@ -6,4 +6,9 @@
 		oprofilefs.o oprofile_stats.o \
 		timer_int.o )
 
-oprofile-y := $(DRIVER_OBJS) common.o op_model_fsl_booke.o
+oprofile-y := $(DRIVER_OBJS) common.o
+
+ifeq ($(CONFIG_FSL_BOOKE),y)
+	oprofile-y += op_model_fsl_booke.o
+endif
+
Index: linux-work/arch/ppc/oprofile/common.c
===================================================================
--- linux-work.orig/arch/ppc/oprofile/common.c	2005-01-14 12:01:04.000000000 +1100
+++ linux-work/arch/ppc/oprofile/common.c	2005-01-17 14:30:14.000000000 +1100
@@ -124,7 +124,7 @@
 	.cpu_type	= NULL		/* To be filled in below. */
 };
 
-int __init oprofile_arch_init(struct oprofile_operations **ops)
+void __init oprofile_arch_init(struct oprofile_operations *ops)
 {
 	char *name;
 	int cpu_id = smp_processor_id();
@@ -133,13 +133,13 @@
 	model = &op_model_fsl_booke;
 #else
 	printk(KERN_ERR "oprofile enabled on unsupported processor!\n");
-	return -ENODEV;
+	return;
 #endif
 
 	name = kmalloc(32, GFP_KERNEL);
 
 	if (NULL == name)
-		return -ENOMEM;
+		return;
 
 	sprintf(name, "ppc/%s", cur_cpu_spec[cpu_id]->cpu_name);
 
@@ -147,12 +147,10 @@
 
 	model->num_counters = cur_cpu_spec[cpu_id]->num_pmcs;
 
-	*ops = &oprof_ppc32_ops;
+	*ops = oprof_ppc32_ops;
 
 	printk(KERN_INFO "oprofile: using %s performance monitoring.\n",
 	       oprof_ppc32_ops.cpu_type);
-
-	return 0;
 }
 
 void oprofile_arch_exit(void)

                 reply	other threads:[~2005-01-17  6:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1105943665.4534.4.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=akpm@osdl.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).