diff options
Diffstat (limited to 'tools/perf/util/probe-event.h')
-rw-r--r-- | tools/perf/util/probe-event.h | 111 |
1 files changed, 100 insertions, 11 deletions
diff --git a/tools/perf/util/probe-event.h b/tools/perf/util/probe-event.h index 703b8876dfb1..2a2f0a26dc67 100644 --- a/tools/perf/util/probe-event.h +++ b/tools/perf/util/probe-event.h | |||
@@ -2,24 +2,113 @@ | |||
2 | #define _PROBE_EVENT_H | 2 | #define _PROBE_EVENT_H |
3 | 3 | ||
4 | #include <stdbool.h> | 4 | #include <stdbool.h> |
5 | #include "probe-finder.h" | ||
6 | #include "strlist.h" | 5 | #include "strlist.h" |
7 | 6 | ||
8 | extern bool probe_event_dry_run; | 7 | extern bool probe_event_dry_run; |
9 | 8 | ||
10 | extern void parse_line_range_desc(const char *arg, struct line_range *lr); | 9 | /* kprobe-tracer tracing point */ |
11 | extern void parse_perf_probe_event(const char *str, struct probe_point *pp, | 10 | struct kprobe_trace_point { |
12 | bool *need_dwarf); | 11 | char *symbol; /* Base symbol */ |
13 | extern int synthesize_perf_probe_point(struct probe_point *pp); | 12 | unsigned long offset; /* Offset from symbol */ |
14 | extern int synthesize_perf_probe_event(struct probe_point *pp); | 13 | bool retprobe; /* Return probe flag */ |
15 | extern void parse_trace_kprobe_event(const char *str, struct probe_point *pp); | 14 | }; |
16 | extern int synthesize_trace_kprobe_event(struct probe_point *pp); | 15 | |
17 | extern void add_trace_kprobe_events(struct probe_point *probes, int nr_probes, | 16 | /* kprobe-tracer tracing argument referencing offset */ |
18 | bool force_add, bool need_dwarf); | 17 | struct kprobe_trace_arg_ref { |
19 | extern void del_trace_kprobe_events(struct strlist *dellist); | 18 | struct kprobe_trace_arg_ref *next; /* Next reference */ |
19 | long offset; /* Offset value */ | ||
20 | }; | ||
21 | |||
22 | /* kprobe-tracer tracing argument */ | ||
23 | struct kprobe_trace_arg { | ||
24 | char *name; /* Argument name */ | ||
25 | char *value; /* Base value */ | ||
26 | struct kprobe_trace_arg_ref *ref; /* Referencing offset */ | ||
27 | }; | ||
28 | |||
29 | /* kprobe-tracer tracing event (point + arg) */ | ||
30 | struct kprobe_trace_event { | ||
31 | char *event; /* Event name */ | ||
32 | char *group; /* Group name */ | ||
33 | struct kprobe_trace_point point; /* Trace point */ | ||
34 | int nargs; /* Number of args */ | ||
35 | struct kprobe_trace_arg *args; /* Arguments */ | ||
36 | }; | ||
37 | |||
38 | /* Perf probe probing point */ | ||
39 | struct perf_probe_point { | ||
40 | char *file; /* File path */ | ||
41 | char *function; /* Function name */ | ||
42 | int line; /* Line number */ | ||
43 | char *lazy_line; /* Lazy matching pattern */ | ||
44 | unsigned long offset; /* Offset from function entry */ | ||
45 | bool retprobe; /* Return probe flag */ | ||
46 | }; | ||
47 | |||
48 | /* Perf probe probing argument */ | ||
49 | struct perf_probe_arg { | ||
50 | char *name; /* Argument name */ | ||
51 | }; | ||
52 | |||
53 | /* Perf probe probing event (point + arg) */ | ||
54 | struct perf_probe_event { | ||
55 | char *event; /* Event name */ | ||
56 | char *group; /* Group name */ | ||
57 | struct perf_probe_point point; /* Probe point */ | ||
58 | int nargs; /* Number of arguments */ | ||
59 | struct perf_probe_arg *args; /* Arguments */ | ||
60 | }; | ||
61 | |||
62 | |||
63 | /* Line number container */ | ||
64 | struct line_node { | ||
65 | struct list_head list; | ||
66 | unsigned int line; | ||
67 | }; | ||
68 | |||
69 | /* Line range */ | ||
70 | struct line_range { | ||
71 | char *file; /* File name */ | ||
72 | char *function; /* Function name */ | ||
73 | unsigned int start; /* Start line number */ | ||
74 | unsigned int end; /* End line number */ | ||
75 | int offset; /* Start line offset */ | ||
76 | char *path; /* Real path name */ | ||
77 | struct list_head line_list; /* Visible lines */ | ||
78 | }; | ||
79 | |||
80 | /* Command string to events */ | ||
81 | extern void parse_perf_probe_command(const char *cmd, | ||
82 | struct perf_probe_event *pev); | ||
83 | extern void parse_kprobe_trace_command(const char *cmd, | ||
84 | struct kprobe_trace_event *tev); | ||
85 | |||
86 | /* Events to command string */ | ||
87 | extern char *synthesize_perf_probe_command(struct perf_probe_event *pev); | ||
88 | extern char *synthesize_kprobe_trace_command(struct kprobe_trace_event *tev); | ||
89 | |||
90 | /* Check the perf_probe_event needs debuginfo */ | ||
91 | extern bool perf_probe_event_need_dwarf(struct perf_probe_event *pev); | ||
92 | |||
93 | /* Convert from kprobe_trace_event to perf_probe_event */ | ||
94 | extern void convert_to_perf_probe_event(struct kprobe_trace_event *tev, | ||
95 | struct perf_probe_event *pev); | ||
96 | |||
97 | /* Release event contents */ | ||
98 | extern void clear_perf_probe_event(struct perf_probe_event *pev); | ||
99 | extern void clear_kprobe_trace_event(struct kprobe_trace_event *tev); | ||
100 | |||
101 | /* Command string to line-range */ | ||
102 | extern void parse_line_range_desc(const char *cmd, struct line_range *lr); | ||
103 | |||
104 | |||
105 | extern void add_perf_probe_events(struct perf_probe_event *pevs, int ntevs, | ||
106 | bool force_add); | ||
107 | extern void del_perf_probe_events(struct strlist *dellist); | ||
20 | extern void show_perf_probe_events(void); | 108 | extern void show_perf_probe_events(void); |
21 | extern void show_line_range(struct line_range *lr); | 109 | extern void show_line_range(struct line_range *lr); |
22 | 110 | ||
111 | |||
23 | /* Maximum index number of event-name postfix */ | 112 | /* Maximum index number of event-name postfix */ |
24 | #define MAX_EVENT_INDEX 1024 | 113 | #define MAX_EVENT_INDEX 1024 |
25 | 114 | ||