aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/dso.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/dso.h')
-rw-r--r--tools/perf/util/dso.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
index ad553ba257bf..5e463c0964d4 100644
--- a/tools/perf/util/dso.h
+++ b/tools/perf/util/dso.h
@@ -5,6 +5,7 @@
5#include <linux/rbtree.h> 5#include <linux/rbtree.h>
6#include <stdbool.h> 6#include <stdbool.h>
7#include <linux/types.h> 7#include <linux/types.h>
8#include <linux/bitops.h>
8#include "map.h" 9#include "map.h"
9#include "build-id.h" 10#include "build-id.h"
10 11
@@ -40,6 +41,23 @@ enum dso_swap_type {
40 DSO_SWAP__YES, 41 DSO_SWAP__YES,
41}; 42};
42 43
44enum dso_data_status {
45 DSO_DATA_STATUS_ERROR = -1,
46 DSO_DATA_STATUS_UNKNOWN = 0,
47 DSO_DATA_STATUS_OK = 1,
48};
49
50enum dso_data_status_seen {
51 DSO_DATA_STATUS_SEEN_ITRACE,
52};
53
54enum dso_type {
55 DSO__TYPE_UNKNOWN,
56 DSO__TYPE_64BIT,
57 DSO__TYPE_32BIT,
58 DSO__TYPE_X32BIT,
59};
60
43#define DSO__SWAP(dso, type, val) \ 61#define DSO__SWAP(dso, type, val) \
44({ \ 62({ \
45 type ____r = val; \ 63 type ____r = val; \
@@ -90,6 +108,7 @@ struct dso {
90 u8 annotate_warned:1; 108 u8 annotate_warned:1;
91 u8 short_name_allocated:1; 109 u8 short_name_allocated:1;
92 u8 long_name_allocated:1; 110 u8 long_name_allocated:1;
111 u8 is_64_bit:1;
93 u8 sorted_by_name; 112 u8 sorted_by_name;
94 u8 loaded; 113 u8 loaded;
95 u8 rel; 114 u8 rel;
@@ -103,6 +122,8 @@ struct dso {
103 struct { 122 struct {
104 struct rb_root cache; 123 struct rb_root cache;
105 int fd; 124 int fd;
125 int status;
126 u32 status_seen;
106 size_t file_size; 127 size_t file_size;
107 struct list_head open_entry; 128 struct list_head open_entry;
108 } data; 129 } data;
@@ -153,6 +174,7 @@ int dso__read_binary_type_filename(const struct dso *dso, enum dso_binary_type t
153 * The dso__data_* external interface provides following functions: 174 * The dso__data_* external interface provides following functions:
154 * dso__data_fd 175 * dso__data_fd
155 * dso__data_close 176 * dso__data_close
177 * dso__data_size
156 * dso__data_read_offset 178 * dso__data_read_offset
157 * dso__data_read_addr 179 * dso__data_read_addr
158 * 180 *
@@ -190,11 +212,13 @@ int dso__read_binary_type_filename(const struct dso *dso, enum dso_binary_type t
190int dso__data_fd(struct dso *dso, struct machine *machine); 212int dso__data_fd(struct dso *dso, struct machine *machine);
191void dso__data_close(struct dso *dso); 213void dso__data_close(struct dso *dso);
192 214
215off_t dso__data_size(struct dso *dso, struct machine *machine);
193ssize_t dso__data_read_offset(struct dso *dso, struct machine *machine, 216ssize_t dso__data_read_offset(struct dso *dso, struct machine *machine,
194 u64 offset, u8 *data, ssize_t size); 217 u64 offset, u8 *data, ssize_t size);
195ssize_t dso__data_read_addr(struct dso *dso, struct map *map, 218ssize_t dso__data_read_addr(struct dso *dso, struct map *map,
196 struct machine *machine, u64 addr, 219 struct machine *machine, u64 addr,
197 u8 *data, ssize_t size); 220 u8 *data, ssize_t size);
221bool dso__data_status_seen(struct dso *dso, enum dso_data_status_seen by);
198 222
199struct map *dso__new_map(const char *name); 223struct map *dso__new_map(const char *name);
200struct dso *dso__kernel_findnew(struct machine *machine, const char *name, 224struct dso *dso__kernel_findnew(struct machine *machine, const char *name,
@@ -229,4 +253,6 @@ static inline bool dso__is_kcore(struct dso *dso)
229 253
230void dso__free_a2l(struct dso *dso); 254void dso__free_a2l(struct dso *dso);
231 255
256enum dso_type dso__type(struct dso *dso, struct machine *machine);
257
232#endif /* __PERF_DSO */ 258#endif /* __PERF_DSO */