diff options
Diffstat (limited to 'tools/perf/util/probe-finder.h')
-rw-r--r-- | tools/perf/util/probe-finder.h | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/tools/perf/util/probe-finder.h b/tools/perf/util/probe-finder.h index 605730a366d..1132c8f0ce8 100644 --- a/tools/perf/util/probe-finder.h +++ b/tools/perf/util/probe-finder.h | |||
@@ -16,33 +16,48 @@ static inline int is_c_varname(const char *name) | |||
16 | } | 16 | } |
17 | 17 | ||
18 | #ifdef DWARF_SUPPORT | 18 | #ifdef DWARF_SUPPORT |
19 | |||
20 | #include "dwarf-aux.h" | ||
21 | |||
22 | /* TODO: export debuginfo data structure even if no dwarf support */ | ||
23 | |||
24 | /* debug information structure */ | ||
25 | struct debuginfo { | ||
26 | Dwarf *dbg; | ||
27 | Dwfl *dwfl; | ||
28 | Dwarf_Addr bias; | ||
29 | }; | ||
30 | |||
31 | extern struct debuginfo *debuginfo__new(const char *path); | ||
32 | extern struct debuginfo *debuginfo__new_online_kernel(unsigned long addr); | ||
33 | extern void debuginfo__delete(struct debuginfo *self); | ||
34 | |||
19 | /* Find probe_trace_events specified by perf_probe_event from debuginfo */ | 35 | /* Find probe_trace_events specified by perf_probe_event from debuginfo */ |
20 | extern int find_probe_trace_events(int fd, struct perf_probe_event *pev, | 36 | extern int debuginfo__find_trace_events(struct debuginfo *self, |
21 | struct probe_trace_event **tevs, | 37 | struct perf_probe_event *pev, |
22 | int max_tevs); | 38 | struct probe_trace_event **tevs, |
39 | int max_tevs); | ||
23 | 40 | ||
24 | /* Find a perf_probe_point from debuginfo */ | 41 | /* Find a perf_probe_point from debuginfo */ |
25 | extern int find_perf_probe_point(unsigned long addr, | 42 | extern int debuginfo__find_probe_point(struct debuginfo *self, |
26 | struct perf_probe_point *ppt); | 43 | unsigned long addr, |
44 | struct perf_probe_point *ppt); | ||
27 | 45 | ||
28 | /* Find a line range */ | 46 | /* Find a line range */ |
29 | extern int find_line_range(int fd, struct line_range *lr); | 47 | extern int debuginfo__find_line_range(struct debuginfo *self, |
48 | struct line_range *lr); | ||
30 | 49 | ||
31 | /* Find available variables */ | 50 | /* Find available variables */ |
32 | extern int find_available_vars_at(int fd, struct perf_probe_event *pev, | 51 | extern int debuginfo__find_available_vars_at(struct debuginfo *self, |
33 | struct variable_list **vls, int max_points, | 52 | struct perf_probe_event *pev, |
34 | bool externs); | 53 | struct variable_list **vls, |
35 | 54 | int max_points, bool externs); | |
36 | #include <dwarf.h> | ||
37 | #include <elfutils/libdw.h> | ||
38 | #include <elfutils/libdwfl.h> | ||
39 | #include <elfutils/version.h> | ||
40 | 55 | ||
41 | struct probe_finder { | 56 | struct probe_finder { |
42 | struct perf_probe_event *pev; /* Target probe event */ | 57 | struct perf_probe_event *pev; /* Target probe event */ |
43 | 58 | ||
44 | /* Callback when a probe point is found */ | 59 | /* Callback when a probe point is found */ |
45 | int (*callback)(Dwarf_Die *sp_die, struct probe_finder *pf); | 60 | int (*callback)(Dwarf_Die *sc_die, struct probe_finder *pf); |
46 | 61 | ||
47 | /* For function searching */ | 62 | /* For function searching */ |
48 | int lno; /* Line number */ | 63 | int lno; /* Line number */ |