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>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/oprofile.h>
+#include <linux/moduleparam.h>
#include <asm/semaphore.h>
#include "oprof.h"
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;
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;
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>");