mirror of
https://github.com/torvalds/linux.git
synced 2024-11-07 20:51:47 +00:00
9cffa8d533
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>
50 lines
1.1 KiB
C
50 lines
1.1 KiB
C
#ifndef _PERF_SYMBOL_
|
|
#define _PERF_SYMBOL_ 1
|
|
|
|
#include <linux/types.h>
|
|
#include "../types.h"
|
|
#include "list.h"
|
|
#include "rbtree.h"
|
|
|
|
struct symbol {
|
|
struct rb_node rb_node;
|
|
u64 start;
|
|
u64 end;
|
|
u64 obj_start;
|
|
u64 hist_sum;
|
|
u64 *hist;
|
|
void *priv;
|
|
char name[0];
|
|
};
|
|
|
|
struct dso {
|
|
struct list_head node;
|
|
struct rb_root syms;
|
|
unsigned int sym_priv_size;
|
|
struct symbol *(*find_symbol)(struct dso *, u64 ip);
|
|
char name[0];
|
|
};
|
|
|
|
const char *sym_hist_filter;
|
|
|
|
typedef int (*symbol_filter_t)(struct dso *self, struct symbol *sym);
|
|
|
|
struct dso *dso__new(const char *name, unsigned int sym_priv_size);
|
|
void dso__delete(struct dso *self);
|
|
|
|
static inline void *dso__sym_priv(struct dso *self, struct symbol *sym)
|
|
{
|
|
return ((void *)sym) - self->sym_priv_size;
|
|
}
|
|
|
|
struct symbol *dso__find_symbol(struct dso *self, u64 ip);
|
|
|
|
int dso__load_kernel(struct dso *self, const char *vmlinux,
|
|
symbol_filter_t filter, int verbose);
|
|
int dso__load(struct dso *self, symbol_filter_t filter, int verbose);
|
|
|
|
size_t dso__fprintf(struct dso *self, FILE *fp);
|
|
|
|
void symbol__init(void);
|
|
#endif /* _PERF_SYMBOL_ */
|