1 #ifndef _PROBE_FINDER_H
2 #define _PROBE_FINDER_H
7 #define MAX_PATH_LEN 256
8 #define MAX_PROBE_BUFFER 1024
11 static inline int is_c_varname(const char *name
)
14 return isalpha(name
[0]) || name
[0] == '_';
18 char *event
; /* Event name */
19 char *group
; /* Event group */
22 char *file
; /* File name */
23 int line
; /* Line number */
24 char *lazy_line
; /* Lazy line pattern */
26 char *function
; /* Function name */
27 int offset
; /* Offset bytes */
29 int nr_args
; /* Number of arguments */
30 char **args
; /* Arguments */
32 int retprobe
; /* Return probe */
35 int found
; /* Number of found probe points */
36 char *probes
[MAX_PROBES
]; /* Output buffers (will be allocated)*/
39 /* Line number container */
41 struct list_head list
;
47 char *file
; /* File name */
48 char *function
; /* Function name */
49 unsigned int start
; /* Start line number */
50 unsigned int end
; /* End line number */
51 int offset
; /* Start line offset */
52 char *path
; /* Real path name */
53 struct list_head line_list
; /* Visible lines */
56 #ifndef NO_DWARF_SUPPORT
57 extern int find_probe_point(int fd
, struct probe_point
*pp
);
58 extern int find_line_range(int fd
, struct line_range
*lr
);
64 struct probe_point
*pp
; /* Target probe point */
66 /* For function searching */
67 Dwarf_Addr addr
; /* Address */
68 const char *fname
; /* File name */
69 int lno
; /* Line number */
70 Dwarf_Die cu_die
; /* Current CU */
72 /* For variable searching */
73 Dwarf_Op
*fb_ops
; /* Frame base attribute */
74 Dwarf_Addr cu_base
; /* Current CU base address */
75 const char *var
; /* Current variable name */
76 char *buf
; /* Current output buffer */
77 int len
; /* Length of output buffer */
78 struct list_head lcache
; /* Line cache for lazy match */
82 struct line_range
*lr
; /* Target line range */
84 const char *fname
; /* File name */
85 int lno_s
; /* Start line number */
86 int lno_e
; /* End line number */
87 Dwarf_Die cu_die
; /* Current CU */
91 #endif /* NO_DWARF_SUPPORT */
93 #endif /*_PROBE_FINDER_H */