1#ifndef _PROBE_EVENT_H
2#define _PROBE_EVENT_H
3
4#include <stdbool.h>
5#include "strlist.h"
6#include "strfilter.h"
7
8extern bool probe_event_dry_run;
9
10
11struct probe_trace_point {
12 char *symbol;
13 char *module;
14 unsigned long offset;
15 bool retprobe;
16};
17
18
19struct probe_trace_arg_ref {
20 struct probe_trace_arg_ref *next;
21 long offset;
22};
23
24
25struct probe_trace_arg {
26 char *name;
27 char *value;
28 char *type;
29 struct probe_trace_arg_ref *ref;
30};
31
32
33struct probe_trace_event {
34 char *event;
35 char *group;
36 struct probe_trace_point point;
37 int nargs;
38 struct probe_trace_arg *args;
39};
40
41
42struct perf_probe_point {
43 char *file;
44 char *function;
45 int line;
46 bool retprobe;
47 char *lazy_line;
48 unsigned long offset;
49};
50
51
52struct perf_probe_arg_field {
53 struct perf_probe_arg_field *next;
54 char *name;
55 long index;
56 bool ref;
57};
58
59
60struct perf_probe_arg {
61 char *name;
62 char *var;
63 char *type;
64 struct perf_probe_arg_field *field;
65};
66
67
68struct perf_probe_event {
69 char *event;
70 char *group;
71 struct perf_probe_point point;
72 int nargs;
73 struct perf_probe_arg *args;
74};
75
76
77
78struct line_node {
79 struct list_head list;
80 int line;
81};
82
83
84struct line_range {
85 char *file;
86 char *function;
87 int start;
88 int end;
89 int offset;
90 char *path;
91 char *comp_dir;
92 struct list_head line_list;
93};
94
95
96struct variable_list {
97 struct probe_trace_point point;
98 struct strlist *vars;
99};
100
101
102extern int parse_perf_probe_command(const char *cmd,
103 struct perf_probe_event *pev);
104
105
106extern char *synthesize_perf_probe_command(struct perf_probe_event *pev);
107extern char *synthesize_probe_trace_command(struct probe_trace_event *tev);
108extern int synthesize_perf_probe_arg(struct perf_probe_arg *pa, char *buf,
109 size_t len);
110
111
112extern bool perf_probe_event_need_dwarf(struct perf_probe_event *pev);
113
114
115extern void clear_perf_probe_event(struct perf_probe_event *pev);
116
117
118extern int parse_line_range_desc(const char *cmd, struct line_range *lr);
119
120
121extern const char *kernel_get_module_path(const char *module);
122
123extern int add_perf_probe_events(struct perf_probe_event *pevs, int npevs,
124 int max_probe_points, const char *module,
125 bool force_add);
126extern int del_perf_probe_events(struct strlist *dellist);
127extern int show_perf_probe_events(void);
128extern int show_line_range(struct line_range *lr, const char *module);
129extern int show_available_vars(struct perf_probe_event *pevs, int npevs,
130 int max_probe_points, const char *module,
131 struct strfilter *filter, bool externs);
132extern int show_available_funcs(const char *module, struct strfilter *filter);
133
134
135
136#define MAX_EVENT_INDEX 1024
137
138#endif
139