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] Fix the conflicted for_each_cpu macro with 2.6.28-rc4


William Cohen wrote:
Wenji Huang wrote:
This patch will change for_each_cpu macro definition to avoid
name collusion in 2.6.28-rc4. See mainline commit:
cb56d98e2a7530615899597551db685d68a2e852.

---
 runtime/counter.c          |    4 ++--
 runtime/map-stat.c         |    4 ++--
 runtime/map.c              |   14 +++++++-------
 runtime/pmap-gen.c         |    6 +++---
 runtime/runtime.h          |   10 ++++++++--
 runtime/stat.c             |    6 +++---
 runtime/transport/procfs.c |    6 +++---
 7 files changed, 28 insertions(+), 22 deletions(-)

--- a/runtime/runtime.h
+++ b/runtime/runtime.h
@@ -39,8 +39,14 @@
 #define STP_OLD_TRANSPORT
 #endif

-#ifndef for_each_cpu
-#define for_each_cpu(cpu) for_each_cpu_mask((cpu), cpu_possible_map)
+#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)
+#endif
+#else
+#ifndef stp_for_each_cpu
+#define stp_for_each_cpu(cpu) for_each_cpu_mask((cpu), cpu_possible_map)
+#endif
#endif

I noticed this problem occurring with the i686 testing of the new systemtap rpm on f10. Looking through the git tree for the kernel I found when the change was checked in:


http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=15c8b6c1aaaf1c4edd67e2f02e4d8e1bd1a51c0d


It looks like this is older than a 2.6.28 change, May 9, 2008. This will also be in 2.6.27 kernels.


-Will
Thanks for your review.
The change happened on
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=cb56d98e2a7530615899597551db685d68a2e852
Nov 9, 2008, just several days ago. And I also checked the stable tree 2.6.27.x, for_each_cpu isn't defined there.


Regards,
Wenji


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