public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: John Levon <levon@movementarian.org>
To: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: [PATCH 3/5] OProfile update
Date: Mon, 26 May 2003 05:27:30 +0100	[thread overview]
Message-ID: <10539232501791@movementarian.org> (raw)
In-Reply-To: <10539232492885@movementarian.org>


A patch mostly by Will Cohen, adding a parameter to OProfile to
over-ride use of the perfctr hardware. Useful for testing and
a host of other things.

diff -Naur -X dontdiff linux-cvs/Documentation/kernel-parameters.txt linux-me/Documentation/kernel-parameters.txt
--- linux-cvs/Documentation/kernel-parameters.txt	2003-03-30 21:12:29.000000000 +0100
+++ linux-me/Documentation/kernel-parameters.txt	2003-05-26 04:53:57.000000000 +0100
@@ -652,6 +652,9 @@
 	opl3sa2=	[HW,OSS]
 			Format: <io>,<irq>,<dma>,<dma2>,<mss_io>,<mpu_io>,<ymode>,<loopback>[,<isapnp>,<multiple]
  
+	oprofile.timer=	[HW]
+			Use timer interrupt instead of performance counters
+
 	optcd=		[HW,CD]
 			Format: <io>
 
diff -Naur -X dontdiff linux-cvs/drivers/oprofile/oprof.c linux-me/drivers/oprofile/oprof.c
--- linux-cvs/drivers/oprofile/oprof.c	2003-05-10 17:30:28.000000000 +0100
+++ linux-me/drivers/oprofile/oprof.c	2003-05-26 04:52:51.000000000 +0100
@@ -11,6 +11,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/oprofile.h>
+#include <linux/moduleparam.h>
 #include <asm/semaphore.h>
 
 #include "oprof.h"
@@ -24,6 +25,12 @@
 static unsigned long is_setup;
 static DECLARE_MUTEX(start_sem);
 
+/* timer
+   0 - use performance monitoring hardware if available
+   1 - use the timer int mechanism regardless
+ */
+static int timer = 0;
+
 int oprofile_setup(void)
 {
 	int err;
@@ -124,13 +131,16 @@
 
 static int __init oprofile_init(void)
 {
-	int err;
+	int err = -ENODEV;
+
+	if (!timer) {
+		/* Architecture must fill in the interrupt ops and the
+		 * logical CPU type, or we can fall back to the timer
+		 * interrupt profiler.
+		 */
+		err = oprofile_arch_init(&oprofile_ops);
+	}
 
-	/* Architecture must fill in the interrupt ops and the
-	 * logical CPU type, or we can fall back to the timer
-	 * interrupt profiler.
-	 */
-	err = oprofile_arch_init(&oprofile_ops);
 	if (err == -ENODEV) {
 		timer_init(&oprofile_ops);
 		err = 0;
@@ -163,6 +173,9 @@
  
 module_init(oprofile_init);
 module_exit(oprofile_exit);
+
+module_param_named(timer, timer, int, 0644);
+MODULE_PARM_DESC(timer, "force use of timer interrupt");
  
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("John Levon <levon@movementarian.org>");


  reply	other threads:[~2003-05-26  4:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-26  4:27 [PATCH 1/5] OProfile update John Levon
2003-05-26  4:27 ` [PATCH 2/5] " John Levon
2003-05-26  4:27   ` John Levon [this message]
2003-05-26  4:27     ` [PATCH 4/5] " John Levon
2003-05-26  4:27       ` [PATCH 5/5] " John Levon

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=10539232501791@movementarian.org \
    --to=levon@movementarian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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