diff options
Diffstat (limited to 'tools/perf/util/event.h')
-rw-r--r-- | tools/perf/util/event.h | 54 |
1 files changed, 42 insertions, 12 deletions
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h index 181389535c0c..c67ecc457d29 100644 --- a/tools/perf/util/event.h +++ b/tools/perf/util/event.h | |||
@@ -8,22 +8,25 @@ | |||
8 | #include "map.h" | 8 | #include "map.h" |
9 | #include "build-id.h" | 9 | #include "build-id.h" |
10 | 10 | ||
11 | /* | 11 | struct mmap_event { |
12 | * PERF_SAMPLE_IP | PERF_SAMPLE_TID | * | ||
13 | */ | ||
14 | struct ip_event { | ||
15 | struct perf_event_header header; | 12 | struct perf_event_header header; |
16 | u64 ip; | ||
17 | u32 pid, tid; | 13 | u32 pid, tid; |
18 | unsigned char __more_data[]; | 14 | u64 start; |
15 | u64 len; | ||
16 | u64 pgoff; | ||
17 | char filename[PATH_MAX]; | ||
19 | }; | 18 | }; |
20 | 19 | ||
21 | struct mmap_event { | 20 | struct mmap2_event { |
22 | struct perf_event_header header; | 21 | struct perf_event_header header; |
23 | u32 pid, tid; | 22 | u32 pid, tid; |
24 | u64 start; | 23 | u64 start; |
25 | u64 len; | 24 | u64 len; |
26 | u64 pgoff; | 25 | u64 pgoff; |
26 | u32 maj; | ||
27 | u32 min; | ||
28 | u64 ino; | ||
29 | u64 ino_generation; | ||
27 | char filename[PATH_MAX]; | 30 | char filename[PATH_MAX]; |
28 | }; | 31 | }; |
29 | 32 | ||
@@ -63,7 +66,8 @@ struct read_event { | |||
63 | (PERF_SAMPLE_IP | PERF_SAMPLE_TID | \ | 66 | (PERF_SAMPLE_IP | PERF_SAMPLE_TID | \ |
64 | PERF_SAMPLE_TIME | PERF_SAMPLE_ADDR | \ | 67 | PERF_SAMPLE_TIME | PERF_SAMPLE_ADDR | \ |
65 | PERF_SAMPLE_ID | PERF_SAMPLE_STREAM_ID | \ | 68 | PERF_SAMPLE_ID | PERF_SAMPLE_STREAM_ID | \ |
66 | PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD) | 69 | PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD | \ |
70 | PERF_SAMPLE_IDENTIFIER) | ||
67 | 71 | ||
68 | struct sample_event { | 72 | struct sample_event { |
69 | struct perf_event_header header; | 73 | struct perf_event_header header; |
@@ -71,6 +75,7 @@ struct sample_event { | |||
71 | }; | 75 | }; |
72 | 76 | ||
73 | struct regs_dump { | 77 | struct regs_dump { |
78 | u64 abi; | ||
74 | u64 *regs; | 79 | u64 *regs; |
75 | }; | 80 | }; |
76 | 81 | ||
@@ -80,6 +85,23 @@ struct stack_dump { | |||
80 | char *data; | 85 | char *data; |
81 | }; | 86 | }; |
82 | 87 | ||
88 | struct sample_read_value { | ||
89 | u64 value; | ||
90 | u64 id; | ||
91 | }; | ||
92 | |||
93 | struct sample_read { | ||
94 | u64 time_enabled; | ||
95 | u64 time_running; | ||
96 | union { | ||
97 | struct { | ||
98 | u64 nr; | ||
99 | struct sample_read_value *values; | ||
100 | } group; | ||
101 | struct sample_read_value one; | ||
102 | }; | ||
103 | }; | ||
104 | |||
83 | struct perf_sample { | 105 | struct perf_sample { |
84 | u64 ip; | 106 | u64 ip; |
85 | u32 pid, tid; | 107 | u32 pid, tid; |
@@ -97,6 +119,7 @@ struct perf_sample { | |||
97 | struct branch_stack *branch_stack; | 119 | struct branch_stack *branch_stack; |
98 | struct regs_dump user_regs; | 120 | struct regs_dump user_regs; |
99 | struct stack_dump user_stack; | 121 | struct stack_dump user_stack; |
122 | struct sample_read read; | ||
100 | }; | 123 | }; |
101 | 124 | ||
102 | #define PERF_MEM_DATA_SRC_NONE \ | 125 | #define PERF_MEM_DATA_SRC_NONE \ |
@@ -116,7 +139,7 @@ struct build_id_event { | |||
116 | enum perf_user_event_type { /* above any possible kernel type */ | 139 | enum perf_user_event_type { /* above any possible kernel type */ |
117 | PERF_RECORD_USER_TYPE_START = 64, | 140 | PERF_RECORD_USER_TYPE_START = 64, |
118 | PERF_RECORD_HEADER_ATTR = 64, | 141 | PERF_RECORD_HEADER_ATTR = 64, |
119 | PERF_RECORD_HEADER_EVENT_TYPE = 65, | 142 | PERF_RECORD_HEADER_EVENT_TYPE = 65, /* depreceated */ |
120 | PERF_RECORD_HEADER_TRACING_DATA = 66, | 143 | PERF_RECORD_HEADER_TRACING_DATA = 66, |
121 | PERF_RECORD_HEADER_BUILD_ID = 67, | 144 | PERF_RECORD_HEADER_BUILD_ID = 67, |
122 | PERF_RECORD_FINISHED_ROUND = 68, | 145 | PERF_RECORD_FINISHED_ROUND = 68, |
@@ -148,8 +171,8 @@ struct tracing_data_event { | |||
148 | 171 | ||
149 | union perf_event { | 172 | union perf_event { |
150 | struct perf_event_header header; | 173 | struct perf_event_header header; |
151 | struct ip_event ip; | ||
152 | struct mmap_event mmap; | 174 | struct mmap_event mmap; |
175 | struct mmap2_event mmap2; | ||
153 | struct comm_event comm; | 176 | struct comm_event comm; |
154 | struct fork_event fork; | 177 | struct fork_event fork; |
155 | struct lost_event lost; | 178 | struct lost_event lost; |
@@ -199,6 +222,10 @@ int perf_event__process_mmap(struct perf_tool *tool, | |||
199 | union perf_event *event, | 222 | union perf_event *event, |
200 | struct perf_sample *sample, | 223 | struct perf_sample *sample, |
201 | struct machine *machine); | 224 | struct machine *machine); |
225 | int perf_event__process_mmap2(struct perf_tool *tool, | ||
226 | union perf_event *event, | ||
227 | struct perf_sample *sample, | ||
228 | struct machine *machine); | ||
202 | int perf_event__process_fork(struct perf_tool *tool, | 229 | int perf_event__process_fork(struct perf_tool *tool, |
203 | union perf_event *event, | 230 | union perf_event *event, |
204 | struct perf_sample *sample, | 231 | struct perf_sample *sample, |
@@ -216,17 +243,20 @@ struct addr_location; | |||
216 | int perf_event__preprocess_sample(const union perf_event *self, | 243 | int perf_event__preprocess_sample(const union perf_event *self, |
217 | struct machine *machine, | 244 | struct machine *machine, |
218 | struct addr_location *al, | 245 | struct addr_location *al, |
219 | struct perf_sample *sample, | 246 | struct perf_sample *sample); |
220 | symbol_filter_t filter); | ||
221 | 247 | ||
222 | const char *perf_event__name(unsigned int id); | 248 | const char *perf_event__name(unsigned int id); |
223 | 249 | ||
250 | size_t perf_event__sample_event_size(const struct perf_sample *sample, u64 type, | ||
251 | u64 sample_regs_user, u64 read_format); | ||
224 | int perf_event__synthesize_sample(union perf_event *event, u64 type, | 252 | int perf_event__synthesize_sample(union perf_event *event, u64 type, |
253 | u64 sample_regs_user, u64 read_format, | ||
225 | const struct perf_sample *sample, | 254 | const struct perf_sample *sample, |
226 | bool swapped); | 255 | bool swapped); |
227 | 256 | ||
228 | size_t perf_event__fprintf_comm(union perf_event *event, FILE *fp); | 257 | size_t perf_event__fprintf_comm(union perf_event *event, FILE *fp); |
229 | size_t perf_event__fprintf_mmap(union perf_event *event, FILE *fp); | 258 | size_t perf_event__fprintf_mmap(union perf_event *event, FILE *fp); |
259 | size_t perf_event__fprintf_mmap2(union perf_event *event, FILE *fp); | ||
230 | size_t perf_event__fprintf_task(union perf_event *event, FILE *fp); | 260 | size_t perf_event__fprintf_task(union perf_event *event, FILE *fp); |
231 | size_t perf_event__fprintf(union perf_event *event, FILE *fp); | 261 | size_t perf_event__fprintf(union perf_event *event, FILE *fp); |
232 | 262 | ||