2009-09-03 08:25:20

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: tip tree build warnings

Hi all,

Today's linux-next build (powerpc ppc64_defconfig) produced these warning:

In file included from include/trace/ftrace.h:285,
from include/trace/define_trace.h:61,
from include/trace/events/timer.h:342,
from kernel/timer.c:50:
include/trace/events/timer.h: In function 'ftrace_raw_output_itimer_state':
include/trace/events/timer.h:280: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'cputime_t'
include/trace/events/timer.h: In function 'ftrace_raw_output_itimer_expire':
include/trace/events/timer.h:317: warning: format '%lu' expects type 'long unsigned int', but argument 5 has type 'cputime_t'

Introduced by commit 3f0a525ebf4b8ef041a332bbe4a73aee94bb064b ("timers: Add tracepoints for itimer") from the tip tree.

cputime_t is variously "u64", "unsigned long long" and "unsigned long" on
different architectures.

--
Cheers,
Stephen Rothwell [email protected]
http://www.canb.auug.org.au/~sfr/


Attachments:
(No filename) (0.99 kB)
(No filename) (197.00 B)
Download all attachments

2009-09-03 08:39:00

by Ingo Molnar

[permalink] [raw]
Subject: Re: linux-next: tip tree build warnings


* Stephen Rothwell <[email protected]> wrote:

> Hi all,
>
> Today's linux-next build (powerpc ppc64_defconfig) produced these warning:
>
> In file included from include/trace/ftrace.h:285,
> from include/trace/define_trace.h:61,
> from include/trace/events/timer.h:342,
> from kernel/timer.c:50:
> include/trace/events/timer.h: In function 'ftrace_raw_output_itimer_state':
> include/trace/events/timer.h:280: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'cputime_t'
> include/trace/events/timer.h: In function 'ftrace_raw_output_itimer_expire':
> include/trace/events/timer.h:317: warning: format '%lu' expects type 'long unsigned int', but argument 5 has type 'cputime_t'

Should be harmless with no runtime effects - the fix would be to
harmonize the cputime_t types across architectures.

> Introduced by commit 3f0a525ebf4b8ef041a332bbe4a73aee94bb064b ("timers: Add tracepoints for itimer") from the tip tree.
>
> cputime_t is variously "u64", "unsigned long long" and "unsigned
> long" on different architectures.

Should be unsigned long i think. Most architectures use it as
unsigned long via include/asm-generic/cputime.h, except these three:

arch/ia64/include/asm/cputime.h:typedef u64 cputime_t;
arch/powerpc/include/asm/cputime.h:typedef u64 cputime_t;
arch/s390/include/asm/cputime.h:typedef unsigned long long cputime_t;

Or we could eliminate the type altogether as well and standardize on
u64. Thomas?

Ingo

2009-09-03 12:13:33

by Heiko Carstens

[permalink] [raw]
Subject: Re: linux-next: tip tree build warnings

On Thu, Sep 03, 2009 at 10:38:44AM +0200, Ingo Molnar wrote:
> * Stephen Rothwell <[email protected]> wrote:
> > Today's linux-next build (powerpc ppc64_defconfig) produced these warning:
> >
> > In file included from include/trace/ftrace.h:285,
> > from include/trace/define_trace.h:61,
> > from include/trace/events/timer.h:342,
> > from kernel/timer.c:50:
> > include/trace/events/timer.h: In function 'ftrace_raw_output_itimer_state':
> > include/trace/events/timer.h:280: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'cputime_t'
> > include/trace/events/timer.h: In function 'ftrace_raw_output_itimer_expire':
> > include/trace/events/timer.h:317: warning: format '%lu' expects type 'long unsigned int', but argument 5 has type 'cputime_t'
>
> Should be harmless with no runtime effects - the fix would be to
> harmonize the cputime_t types across architectures.
>
> > Introduced by commit 3f0a525ebf4b8ef041a332bbe4a73aee94bb064b ("timers: Add tracepoints for itimer") from the tip tree.
> >
> > cputime_t is variously "u64", "unsigned long long" and "unsigned
> > long" on different architectures.
>
> Should be unsigned long i think. Most architectures use it as
> unsigned long via include/asm-generic/cputime.h, except these three:
>
> arch/ia64/include/asm/cputime.h:typedef u64 cputime_t;
> arch/powerpc/include/asm/cputime.h:typedef u64 cputime_t;
> arch/s390/include/asm/cputime.h:typedef unsigned long long cputime_t;
>
> Or we could eliminate the type altogether as well and standardize on
> u64. Thomas?

s390 uses 64 bit cputime_t because we want the high resolution also in
32 bit kernels. So standardizing on u64 would be the preferred solution
for us.

2009-09-03 12:24:46

by Heiko Carstens

[permalink] [raw]
Subject: Re: linux-next: tip tree build warnings

On Thu, Sep 03, 2009 at 02:13:26PM +0200, Heiko Carstens wrote:
> On Thu, Sep 03, 2009 at 10:38:44AM +0200, Ingo Molnar wrote:
> > * Stephen Rothwell <[email protected]> wrote:
> > > Today's linux-next build (powerpc ppc64_defconfig) produced these warning:
> > >
> > > In file included from include/trace/ftrace.h:285,
> > > from include/trace/define_trace.h:61,
> > > from include/trace/events/timer.h:342,
> > > from kernel/timer.c:50:
> > > include/trace/events/timer.h: In function 'ftrace_raw_output_itimer_state':
> > > include/trace/events/timer.h:280: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'cputime_t'
> > > include/trace/events/timer.h: In function 'ftrace_raw_output_itimer_expire':
> > > include/trace/events/timer.h:317: warning: format '%lu' expects type 'long unsigned int', but argument 5 has type 'cputime_t'
> >
> > Should be harmless with no runtime effects - the fix would be to
> > harmonize the cputime_t types across architectures.
> >
> > > Introduced by commit 3f0a525ebf4b8ef041a332bbe4a73aee94bb064b ("timers: Add tracepoints for itimer") from the tip tree.
> > >
> > > cputime_t is variously "u64", "unsigned long long" and "unsigned
> > > long" on different architectures.
> >
> > Should be unsigned long i think. Most architectures use it as
> > unsigned long via include/asm-generic/cputime.h, except these three:
> >
> > arch/ia64/include/asm/cputime.h:typedef u64 cputime_t;
> > arch/powerpc/include/asm/cputime.h:typedef u64 cputime_t;
> > arch/s390/include/asm/cputime.h:typedef unsigned long long cputime_t;
> >
> > Or we could eliminate the type altogether as well and standardize on
> > u64. Thomas?
>
> s390 uses 64 bit cputime_t because we want the high resolution also in
> 32 bit kernels. So standardizing on u64 would be the preferred solution
> for us.

Alternatively the tracepoints could simply use cputime_to_cputime64.
But that would be too easy I guess? ;)

2009-09-07 08:59:36

by Martin Schwidefsky

[permalink] [raw]
Subject: Re: linux-next: tip tree build warnings

On Thu, 3 Sep 2009 14:13:26 +0200
Heiko Carstens <[email protected]> wrote:

> On Thu, Sep 03, 2009 at 10:38:44AM +0200, Ingo Molnar wrote:
> > * Stephen Rothwell <[email protected]> wrote:
> > > cputime_t is variously "u64", "unsigned long long" and "unsigned
> > > long" on different architectures.
> >
> > Should be unsigned long i think. Most architectures use it as
> > unsigned long via include/asm-generic/cputime.h, except these three:
> >
> > arch/ia64/include/asm/cputime.h:typedef u64 cputime_t;
> > arch/powerpc/include/asm/cputime.h:typedef u64 cputime_t;
> > arch/s390/include/asm/cputime.h:typedef unsigned long long cputime_t;
> >
> > Or we could eliminate the type altogether as well and standardize on
> > u64. Thomas?
>
> s390 uses 64 bit cputime_t because we want the high resolution also in
> 32 bit kernels. So standardizing on u64 would be the preferred solution
> for us.

The cputime_t type serves/served two purposes: 1) make it clear that
this is NOT a jiffie value, it is an architecture defined type with
architecture dependent semantic, 2) by redefining cputime_t to a
structure with a single embedded unsigned long I have been able to
identify all places in the kernel that do not use the proper cputime
functions. I'm not sure if we need 2) anymore.

--
blue skies,
Martin.

"Reality continues to ruin my life." - Calvin.