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


On Wed, Nov 19, 2008 at 09:42:30AM -0500, Masami Hiramatsu wrote:
> Hi Eduardo,
>
> I think you'd better add new autoconf-foreachcpu.c for checking existence of
> for_each_cpu_possible() macro, instead of checking KERNEL_VERSION.

Why? for_each_cpu_possible() exists since 2.6.17. The original
for_each_cpu() fix didn't use an autoconf-*.c check.


>
> Thank you,
>
> 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
>
> -- 
> Masami Hiramatsu
>
> Software Engineer
> Hitachi Computer Products (America) Inc.
> Software Solutions Division
>
> e-mail: mhiramat@redhat.com
>
>

-- 
Eduardo


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