aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/parse-events.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2009-06-19 08:21:42 -0400
committerIngo Molnar <mingo@elte.hu>2009-06-19 12:25:47 -0400
commit9cffa8d53335d891cc0ecb3824a67118b3ee4b2f (patch)
tree420e0f96198f0e78aedd006280826b8cf0839820 /tools/perf/util/parse-events.c
parentb49a9e7e72103ea91946453c19703a4dfa1994fe (diff)
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>
Diffstat (limited to 'tools/perf/util/parse-events.c')
-rw-r--r--tools/perf/util/parse-events.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index f0c9f2627fe1..35d04da38d6a 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -13,8 +13,8 @@ int nr_counters;
13struct perf_counter_attr attrs[MAX_COUNTERS]; 13struct perf_counter_attr attrs[MAX_COUNTERS];
14 14
15struct event_symbol { 15struct event_symbol {
16 __u8 type; 16 u8 type;
17 __u64 config; 17 u64 config;
18 char *symbol; 18 char *symbol;
19}; 19};
20 20
@@ -96,7 +96,7 @@ static char *hw_cache_result [][MAX_ALIASES] = {
96 96
97char *event_name(int counter) 97char *event_name(int counter)
98{ 98{
99 __u64 config = attrs[counter].config; 99 u64 config = attrs[counter].config;
100 int type = attrs[counter].type; 100 int type = attrs[counter].type;
101 static char buf[32]; 101 static char buf[32];
102 102
@@ -112,7 +112,7 @@ char *event_name(int counter)
112 return "unknown-hardware"; 112 return "unknown-hardware";
113 113
114 case PERF_TYPE_HW_CACHE: { 114 case PERF_TYPE_HW_CACHE: {
115 __u8 cache_type, cache_op, cache_result; 115 u8 cache_type, cache_op, cache_result;
116 static char name[100]; 116 static char name[100];
117 117
118 cache_type = (config >> 0) & 0xff; 118 cache_type = (config >> 0) & 0xff;
@@ -202,7 +202,7 @@ static int parse_generic_hw_symbols(const char *str, struct perf_counter_attr *a
202 */ 202 */
203static int parse_event_symbols(const char *str, struct perf_counter_attr *attr) 203static int parse_event_symbols(const char *str, struct perf_counter_attr *attr)
204{ 204{
205 __u64 config, id; 205 u64 config, id;
206 int type; 206 int type;
207 unsigned int i; 207 unsigned int i;
208 const char *sep, *pstr; 208 const char *sep, *pstr;