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


Srikar Dronamraju wrote:
* Wenji Huang <wenji.huang@oracle.com> [2008-11-18 09:50:07]:

-#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

Why do we use for_each_cpu_mask always instead of using for_each_cpu if its defined. That would make the code more concise.

--
Srikar
Good point. Just worry if for_each_cpu_mask will be changed in the later kernel in terms of defined for_each_cpu.

Regards,
Wenji


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