Re: [tip:perfcounters/core] perf_counter tools: Introduce stricterC code checking

From: Ingo Molnar
Date: Thu May 28 2009 - 04:36:15 EST



* Paul Mackerras <paulus@xxxxxxxxx> wrote:

> tip-bot for Ingo Molnar writes:
>
> > perf_counter tools: Introduce stricter C code checking
> >
> > Tighten up our C code requirements:
> >
> > - disallow warnings
>
> This causes failures when I compile it as a 64-bit executable on
> powerpc:
>
> CC builtin-record.o
> builtin-record.c: In function 'pid_synthesize_mmap_events':
> builtin-record.c:241: warning: format '%llx' expects type 'long long unsigned int *', but argument 3 has type '__u64 *'
> builtin-record.c:241: warning: format '%llx' expects type 'long long unsigned int *', but argument 4 has type '__u64 *'
> builtin-record.c:241: warning: format '%llx' expects type 'long long unsigned int *', but argument 9 has type '__u64 *'
>
> This is because u64 is an unsigned long in userspace for a 64-bit
> build, not unsigned long long. I'm not sure how best to solve
> this problem.

We could perhaps use __u64 consistently? (can we?)

> If I compile it as a 32-bit executable, it doesn't generate warnings,
> but when I try to run "perf top" (this is on a 64-bit kernel, of
> course, since 32-bit powerpc kernels don't currently support
> perf_counters), I get:
>
> # perf top
> left: 0000000000000000
> ip: 00000000000891a4
> right: 00000000ffffffff
> KernelTop refresh period: 2 seconds
> perf: builtin-top.c:453: record_ip: Assertion `left <= ip && ip <= right' failed.
> Aborted

mind trying a 'git bisect run' session - which commit broke things
for you? Or is this related to the type problems?

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/