Tue Oct 11 22:40:24 2005 Soeren Sandmann <sandmann@redhat.com>
* module/sysprof-module.c (SAMPLES_PER_SECOND): Add back these
constants, but this time make sure we won't divide by 0 or
anything like that.
+Tue Oct 11 22:40:24 2005 Soeren Sandmann <sandmann@redhat.com>
+
+ * module/sysprof-module.c (SAMPLES_PER_SECOND): Add back these
+ constants, but this time make sure we won't divide by 0 or
+ anything like that.
+
Mon Oct 10 22:49:03 2005 Soeren Sandmann <sandmann@redhat.com>
* module/sysprof-module.c: Delete lots of commented-out code.
# error Sysprof only supports the i386 and x86-64 architectures
#endif
+#define SAMPLES_PER_SECOND 250
+#define INTERVAL ((HZ <= SAMPLES_PER_SECOND)? 1 : (HZ / SAMPLES_PER_SECOND))
+
typedef struct userspace_reader userspace_reader;
struct userspace_reader
{
}
#endif /* CONFIG_X86_4G */
-static int
-timer_notify (struct pt_regs *regs)
+static int timer_notify (struct pt_regs *regs)
{
#ifdef CONFIG_HIGHMEM
# define START_OF_STACK 0xFF000000
int i;
int is_user;
+ if ((++n_samples % INTERVAL) != 0)
+ return 0;
+
is_user = user_mode(regs);
if (!current || current->pid == 0 || !current->mm)