perf probe: Fix to show which probe point is not found
[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>
e4204992 5#include <stdbool.h>
7c6a1c65 6#include "types.h"
5da50258 7#include <linux/list.h>
43cbcd8a 8#include <linux/rbtree.h>
66e274f3 9#include "event.h"
a2928c42 10
247648e3
ACM
11#ifdef HAVE_CPLUS_DEMANGLE
12extern char *cplus_demangle(const char *, int);
13
14static inline char *bfd_demangle(void __used *v, const char *c, int i)
15{
16 return cplus_demangle(c, i);
17}
18#else
19#ifdef NO_DEMANGLE
20static inline char *bfd_demangle(void __used *v, const char __used *c,
21 int __used i)
22{
23 return NULL;
24}
25#else
26#include <bfd.h>
27#endif
28#endif
29
84087126
MR
30/*
31 * libelf 0.8.x and earlier do not support ELF_C_READ_MMAP;
32 * for newer versions we can use mmap to reduce memory usage:
33 */
34#ifdef LIBELF_NO_MMAP
35# define PERF_ELF_C_READ_MMAP ELF_C_READ
36#else
37# define PERF_ELF_C_READ_MMAP ELF_C_READ_MMAP
38#endif
39
247648e3
ACM
40#ifndef DMGL_PARAMS
41#define DMGL_PARAMS (1 << 0) /* Include function args */
42#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
43#endif
44
a2928c42
ACM
45struct symbol {
46 struct rb_node rb_node;
9cffa8d5
PM
47 u64 start;
48 u64 end;
a2928c42
ACM
49 char name[0];
50};
51
b32d133a
ACM
52struct symbol_conf {
53 unsigned short priv_size;
54 bool try_vmlinux_path,
79406cd7
ACM
55 use_modules,
56 sort_by_name;
b32d133a
ACM
57 const char *vmlinux_name;
58};
59
00a192b3
ACM
60extern unsigned int symbol__priv_size;
61
62static inline void *symbol__priv(struct symbol *self)
63{
64 return ((void *)self) - symbol__priv_size;
65}
66
1ed091c4
ACM
67struct addr_location {
68 struct thread *thread;
69 struct map *map;
70 struct symbol *sym;
71 u64 addr;
72 char level;
73};
74
a2928c42
ACM
75struct dso {
76 struct list_head node;
6a4694a4 77 struct rb_root symbols[MAP__NR_TYPES];
79406cd7 78 struct rb_root symbol_names[MAP__NR_TYPES];
8d06367f
ACM
79 u8 adjust_symbols:1;
80 u8 slen_calculated:1;
8d06367f 81 u8 has_build_id:1;
c338aee8 82 u8 kernel:1;
94cb9e38 83 unsigned char origin;
79406cd7 84 u8 sorted_by_name;
3610583c 85 u8 loaded;
8d06367f 86 u8 build_id[BUILD_ID_SIZE];
cfc10d3b 87 u16 long_name_len;
439d473b
ACM
88 const char *short_name;
89 char *long_name;
a2928c42
ACM
90 char name[0];
91};
92
00a192b3 93struct dso *dso__new(const char *name);
a2928c42
ACM
94void dso__delete(struct dso *self);
95
3610583c 96bool dso__loaded(const struct dso *self, enum map_type type);
79406cd7
ACM
97bool dso__sorted_by_name(const struct dso *self, enum map_type type);
98
99void dso__sort_by_name(struct dso *self, enum map_type type);
3610583c 100
4aa65636
ACM
101struct perf_session;
102
00a192b3 103struct dso *dsos__findnew(const char *name);
4aa65636
ACM
104int dso__load(struct dso *self, struct map *map, struct perf_session *session,
105 symbol_filter_t filter);
cd84c2ac 106void dsos__fprintf(FILE *fp);
9e03eb2d 107size_t dsos__fprintf_buildid(FILE *fp);
a2928c42 108
9e03eb2d 109size_t dso__fprintf_buildid(struct dso *self, FILE *fp);
95011c60 110size_t dso__fprintf(struct dso *self, enum map_type type, FILE *fp);
94cb9e38 111char dso__symtab_origin(const struct dso *self);
8d06367f 112void dso__set_build_id(struct dso *self, void *build_id);
ea08d8cb 113struct symbol *dso__find_symbol(struct dso *self, enum map_type type, u64 addr);
79406cd7
ACM
114struct symbol *dso__find_symbol_by_name(struct dso *self, enum map_type type,
115 const char *name);
a2928c42 116
2643ce11 117int filename__read_build_id(const char *filename, void *bf, size_t size);
f1617b40 118int sysfs__read_build_id(const char *filename, void *bf, size_t size);
e30a3d12 119bool dsos__read_build_ids(void);
8d06367f 120int build_id__sprintf(u8 *self, int len, char *bf);
2643ce11 121
b32d133a 122int symbol__init(struct symbol_conf *conf);
4aa65636
ACM
123int perf_session__create_kernel_maps(struct perf_session *self,
124 struct symbol_conf *conf);
cd84c2ac 125
b0da954a 126extern struct list_head dsos__user, dsos__kernel;
cd84c2ac 127extern struct dso *vdso;
8b40f521 128#endif /* __PERF_SYMBOL */
This page took 0.059409 seconds and 5 git commands to generate.