summaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authorSoren Sandmann <sandmann@daimi.au.dk>2006-12-09 06:29:43 +0000
committerSøren Sandmann Pedersen <ssp@src.gnome.org>2006-12-09 06:29:43 +0000
commitbd1f064ad3cd967c9f796104e7f8b92e0214e961 (patch)
treeb4eb98b0bfb4b07bff3f8f757384ea113328b816 /module
parent4ba672ee9f3a74c1c68ed7f372816d67e0f5eba2 (diff)
Add forgotten put_cpu_var(). Parse in chunks of 65536 to improve locality.
2006-12-09 Soren Sandmann <sandmann@daimi.au.dk> * module/sysprof-module.c: Add forgotten put_cpu_var(). * sfile.c (build_instructions): Parse in chunks of 65536 to improve locality.
Diffstat (limited to 'module')
-rw-r--r--module/Makefile2
-rw-r--r--module/sysprof-module.c7
2 files changed, 7 insertions, 2 deletions
diff --git a/module/Makefile b/module/Makefile
index f89c2e3..b87e2a1 100644
--- a/module/Makefile
+++ b/module/Makefile
@@ -10,7 +10,7 @@ PREFIX := /usr/local
endif
MODULE := sysprof-module
-KDIR := /lib/modules/$(shell uname -r)/build
+KDIR := /lib/modules/$(shell uname -r)/build # /home/ssp/linux-2.6.19/
INCLUDE := -isystem $(KDIR)/include
MODCFLAGS := -DMODULE -D__KERNEL__ -Wall ${INCLUDE}
diff --git a/module/sysprof-module.c b/module/sysprof-module.c
index 388f068..59b7910 100644
--- a/module/sysprof-module.c
+++ b/module/sysprof-module.c
@@ -126,8 +126,12 @@ timer_notify (struct pt_regs *regs)
#if 0
int stacksize;
#endif
+ int n;
- if (((++get_cpu_var(n_samples)) % INTERVAL) != 0)
+ n = ++get_cpu_var(n_samples);
+ put_cpu_var(n_samples);
+
+ if (n % INTERVAL != 0)
return 0;
/* 0: locked, 1: unlocked */
@@ -216,6 +220,7 @@ timer_notify (struct pt_regs *regs)
out:
atomic_inc(&in_timer_notify);
+
return 0;
}