perf tools: Add ->unmap_ip operation to struct map
[deliverable/linux.git] / tools / perf / util / symbol.h
CommitLineData
8b40f521
JK
1#ifndef __PERF_SYMBOL
2#define __PERF_SYMBOL 1
a2928c42
ACM
3
4#include <linux/types.h>
7c6a1c65 5#include "types.h"
5da50258 6#include <linux/list.h>
43cbcd8a 7#include <linux/rbtree.h>
66e274f3 8#include "event.h"
a2928c42 9
247648e3
ACM
10#ifdef HAVE_CPLUS_DEMANGLE
11extern char *cplus_demangle(const char *, int);
12
13static inline char *bfd_demangle(void __used *v, const char *c, int i)
14{
15 return cplus_demangle(c, i);
16}
17#else
18#ifdef NO_DEMANGLE
19static inline char *bfd_demangle(void __used *v, const char __used *c,
20 int __used i)
21{
22 return NULL;
23}
24#else
25#include <bfd.h>
26#endif
27#endif
28
29#ifndef DMGL_PARAMS
30#define DMGL_PARAMS (1 << 0) /* Include function args */
31#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
32#endif
33
a2928c42
ACM
34struct symbol {
35 struct rb_node rb_node;
9cffa8d5
PM
36 u64 start;
37 u64 end;
9cffa8d5
PM
38 u64 hist_sum;
39 u64 *hist;
301406b9 40 void *priv;
a2928c42
ACM
41 char name[0];
42};
43
44struct dso {
45 struct list_head node;
46 struct rb_root syms;
9cffa8d5 47 struct symbol *(*find_symbol)(struct dso *, u64 ip);
f5812a7a 48 unsigned int sym_priv_size;
30d7a77d 49 unsigned char adjust_symbols;
52d422de 50 unsigned char slen_calculated;
94cb9e38 51 unsigned char origin;
439d473b
ACM
52 const char *short_name;
53 char *long_name;
a2928c42
ACM
54 char name[0];
55};
56
83a0944f 57extern const char *sym_hist_filter;
0b73da3f 58
439d473b 59typedef int (*symbol_filter_t)(struct map *map, struct symbol *sym);
69ee69f6 60
0085c954 61struct dso *dso__new(const char *name, unsigned int sym_priv_size);
a2928c42
ACM
62void dso__delete(struct dso *self);
63
0085c954
ACM
64static inline void *dso__sym_priv(struct dso *self, struct symbol *sym)
65{
66 return ((void *)sym) - self->sym_priv_size;
67}
68
9cffa8d5 69struct symbol *dso__find_symbol(struct dso *self, u64 ip);
a2928c42 70
439d473b
ACM
71int dsos__load_kernel(const char *vmlinux, unsigned int sym_priv_size,
72 symbol_filter_t filter, int verbose, int modules);
439d473b
ACM
73int dso__load(struct dso *self, struct map *map, symbol_filter_t filter,
74 int verbose);
cd84c2ac
FW
75struct dso *dsos__findnew(const char *name);
76void dsos__fprintf(FILE *fp);
a2928c42
ACM
77
78size_t dso__fprintf(struct dso *self, FILE *fp);
94cb9e38 79char dso__symtab_origin(const struct dso *self);
a2928c42 80
cd84c2ac
FW
81int load_kernel(void);
82
a2928c42 83void symbol__init(void);
cd84c2ac
FW
84
85extern struct list_head dsos;
439d473b 86extern struct map *kernel_map;
cd84c2ac 87extern struct dso *vdso;
83a0944f 88extern const char *vmlinux_name;
cd84c2ac 89extern int modules;
8b40f521 90#endif /* __PERF_SYMBOL */
This page took 0.048203 seconds and 5 git commands to generate.