aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/probe-event.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/probe-event.h')
-rw-r--r--tools/perf/util/probe-event.h111
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
8extern bool probe_event_dry_run; 7extern bool probe_event_dry_run;
9 8
10extern void parse_line_range_desc(const char *arg, struct line_range *lr); 9/* kprobe-tracer tracing point */
11extern void parse_perf_probe_event(const char *str, struct probe_point *pp, 10struct kprobe_trace_point {
12 bool *need_dwarf); 11 char *symbol; /* Base symbol */
13extern int synthesize_perf_probe_point(struct probe_point *pp); 12 unsigned long offset; /* Offset from symbol */
14extern int synthesize_perf_probe_event(struct probe_point *pp); 13 bool retprobe; /* Return probe flag */
15extern void parse_trace_kprobe_event(const char *str, struct probe_point *pp); 14};
16extern int synthesize_trace_kprobe_event(struct probe_point *pp); 15
17extern 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); 17struct kprobe_trace_arg_ref {
19extern 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 */
23struct 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) */
30struct 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 */
39struct 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 */
49struct perf_probe_arg {
50 char *name; /* Argument name */
51};
52
53/* Perf probe probing event (point + arg) */
54struct 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 */
64struct line_node {
65 struct list_head list;
66 unsigned int line;
67};
68
69/* Line range */
70struct 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 */
81extern void parse_perf_probe_command(const char *cmd,
82 struct perf_probe_event *pev);
83extern void parse_kprobe_trace_command(const char *cmd,
84 struct kprobe_trace_event *tev);
85
86/* Events to command string */
87extern char *synthesize_perf_probe_command(struct perf_probe_event *pev);
88extern char *synthesize_kprobe_trace_command(struct kprobe_trace_event *tev);
89
90/* Check the perf_probe_event needs debuginfo */
91extern bool perf_probe_event_need_dwarf(struct perf_probe_event *pev);
92
93/* Convert from kprobe_trace_event to perf_probe_event */
94extern void convert_to_perf_probe_event(struct kprobe_trace_event *tev,
95 struct perf_probe_event *pev);
96
97/* Release event contents */
98extern void clear_perf_probe_event(struct perf_probe_event *pev);
99extern void clear_kprobe_trace_event(struct kprobe_trace_event *tev);
100
101/* Command string to line-range */
102extern void parse_line_range_desc(const char *cmd, struct line_range *lr);
103
104
105extern void add_perf_probe_events(struct perf_probe_event *pevs, int ntevs,
106 bool force_add);
107extern void del_perf_probe_events(struct strlist *dellist);
20extern void show_perf_probe_events(void); 108extern void show_perf_probe_events(void);
21extern void show_line_range(struct line_range *lr); 109extern 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