public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Re: [PATCH] stp_for_each_cpu: use for_each_possible_cpu() on kernel >= 2.6.28
@ 2008-11-20 13:54 Wenji Huang
  0 siblings, 0 replies; 6+ messages in thread
From: Wenji Huang @ 2008-11-20 13:54 UTC (permalink / raw)
  To: ehabkost; +Cc: systemtap, srikar

It's my fault not to find the regression. Maybe we can adoptsrikar's suggestion to use for_each_cpu_mask always since there is no related code change from rc4 to now. Regards,Wenji

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] stp_for_each_cpu: use for_each_possible_cpu() on kernel  >= 2.6.28
  2008-11-19 14:04 Eduardo Habkost
  2008-11-19 14:44 ` Masami Hiramatsu
@ 2008-11-27  1:31 ` Wenji Huang
  1 sibling, 0 replies; 6+ messages in thread
From: Wenji Huang @ 2008-11-27  1:31 UTC (permalink / raw)
  To: Eduardo Habkost; +Cc: systemtap, Srikar Dronamraju

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] stp_for_each_cpu: use for_each_possible_cpu() on kernel  >= 2.6.28
  2008-11-19 15:26   ` Eduardo Habkost
@ 2008-11-19 17:54     ` Masami Hiramatsu
  0 siblings, 0 replies; 6+ messages in thread
From: Masami Hiramatsu @ 2008-11-19 17:54 UTC (permalink / raw)
  To: Eduardo Habkost; +Cc: systemtap

Eduardo Habkost wrote:
> 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.

Oh, in that case, it's ok for me.

Thank you,
-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] stp_for_each_cpu: use for_each_possible_cpu() on  kernel >= 2.6.28
  2008-11-19 14:44 ` Masami Hiramatsu
@ 2008-11-19 15:26   ` Eduardo Habkost
  2008-11-19 17:54     ` Masami Hiramatsu
  0 siblings, 1 reply; 6+ messages in thread
From: Eduardo Habkost @ 2008-11-19 15:26 UTC (permalink / raw)
  To: Masami Hiramatsu; +Cc: systemtap

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] stp_for_each_cpu: use for_each_possible_cpu() on kernel  >= 2.6.28
  2008-11-19 14:04 Eduardo Habkost
@ 2008-11-19 14:44 ` Masami Hiramatsu
  2008-11-19 15:26   ` Eduardo Habkost
  2008-11-27  1:31 ` Wenji Huang
  1 sibling, 1 reply; 6+ messages in thread
From: Masami Hiramatsu @ 2008-11-19 14:44 UTC (permalink / raw)
  To: Eduardo Habkost; +Cc: systemtap

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.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] stp_for_each_cpu: use for_each_possible_cpu() on kernel >= 2.6.28
@ 2008-11-19 14:04 Eduardo Habkost
  2008-11-19 14:44 ` Masami Hiramatsu
  2008-11-27  1:31 ` Wenji Huang
  0 siblings, 2 replies; 6+ messages in thread
From: Eduardo Habkost @ 2008-11-19 14:04 UTC (permalink / raw)
  To: systemtap; +Cc: Eduardo Habkost

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-11-27  1:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-20 13:54 [PATCH] stp_for_each_cpu: use for_each_possible_cpu() on kernel >= 2.6.28 Wenji Huang
  -- strict thread matches above, loose matches on Subject: below --
2008-11-19 14:04 Eduardo Habkost
2008-11-19 14:44 ` Masami Hiramatsu
2008-11-19 15:26   ` Eduardo Habkost
2008-11-19 17:54     ` Masami Hiramatsu
2008-11-27  1:31 ` Wenji Huang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).