mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Banks <gnb@melbourne.sgi.com>
To: Andrew Morton <akpm@osdl.org>
Cc: OProfile List <oprofile-list@lists.sourceforge.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH 7/11] oprofile: update ppc for api changes
Date: Tue, 09 Nov 2004 21:40:10 +1100	[thread overview]
Message-ID: <1099996810.1985.793.camel@hole.melbourne.sgi.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 95 bytes --]


-- 
Greg Banks, R&D Software Engineer, SGI Australian Software Group.
I don't speak for SGI.


[-- Attachment #2: oprofile-callgraph-ppc64 --]
[-- Type: text/plain, Size: 4231 bytes --]

oprofile ppc64 arch updates, including some internal
API changes.

Signed-off-by: John Levon <levon@movementarian.org>
Signed-off-by: Greg Banks <gnb@melbourne.sgi.com>
---

 arch/ppc64/oprofile/common.c          |   33 +++++++++++++--------------------
 arch/ppc64/oprofile/op_model_power4.c |    3 +--
 arch/ppc64/oprofile/op_model_rs64.c   |    3 +--
 3 files changed, 15 insertions(+), 24 deletions(-)

Index: linux/arch/ppc64/oprofile/op_model_rs64.c
===================================================================
--- linux.orig/arch/ppc64/oprofile/op_model_rs64.c	2004-10-19 07:55:18.%N +1000
+++ linux/arch/ppc64/oprofile/op_model_rs64.c	2004-11-06 01:21:09.%N +1100
@@ -180,7 +180,6 @@ static void rs64_handle_interrupt(struct
 	int i;
 	unsigned long pc = mfspr(SPRN_SIAR);
 	int is_kernel = (pc >= KERNELBASE);
-	unsigned int cpu = smp_processor_id();
 
 	/* set the PMM bit (see comment below) */
 	mtmsrd(mfmsr() | MSR_PMM);
@@ -189,7 +188,7 @@ static void rs64_handle_interrupt(struct
 		val = ctr_read(i);
 		if (val < 0) {
 			if (ctr[i].enabled) {
-				oprofile_add_sample(pc, is_kernel, i, cpu);
+				oprofile_add_pc(pc, is_kernel, i);
 				ctr_write(i, reset_value[i]);
 			} else {
 				ctr_write(i, 0);
Index: linux/arch/ppc64/oprofile/common.c
===================================================================
--- linux.orig/arch/ppc64/oprofile/common.c	2004-11-06 01:11:47.%N +1100
+++ linux/arch/ppc64/oprofile/common.c	2004-11-06 01:21:09.%N +1100
@@ -125,16 +125,7 @@ static int op_ppc64_create_files(struct 
 	return 0;
 }
 
-static struct oprofile_operations oprof_ppc64_ops = {
-	.create_files	= op_ppc64_create_files,
-	.setup		= op_ppc64_setup,
-	.shutdown	= op_ppc64_shutdown,
-	.start		= op_ppc64_start,
-	.stop		= op_ppc64_stop,
-	.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)
 {
 	unsigned int pvr;
 
@@ -145,7 +136,7 @@ int __init oprofile_arch_init(struct opr
 		case PV_630p:
 			model = &op_model_rs64;
 			model->num_counters = 8;
-			oprof_ppc64_ops.cpu_type = "ppc64/power3";
+			ops->cpu_type = "ppc64/power3";
 			break;
 
 		case PV_NORTHSTAR:
@@ -154,40 +145,42 @@ int __init oprofile_arch_init(struct opr
 		case PV_SSTAR:
 			model = &op_model_rs64;
 			model->num_counters = 8;
-			oprof_ppc64_ops.cpu_type = "ppc64/rs64";
+			ops->cpu_type = "ppc64/rs64";
 			break;
 
 		case PV_POWER4:
 		case PV_POWER4p:
 			model = &op_model_power4;
 			model->num_counters = 8;
-			oprof_ppc64_ops.cpu_type = "ppc64/power4";
+			ops->cpu_type = "ppc64/power4";
 			break;
 
 		case PV_970:
 		case PV_970FX:
 			model = &op_model_power4;
 			model->num_counters = 8;
-			oprof_ppc64_ops.cpu_type = "ppc64/970";
+			ops->cpu_type = "ppc64/970";
 			break;
 
 		case PV_POWER5:
 		case PV_POWER5p:
 			model = &op_model_power4;
 			model->num_counters = 6;
-			oprof_ppc64_ops.cpu_type = "ppc64/power5";
+			ops->cpu_type = "ppc64/power5";
 			break;
 
 		default:
-			return -ENODEV;
+			return;
 	}
 
-	*ops = &oprof_ppc64_ops;
+	ops->create_files = op_ppc64_create_files;
+	ops->setup = op_ppc64_setup;
+	ops->shutdown = op_ppc64_shutdown;
+	ops->start = op_ppc64_start;
+	ops->stop = op_ppc64_stop;
 
 	printk(KERN_INFO "oprofile: using %s performance monitoring.\n",
-	       oprof_ppc64_ops.cpu_type);
-
-	return 0;
+	       ops->cpu_type);
 }
 
 void oprofile_arch_exit(void)
Index: linux/arch/ppc64/oprofile/op_model_power4.c
===================================================================
--- linux.orig/arch/ppc64/oprofile/op_model_power4.c	2004-11-06 01:11:47.%N +1100
+++ linux/arch/ppc64/oprofile/op_model_power4.c	2004-11-06 01:30:00.%N +1100
@@ -264,7 +264,6 @@ static void power4_handle_interrupt(stru
 	int is_kernel;
 	int val;
 	int i;
-	unsigned int cpu = smp_processor_id();
 	unsigned int mmcr0;
 
 	pc = get_pc(regs);
@@ -277,7 +276,7 @@ static void power4_handle_interrupt(stru
 		val = ctr_read(i);
 		if (val < 0) {
 			if (oprofile_running && ctr[i].enabled) {
-				oprofile_add_sample(pc, is_kernel, i, cpu);
+				oprofile_add_pc(pc, is_kernel, i);
 				ctr_write(i, reset_value[i]);
 			} else {
 				ctr_write(i, 0);

                 reply	other threads:[~2004-11-09 10:54 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=1099996810.1985.793.camel@hole.melbourne.sgi.com \
    --to=gnb@melbourne.sgi.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oprofile-list@lists.sourceforge.net \
    /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

all inboxes | Powered by JetHome®