4 * @remark Copyright 2002 OProfile authors
5 * @remark Read the file COPYING
7 * @author John Levon <levon@movementarian.org>
10 #include <linux/kernel.h>
11 #include <linux/notifier.h>
12 #include <linux/smp.h>
13 #include <linux/oprofile.h>
14 #include <linux/profile.h>
15 #include <linux/init.h>
16 #include <asm/ptrace.h>
20 static int timer_notify(struct pt_regs *regs)
22 oprofile_add_sample(regs, 0);
26 static int timer_start(void)
28 return register_timer_hook(timer_notify);
32 static void timer_stop(void)
34 unregister_timer_hook(timer_notify);
38 void __init oprofile_timer_init(struct oprofile_operations * ops)
40 ops->create_files = NULL;
43 ops->start = timer_start;
44 ops->stop = timer_stop;
45 ops->cpu_type = "timer";