aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/symbol.h
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/symbol.h
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/symbol.h')
-rw-r--r--tools/perf/util/symbol.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 5ad9b06c3f6f..ea332e56e458 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -2,16 +2,17 @@
2#define _PERF_SYMBOL_ 1 2#define _PERF_SYMBOL_ 1
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include "../types.h"
5#include "list.h" 6#include "list.h"
6#include "rbtree.h" 7#include "rbtree.h"
7 8
8struct symbol { 9struct symbol {
9 struct rb_node rb_node; 10 struct rb_node rb_node;
10 __u64 start; 11 u64 start;
11 __u64 end; 12 u64 end;
12 __u64 obj_start; 13 u64 obj_start;
13 __u64 hist_sum; 14 u64 hist_sum;
14 __u64 *hist; 15 u64 *hist;
15 void *priv; 16 void *priv;
16 char name[0]; 17 char name[0];
17}; 18};
@@ -20,7 +21,7 @@ struct dso {
20 struct list_head node; 21 struct list_head node;
21 struct rb_root syms; 22 struct rb_root syms;
22 unsigned int sym_priv_size; 23 unsigned int sym_priv_size;
23 struct symbol *(*find_symbol)(struct dso *, __u64 ip); 24 struct symbol *(*find_symbol)(struct dso *, u64 ip);
24 char name[0]; 25 char name[0];
25}; 26};
26 27
@@ -36,7 +37,7 @@ static inline void *dso__sym_priv(struct dso *self, struct symbol *sym)
36 return ((void *)sym) - self->sym_priv_size; 37 return ((void *)sym) - self->sym_priv_size;
37} 38}
38 39
39struct symbol *dso__find_symbol(struct dso *self, __u64 ip); 40struct symbol *dso__find_symbol(struct dso *self, u64 ip);
40 41
41int dso__load_kernel(struct dso *self, const char *vmlinux, 42int dso__load_kernel(struct dso *self, const char *vmlinux,
42 symbol_filter_t filter, int verbose); 43 symbol_filter_t filter, int verbose);