This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[PATCH] stp_for_each_cpu: use for_each_possible_cpu() on kernel >= 2.6.28
- From: Eduardo Habkost <ehabkost at redhat dot com>
- To: systemtap at sourceware dot org
- Cc: Eduardo Habkost <ehabkost at redhat dot com>
- Date: Wed, 19 Nov 2008 12:03:32 -0200
- Subject: [PATCH] stp_for_each_cpu: use for_each_possible_cpu() on kernel >= 2.6.28
It looks like for_each_cpu() interface has changed again on tip.git,
breaking stp_for_each_cpu.
The error I get when compiling a stap module here is:
/usr/local/share/systemtap/runtime/stat.c: In function â_stp_stat_getâ:
/usr/local/share/systemtap/runtime/stat.c:213: error: incompatible type for argument 2 of âcpumask_nextâ
Using for_each_possible_cpu() should be equivalent to
for_each_cpu(cpu, cpu_possible_map), but its interface didn't change
like for_each_cpu() did.
I kept the 2.6.28 #ifdef just in case, but for_each_possible_cpu()
should work even on older kernels.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
runtime/runtime.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/runtime/runtime.h b/runtime/runtime.h
index 7507e59..90113b6 100644
--- a/runtime/runtime.h
+++ b/runtime/runtime.h
@@ -41,7 +41,7 @@
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
#ifndef stp_for_each_cpu
-#define stp_for_each_cpu(cpu) for_each_cpu((cpu), cpu_possible_map)
+#define stp_for_each_cpu(cpu) for_each_possible_cpu((cpu))
#endif
#else
#ifndef stp_for_each_cpu
--
1.5.5.GIT