diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2010-03-02 10:01:10 -0500 |
---|---|---|
committer | Robert Richter <robert.richter@amd.com> | 2010-03-02 11:03:20 -0500 |
commit | bc078e4eab65f11bbaeed380593ab8151b30d703 (patch) | |
tree | 8d61457355fad4e5b5938cd7c01a1dd379778789 /drivers/oprofile/oprof.c | |
parent | cfc9c0b450176a077205ef39092f0dc1a04e020a (diff) |
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) | |||
253 | int err; | 253 | int err; |
254 | 254 | ||
255 | err = oprofile_arch_init(&oprofile_ops); | 255 | err = oprofile_arch_init(&oprofile_ops); |
256 | |||
257 | if (err < 0 || timer) { | 256 | if (err < 0 || timer) { |
258 | printk(KERN_INFO "oprofile: using timer interrupt.\n"); | 257 | printk(KERN_INFO "oprofile: using timer interrupt.\n"); |
259 | oprofile_timer_init(&oprofile_ops); | 258 | err = oprofile_timer_init(&oprofile_ops); |
259 | if (err) | ||
260 | goto out_arch; | ||
260 | } | 261 | } |
261 | |||
262 | err = oprofilefs_register(); | 262 | err = oprofilefs_register(); |
263 | if (err) | 263 | if (err) |
264 | oprofile_arch_exit(); | 264 | goto out_arch; |
265 | return 0; | ||
265 | 266 | ||
267 | out_arch: | ||
268 | oprofile_arch_exit(); | ||
266 | return err; | 269 | return err; |
267 | } | 270 | } |
268 | 271 | ||
269 | 272 | ||
270 | static void __exit oprofile_exit(void) | 273 | static void __exit oprofile_exit(void) |
271 | { | 274 | { |
275 | oprofile_timer_exit(); | ||
272 | oprofilefs_unregister(); | 276 | oprofilefs_unregister(); |
273 | oprofile_arch_exit(); | 277 | oprofile_arch_exit(); |
274 | } | 278 | } |