OSDN Git Service

perf_counter tools: Define and use our own u64, s64 etc. definitions
authorPaul Mackerras <paulus@samba.org>
Fri, 19 Jun 2009 12:21:42 +0000 (22:21 +1000)
committerIngo Molnar <mingo@elte.hu>
Fri, 19 Jun 2009 16:25:47 +0000 (18:25 +0200)
commit9cffa8d53335d891cc0ecb3824a67118b3ee4b2f
tree420e0f96198f0e78aedd006280826b8cf0839820
parentb49a9e7e72103ea91946453c19703a4dfa1994fe
perf_counter tools: Define and use our own u64, s64 etc. definitions

On 64-bit powerpc, __u64 is defined to be unsigned long rather than
unsigned long long.  This causes compiler warnings every time we
print a __u64 value with %Lx.

Rather than changing __u64, we define our own u64 to be unsigned long
long on all architectures, and similarly s64 as signed long long.
For consistency we also define u32, s32, u16, s16, u8 and s8.  These
definitions are put in a new header, types.h, because these definitions
are needed in util/string.h and util/symbol.h.

The main change here is the mechanical change of __[us]{64,32,16,8}
to remove the "__".  The other changes are:

* Create types.h
* Include types.h in perf.h, util/string.h and util/symbol.h
* Add types.h to the LIB_H definition in Makefile
* Added (u64) casts in process_overflow_event() and print_sym_table()
  to kill two remaining warnings.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: benh@kernel.crashing.org
LKML-Reference: <19003.33494.495844.956580@cargo.ozlabs.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
13 files changed:
tools/perf/Makefile
tools/perf/builtin-annotate.c
tools/perf/builtin-record.c
tools/perf/builtin-report.c
tools/perf/builtin-stat.c
tools/perf/builtin-top.c
tools/perf/perf.h
tools/perf/types.h [new file with mode: 0644]
tools/perf/util/parse-events.c
tools/perf/util/string.c
tools/perf/util/string.h
tools/perf/util/symbol.c
tools/perf/util/symbol.h