This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] stp_for_each_cpu: use for_each_possible_cpu() on kernel >= 2.6.28


Eduardo Habkost wrote:
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
It's my fault not to find the regression. I guess maybe we can adopt
srikar's suggestion to use for_each_cpu_mask always since there is no
related code change from rc4 to rc5.


Regards, Wenji


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]