aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/probe-finder.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/probe-finder.h')
-rw-r--r--tools/perf/util/probe-finder.h52
1 files changed, 24 insertions, 28 deletions
diff --git a/tools/perf/util/probe-finder.h b/tools/perf/util/probe-finder.h
index b2a25241135a..9dd4a884d0e6 100644
--- a/tools/perf/util/probe-finder.h
+++ b/tools/perf/util/probe-finder.h
@@ -1,6 +1,7 @@
1#ifndef _PROBE_FINDER_H 1#ifndef _PROBE_FINDER_H
2#define _PROBE_FINDER_H 2#define _PROBE_FINDER_H
3 3
4#include <stdbool.h>
4#include "util.h" 5#include "util.h"
5 6
6#define MAX_PATH_LEN 256 7#define MAX_PATH_LEN 256
@@ -46,53 +47,48 @@ struct line_range {
46 char *function; /* Function name */ 47 char *function; /* Function name */
47 unsigned int start; /* Start line number */ 48 unsigned int start; /* Start line number */
48 unsigned int end; /* End line number */ 49 unsigned int end; /* End line number */
49 unsigned int offset; /* Start line offset */ 50 int offset; /* Start line offset */
50 char *path; /* Real path name */ 51 char *path; /* Real path name */
51 struct list_head line_list; /* Visible lines */ 52 struct list_head line_list; /* Visible lines */
52}; 53};
53 54
54#ifndef NO_LIBDWARF 55#ifndef NO_DWARF_SUPPORT
55extern int find_probe_point(int fd, struct probe_point *pp); 56extern int find_probe_point(int fd, struct probe_point *pp);
56extern int find_line_range(int fd, struct line_range *lr); 57extern int find_line_range(int fd, struct line_range *lr);
57 58
58/* Workaround for undefined _MIPS_SZLONG bug in libdwarf.h: */
59#ifndef _MIPS_SZLONG
60# define _MIPS_SZLONG 0
61#endif
62
63#include <dwarf.h> 59#include <dwarf.h>
64#include <libdwarf.h> 60#include <libdw.h>
65 61
66struct probe_finder { 62struct probe_finder {
67 struct probe_point *pp; /* Target probe point */ 63 struct probe_point *pp; /* Target probe point */
68 64
69 /* For function searching */ 65 /* For function searching */
70 Dwarf_Addr addr; /* Address */ 66 Dwarf_Addr addr; /* Address */
71 Dwarf_Unsigned fno; /* File number */ 67 const char *fname; /* File name */
72 Dwarf_Unsigned lno; /* Line number */ 68 int lno; /* Line number */
73 Dwarf_Off inl_offs; /* Inline offset */ 69 void *origin; /* Inline origin addr */
74 Dwarf_Die cu_die; /* Current CU */ 70 Dwarf_Die cu_die; /* Current CU */
75 71
76 /* For variable searching */ 72 /* For variable searching */
77 Dwarf_Addr cu_base; /* Current CU base address */ 73 Dwarf_Op *fb_ops; /* Frame base attribute */
78 Dwarf_Locdesc fbloc; /* Location of Current Frame Base */ 74 Dwarf_Addr cu_base; /* Current CU base address */
79 const char *var; /* Current variable name */ 75 const char *var; /* Current variable name */
80 char *buf; /* Current output buffer */ 76 char *buf; /* Current output buffer */
81 int len; /* Length of output buffer */ 77 int len; /* Length of output buffer */
82}; 78};
83 79
84struct line_finder { 80struct line_finder {
85 struct line_range *lr; /* Target line range */ 81 struct line_range *lr; /* Target line range */
86 82
87 Dwarf_Unsigned fno; /* File number */ 83 const char *fname; /* File name */
88 Dwarf_Unsigned lno_s; /* Start line number */ 84 int lno_s; /* Start line number */
89 Dwarf_Unsigned lno_e; /* End line number */ 85 int lno_e; /* End line number */
90 Dwarf_Addr addr_s; /* Start address */ 86 Dwarf_Addr addr_s; /* Start address */
91 Dwarf_Addr addr_e; /* End address */ 87 Dwarf_Addr addr_e; /* End address */
92 Dwarf_Die cu_die; /* Current CU */ 88 Dwarf_Die cu_die; /* Current CU */
93 int found; 89 int found;
94}; 90};
95 91
96#endif /* NO_LIBDWARF */ 92#endif /* NO_DWARF_SUPPORT */
97 93
98#endif /*_PROBE_FINDER_H */ 94#endif /*_PROBE_FINDER_H */