diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2010-03-02 18:01:10 +0300 |
---|---|---|
committer | Robert Richter <robert.richter@amd.com> | 2010-03-02 19:03:20 +0300 |
commit | bc078e4eab65f11bbaeed380593ab8151b30d703 (patch) | |
tree | 8d61457355fad4e5b5938cd7c01a1dd379778789 /drivers/oprofile/oprof.c | |
parent | cfc9c0b450176a077205ef39092f0dc1a04e020a (diff) | |
download | linux-bc078e4eab65f11bbaeed380593ab8151b30d703.tar.xz |
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.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/oprofile/oprof.c b/drivers/oprofile/oprof.c index dc8a0428260d..b336cd9ee7a1 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(); } |