2009-09-25 00:02:18 +08:00
|
|
|
#ifndef __PERF_SYMBOL
|
|
|
|
#define __PERF_SYMBOL 1
|
2009-05-29 01:55:04 +08:00
|
|
|
|
|
|
|
#include <linux/types.h>
|
2009-10-21 00:25:40 +08:00
|
|
|
#include <stdbool.h>
|
2009-06-25 23:05:54 +08:00
|
|
|
#include "types.h"
|
2009-07-02 01:46:08 +08:00
|
|
|
#include <linux/list.h>
|
2009-07-01 23:28:37 +08:00
|
|
|
#include <linux/rbtree.h>
|
2009-08-12 17:07:25 +08:00
|
|
|
#include "event.h"
|
2009-05-29 01:55:04 +08:00
|
|
|
|
2009-08-12 03:22:11 +08:00
|
|
|
#ifdef HAVE_CPLUS_DEMANGLE
|
|
|
|
extern char *cplus_demangle(const char *, int);
|
|
|
|
|
|
|
|
static inline char *bfd_demangle(void __used *v, const char *c, int i)
|
|
|
|
{
|
|
|
|
return cplus_demangle(c, i);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
#ifdef NO_DEMANGLE
|
|
|
|
static inline char *bfd_demangle(void __used *v, const char __used *c,
|
|
|
|
int __used i)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
#include <bfd.h>
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef DMGL_PARAMS
|
|
|
|
#define DMGL_PARAMS (1 << 0) /* Include function args */
|
|
|
|
#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
|
|
|
|
#endif
|
|
|
|
|
2009-05-29 01:55:04 +08:00
|
|
|
struct symbol {
|
|
|
|
struct rb_node rb_node;
|
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>
2009-06-19 20:21:42 +08:00
|
|
|
u64 start;
|
|
|
|
u64 end;
|
2009-05-29 01:55:04 +08:00
|
|
|
char name[0];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct dso {
|
|
|
|
struct list_head node;
|
|
|
|
struct rb_root syms;
|
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>
2009-06-19 20:21:42 +08:00
|
|
|
struct symbol *(*find_symbol)(struct dso *, u64 ip);
|
2009-06-30 22:43:17 +08:00
|
|
|
unsigned int sym_priv_size;
|
2009-07-03 08:24:14 +08:00
|
|
|
unsigned char adjust_symbols;
|
2009-07-11 09:47:28 +08:00
|
|
|
unsigned char slen_calculated;
|
2009-10-29 07:51:21 +08:00
|
|
|
bool loaded;
|
2009-08-07 01:43:17 +08:00
|
|
|
unsigned char origin;
|
2009-10-02 14:29:58 +08:00
|
|
|
const char *short_name;
|
|
|
|
char *long_name;
|
2009-05-29 01:55:04 +08:00
|
|
|
char name[0];
|
|
|
|
};
|
|
|
|
|
2009-05-29 01:55:13 +08:00
|
|
|
struct dso *dso__new(const char *name, unsigned int sym_priv_size);
|
2009-05-29 01:55:04 +08:00
|
|
|
void dso__delete(struct dso *self);
|
|
|
|
|
2009-05-29 01:55:13 +08:00
|
|
|
static inline void *dso__sym_priv(struct dso *self, struct symbol *sym)
|
|
|
|
{
|
|
|
|
return ((void *)sym) - self->sym_priv_size;
|
|
|
|
}
|
|
|
|
|
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>
2009-06-19 20:21:42 +08:00
|
|
|
struct symbol *dso__find_symbol(struct dso *self, u64 ip);
|
2009-05-29 01:55:04 +08:00
|
|
|
|
2009-10-02 14:29:58 +08:00
|
|
|
int dsos__load_kernel(const char *vmlinux, unsigned int sym_priv_size,
|
2009-10-22 03:34:06 +08:00
|
|
|
symbol_filter_t filter, int modules);
|
2009-10-29 07:51:21 +08:00
|
|
|
struct dso *dsos__findnew(const char *name, unsigned int sym_priv_size);
|
2009-10-22 03:34:06 +08:00
|
|
|
int dso__load(struct dso *self, struct map *map, symbol_filter_t filter);
|
2009-08-12 16:03:49 +08:00
|
|
|
void dsos__fprintf(FILE *fp);
|
2009-05-29 01:55:04 +08:00
|
|
|
|
|
|
|
size_t dso__fprintf(struct dso *self, FILE *fp);
|
2009-08-07 01:43:17 +08:00
|
|
|
char dso__symtab_origin(const struct dso *self);
|
2009-05-29 01:55:04 +08:00
|
|
|
|
2009-10-21 00:25:40 +08:00
|
|
|
int load_kernel(unsigned int sym_priv_size, symbol_filter_t filter);
|
2009-08-12 16:03:49 +08:00
|
|
|
|
2009-05-29 01:55:04 +08:00
|
|
|
void symbol__init(void);
|
2009-08-12 16:03:49 +08:00
|
|
|
|
|
|
|
extern struct list_head dsos;
|
2009-10-02 14:29:58 +08:00
|
|
|
extern struct map *kernel_map;
|
2009-08-12 16:03:49 +08:00
|
|
|
extern struct dso *vdso;
|
2009-08-15 18:26:57 +08:00
|
|
|
extern const char *vmlinux_name;
|
2009-08-12 16:03:49 +08:00
|
|
|
extern int modules;
|
2009-09-25 00:02:18 +08:00
|
|
|
#endif /* __PERF_SYMBOL */
|