summaryrefslogtreecommitdiffstats
path: root/drivers/oprofile/oprof.c
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2010-03-02 16:01:10 +0100
committerRobert Richter <robert.richter@amd.com>2010-03-02 17:03:20 +0100
commitbc078e4eab65f11bbaeed380593ab8151b30d703 (patch)
tree8d61457355fad4e5b5938cd7c01a1dd379778789 /drivers/oprofile/oprof.c
parentcfc9c0b450176a077205ef39092f0dc1a04e020a (diff)
downloadop-kernel-dev-bc078e4eab65f11bbaeed380593ab8151b30d703.zip
op-kernel-dev-bc078e4eab65f11bbaeed380593ab8151b30d703.tar.gz
oprofile: convert oprofile from timer_hook to hrtimer
Oprofile is currently broken on systems running with NOHZ enabled. A maximum of 1 tick is accounted via the timer_hook if a cpu sleeps for a longer period of time. This does bad things to the percentages in the profiler output. To solve this problem convert oprofile to use a restarting hrtimer instead of the timer_hook. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'drivers/oprofile/oprof.c')
-rw-r--r--drivers/oprofile/oprof.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/oprofile/oprof.c b/drivers/oprofile/oprof.c
index dc8a042..b336cd9 100644
--- a/drivers/oprofile/oprof.c
+++ b/drivers/oprofile/oprof.c
@@ -253,22 +253,26 @@ static int __init oprofile_init(void)
int err;
err = oprofile_arch_init(&oprofile_ops);
-
if (err < 0 || timer) {
printk(KERN_INFO "oprofile: using timer interrupt.\n");
- oprofile_timer_init(&oprofile_ops);
+ err = oprofile_timer_init(&oprofile_ops);
+ if (err)
+ goto out_arch;
}
-
err = oprofilefs_register();
if (err)
- oprofile_arch_exit();
+ goto out_arch;
+ return 0;
+out_arch:
+ oprofile_arch_exit();
return err;
}
static void __exit oprofile_exit(void)
{
+ oprofile_timer_exit();
oprofilefs_unregister();
oprofile_arch_exit();
}
OpenPOWER on IntegriCloud