1 #ifndef _PROBE_FINDER_H
2 #define _PROBE_FINDER_H
6 #include "probe-event.h"
8 #define MAX_PATH_LEN 256
9 #define MAX_PROBE_BUFFER 1024
10 #define MAX_PROBES 128
12 static inline int is_c_varname(const char *name)
15 return isalpha(name[0]) || name[0] == '_';
19 /* Find kprobe_trace_events specified by perf_probe_event from debuginfo */
20 extern int find_kprobe_trace_events(int fd, struct perf_probe_event *pev,
21 struct kprobe_trace_event **tevs,
24 /* Find a perf_probe_point from debuginfo */
25 extern int find_perf_probe_point(int fd, unsigned long addr,
26 struct perf_probe_point *ppt);
28 extern int find_line_range(int fd, struct line_range *lr);
34 struct perf_probe_event *pev; /* Target probe event */
35 struct kprobe_trace_event *tevs; /* Result trace events */
36 int ntevs; /* Number of trace events */
37 int max_tevs; /* Max number of trace events */
39 /* For function searching */
40 int lno; /* Line number */
41 Dwarf_Addr addr; /* Address */
42 const char *fname; /* Real file name */
43 Dwarf_Die cu_die; /* Current CU */
44 struct list_head lcache; /* Line cache for lazy match */
46 /* For variable searching */
47 Dwarf_CFI *cfi; /* Call Frame Information */
48 Dwarf_Op *fb_ops; /* Frame base attribute */
49 struct perf_probe_arg *pvar; /* Current target variable */
50 struct kprobe_trace_arg *tvar; /* Current result variable */
54 struct line_range *lr; /* Target line range */
56 const char *fname; /* File name */
57 int lno_s; /* Start line number */
58 int lno_e; /* End line number */
59 Dwarf_Die cu_die; /* Current CU */
63 #endif /* DWARF_SUPPORT */
65 #endif /*_PROBE_FINDER_H */