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

From: Paul Mackerras
Date: Thu May 28 2009 - 00:06:48 EST


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.

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

Paul.
--
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/