Commit | Line | Data |
---|---|---|
9f36eaed | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
b87700e3 AG |
2 | #undef TRACE_SYSTEM |
3 | #define TRACE_SYSTEM btrfs | |
4 | ||
3bc29f0a MD |
5 | #if !defined(LTTNG_TRACE_BTRFS_H) || defined(TRACE_HEADER_MULTI_READ) |
6 | #define LTTNG_TRACE_BTRFS_H | |
b87700e3 | 7 | |
6ec43db8 | 8 | #include <probes/lttng-tracepoint-event.h> |
b87700e3 | 9 | #include <linux/writeback.h> |
b87700e3 AG |
10 | #include <linux/version.h> |
11 | ||
12 | #ifndef _TRACE_BTRFS_DEF_ | |
13 | #define _TRACE_BTRFS_DEF_ | |
14 | struct btrfs_root; | |
15 | struct btrfs_fs_info; | |
16 | struct btrfs_inode; | |
17 | struct extent_map; | |
18 | struct btrfs_ordered_extent; | |
19 | struct btrfs_delayed_ref_node; | |
20 | struct btrfs_delayed_tree_ref; | |
21 | struct btrfs_delayed_data_ref; | |
22 | struct btrfs_delayed_ref_head; | |
23 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
24 | struct btrfs_block_group_cache; | |
25 | struct btrfs_free_cluster; | |
26 | #endif | |
27 | struct map_lookup; | |
28 | struct extent_buffer; | |
29 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
30 | struct extent_state; | |
31 | #endif | |
32 | #endif | |
33 | ||
b87700e3 AG |
34 | #define BTRFS_UUID_SIZE 16 |
35 | ||
7ca7cd6e | 36 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ |
0badc02f MJ |
37 | LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
38 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ | |
39 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ | |
7ca7cd6e | 40 | LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) |
1f1ec4ed MJ |
41 | LTTNG_TRACEPOINT_EVENT(btrfs_transaction_commit, |
42 | ||
43 | TP_PROTO(const struct btrfs_root *root), | |
44 | ||
45 | TP_ARGS(root), | |
46 | ||
47 | TP_FIELDS( | |
48 | ctf_integer(u64, generation, root->fs_info->generation) | |
49 | ctf_integer(u64, root_objectid, root->root_key.objectid) | |
50 | ) | |
51 | ) | |
52 | ||
53 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__inode, | |
54 | ||
55 | TP_PROTO(const struct inode *inode), | |
56 | ||
57 | TP_ARGS(inode), | |
58 | ||
59 | TP_FIELDS( | |
60 | ctf_integer(ino_t, ino, inode->i_ino) | |
61 | ctf_integer(blkcnt_t, blocks, inode->i_blocks) | |
62 | ctf_integer(u64, disk_i_size, BTRFS_I(inode)->disk_i_size) | |
63 | ctf_integer(u64, generation, BTRFS_I(inode)->generation) | |
64 | ctf_integer(u64, last_trans, BTRFS_I(inode)->last_trans) | |
65 | ctf_integer(u64, logged_trans, BTRFS_I(inode)->logged_trans) | |
66 | ctf_integer(u64, root_objectid, | |
67 | BTRFS_I(inode)->root->root_key.objectid) | |
68 | ) | |
69 | ) | |
70 | ||
71 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_new, | |
72 | ||
73 | TP_PROTO(const struct inode *inode), | |
74 | ||
75 | TP_ARGS(inode) | |
76 | ) | |
77 | ||
78 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_request, | |
79 | ||
80 | TP_PROTO(const struct inode *inode), | |
81 | ||
82 | TP_ARGS(inode) | |
83 | ) | |
84 | ||
85 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_evict, | |
86 | ||
87 | TP_PROTO(const struct inode *inode), | |
88 | ||
89 | TP_ARGS(inode) | |
90 | ) | |
91 | #else | |
3bc29f0a | 92 | LTTNG_TRACEPOINT_EVENT(btrfs_transaction_commit, |
b87700e3 AG |
93 | |
94 | TP_PROTO(struct btrfs_root *root), | |
95 | ||
96 | TP_ARGS(root), | |
97 | ||
f127e61e MD |
98 | TP_FIELDS( |
99 | ctf_integer(u64, generation, root->fs_info->generation) | |
100 | ctf_integer(u64, root_objectid, root->root_key.objectid) | |
101 | ) | |
b87700e3 AG |
102 | ) |
103 | ||
3bc29f0a | 104 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__inode, |
b87700e3 AG |
105 | |
106 | TP_PROTO(struct inode *inode), | |
107 | ||
108 | TP_ARGS(inode), | |
109 | ||
f127e61e MD |
110 | TP_FIELDS( |
111 | ctf_integer(ino_t, ino, inode->i_ino) | |
112 | ctf_integer(blkcnt_t, blocks, inode->i_blocks) | |
113 | ctf_integer(u64, disk_i_size, BTRFS_I(inode)->disk_i_size) | |
114 | ctf_integer(u64, generation, BTRFS_I(inode)->generation) | |
115 | ctf_integer(u64, last_trans, BTRFS_I(inode)->last_trans) | |
116 | ctf_integer(u64, logged_trans, BTRFS_I(inode)->logged_trans) | |
117 | ctf_integer(u64, root_objectid, | |
b87700e3 | 118 | BTRFS_I(inode)->root->root_key.objectid) |
f127e61e | 119 | ) |
b87700e3 AG |
120 | ) |
121 | ||
3bc29f0a | 122 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_new, |
b87700e3 AG |
123 | |
124 | TP_PROTO(struct inode *inode), | |
125 | ||
126 | TP_ARGS(inode) | |
127 | ) | |
128 | ||
3bc29f0a | 129 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_request, |
b87700e3 AG |
130 | |
131 | TP_PROTO(struct inode *inode), | |
132 | ||
133 | TP_ARGS(inode) | |
134 | ) | |
135 | ||
3bc29f0a | 136 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_evict, |
b87700e3 AG |
137 | |
138 | TP_PROTO(struct inode *inode), | |
139 | ||
140 | TP_ARGS(inode) | |
141 | ) | |
1f1ec4ed MJ |
142 | #endif |
143 | ||
144 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) | |
145 | ||
146 | LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, | |
147 | ||
148 | TP_PROTO(const struct btrfs_root *root, const struct btrfs_inode *inode, | |
149 | const struct extent_map *map), | |
150 | ||
151 | TP_ARGS(root, inode, map), | |
152 | ||
153 | TP_FIELDS( | |
154 | ctf_integer(u64, root_objectid, root->root_key.objectid) | |
155 | ctf_integer(u64, ino, btrfs_ino(inode)) | |
156 | ctf_integer(u64, start, map->start) | |
157 | ctf_integer(u64, len, map->len) | |
158 | ctf_integer(u64, orig_start, map->orig_start) | |
159 | ctf_integer(u64, block_start, map->block_start) | |
160 | ctf_integer(u64, block_len, map->block_len) | |
161 | ctf_integer(unsigned long, flags, map->flags) | |
162 | ctf_integer(int, refs, refcount_read(&map->refs)) | |
163 | ctf_integer(unsigned int, compress_type, map->compress_type) | |
164 | ) | |
165 | ) | |
b87700e3 | 166 | |
1f1ec4ed | 167 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) |
5807b1af MJ |
168 | |
169 | LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, | |
170 | ||
171 | TP_PROTO(struct btrfs_root *root, struct btrfs_inode *inode, | |
172 | struct extent_map *map), | |
173 | ||
174 | TP_ARGS(root, inode, map), | |
175 | ||
176 | TP_FIELDS( | |
177 | ctf_integer(u64, root_objectid, root->root_key.objectid) | |
178 | ctf_integer(u64, ino, btrfs_ino(inode)) | |
179 | ctf_integer(u64, start, map->start) | |
180 | ctf_integer(u64, len, map->len) | |
181 | ctf_integer(u64, orig_start, map->orig_start) | |
182 | ctf_integer(u64, block_start, map->block_start) | |
183 | ctf_integer(u64, block_len, map->block_len) | |
184 | ctf_integer(unsigned long, flags, map->flags) | |
185 | ctf_integer(int, refs, refcount_read(&map->refs)) | |
186 | ctf_integer(unsigned int, compress_type, map->compress_type) | |
187 | ) | |
188 | ) | |
189 | ||
190 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) | |
e52717ea FD |
191 | |
192 | LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, | |
193 | ||
194 | TP_PROTO(struct btrfs_root *root, struct btrfs_inode *inode, | |
195 | struct extent_map *map), | |
196 | ||
197 | TP_ARGS(root, inode, map), | |
198 | ||
199 | TP_FIELDS( | |
200 | ctf_integer(u64, root_objectid, root->root_key.objectid) | |
201 | ctf_integer(u64, ino, btrfs_ino(inode)) | |
202 | ctf_integer(u64, start, map->start) | |
203 | ctf_integer(u64, len, map->len) | |
204 | ctf_integer(u64, orig_start, map->orig_start) | |
205 | ctf_integer(u64, block_start, map->block_start) | |
206 | ctf_integer(u64, block_len, map->block_len) | |
207 | ctf_integer(unsigned long, flags, map->flags) | |
208 | ctf_integer(int, refs, atomic_read(&map->refs)) | |
209 | ctf_integer(unsigned int, compress_type, map->compress_type) | |
210 | ) | |
211 | ) | |
212 | ||
213 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
f1a87e24 | 214 | |
3bc29f0a | 215 | LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, |
b87700e3 | 216 | |
f3166f27 MD |
217 | TP_PROTO(struct btrfs_root *root, struct inode *inode, |
218 | struct extent_map *map), | |
b87700e3 | 219 | |
f3166f27 | 220 | TP_ARGS(root, inode, map), |
b87700e3 | 221 | |
f127e61e MD |
222 | TP_FIELDS( |
223 | ctf_integer(u64, root_objectid, root->root_key.objectid) | |
f3166f27 | 224 | ctf_integer(u64, ino, btrfs_ino(inode)) |
f127e61e MD |
225 | ctf_integer(u64, start, map->start) |
226 | ctf_integer(u64, len, map->len) | |
227 | ctf_integer(u64, orig_start, map->orig_start) | |
228 | ctf_integer(u64, block_start, map->block_start) | |
229 | ctf_integer(u64, block_len, map->block_len) | |
230 | ctf_integer(unsigned long, flags, map->flags) | |
231 | ctf_integer(int, refs, atomic_read(&map->refs)) | |
232 | ctf_integer(unsigned int, compress_type, map->compress_type) | |
233 | ) | |
b87700e3 AG |
234 | ) |
235 | ||
0badc02f MJ |
236 | #elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
237 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ | |
238 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ | |
239 | LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) | |
7ca7cd6e MJ |
240 | |
241 | LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, | |
242 | ||
243 | TP_PROTO(const struct btrfs_root *root, const struct extent_map *map), | |
244 | ||
245 | TP_ARGS(root, map), | |
246 | ||
247 | TP_FIELDS( | |
248 | ctf_integer(u64, root_objectid, root->root_key.objectid) | |
249 | ctf_integer(u64, start, map->start) | |
250 | ctf_integer(u64, len, map->len) | |
251 | ctf_integer(u64, orig_start, map->orig_start) | |
252 | ctf_integer(u64, block_start, map->block_start) | |
253 | ctf_integer(u64, block_len, map->block_len) | |
254 | ctf_integer(unsigned long, flags, map->flags) | |
255 | ctf_integer(int, refs, atomic_read(&map->refs)) | |
256 | ctf_integer(unsigned int, compress_type, map->compress_type) | |
257 | ) | |
258 | ) | |
259 | ||
f1a87e24 MD |
260 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ |
261 | ||
262 | LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, | |
263 | ||
264 | TP_PROTO(struct btrfs_root *root, struct extent_map *map), | |
265 | ||
266 | TP_ARGS(root, map), | |
267 | ||
268 | TP_FIELDS( | |
269 | ctf_integer(u64, root_objectid, root->root_key.objectid) | |
270 | ctf_integer(u64, start, map->start) | |
271 | ctf_integer(u64, len, map->len) | |
272 | ctf_integer(u64, orig_start, map->orig_start) | |
273 | ctf_integer(u64, block_start, map->block_start) | |
274 | ctf_integer(u64, block_len, map->block_len) | |
275 | ctf_integer(unsigned long, flags, map->flags) | |
276 | ctf_integer(int, refs, atomic_read(&map->refs)) | |
277 | ctf_integer(unsigned int, compress_type, map->compress_type) | |
278 | ) | |
279 | ) | |
280 | ||
281 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
282 | ||
354b9790 MJ |
283 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0)) |
284 | LTTNG_TRACEPOINT_EVENT(btrfs_handle_em_exist, | |
285 | ||
286 | TP_PROTO(struct btrfs_fs_info *fs_info, | |
287 | const struct extent_map *existing, const struct extent_map *map, | |
288 | u64 start, u64 len), | |
289 | ||
290 | TP_ARGS(fs_info, existing, map, start, len), | |
291 | ||
292 | TP_FIELDS( | |
293 | ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE) | |
294 | ctf_integer(u64, e_start, existing->start) | |
295 | ctf_integer(u64, e_len, existing->len) | |
296 | ctf_integer(u64, map_start, map->start) | |
297 | ctf_integer(u64, map_len, map->len) | |
298 | ctf_integer(u64, start, start) | |
299 | ctf_integer(u64, len, len) | |
300 | ) | |
301 | ) | |
302 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) | |
22df20ca MJ |
303 | LTTNG_TRACEPOINT_EVENT(btrfs_handle_em_exist, |
304 | ||
305 | TP_PROTO(const struct extent_map *existing, const struct extent_map *map, u64 start, u64 len), | |
306 | ||
307 | TP_ARGS(existing, map, start, len), | |
308 | ||
309 | TP_FIELDS( | |
310 | ctf_integer(u64, e_start, existing->start) | |
311 | ctf_integer(u64, e_len, existing->len) | |
312 | ctf_integer(u64, map_start, map->start) | |
313 | ctf_integer(u64, map_len, map->len) | |
314 | ctf_integer(u64, start, start) | |
315 | ctf_integer(u64, len, len) | |
316 | ) | |
317 | ) | |
318 | #endif | |
319 | ||
1f1ec4ed MJ |
320 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) |
321 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent, | |
322 | ||
323 | TP_PROTO(const struct inode *inode, | |
324 | const struct btrfs_ordered_extent *ordered), | |
325 | ||
326 | TP_ARGS(inode, ordered), | |
327 | ||
328 | TP_FIELDS( | |
329 | ctf_integer(ino_t, ino, inode->i_ino) | |
330 | ctf_integer(u64, file_offset, ordered->file_offset) | |
331 | ctf_integer(u64, start, ordered->start) | |
332 | ctf_integer(u64, len, ordered->len) | |
333 | ctf_integer(u64, disk_len, ordered->disk_len) | |
334 | ctf_integer(u64, bytes_left, ordered->bytes_left) | |
335 | ctf_integer(unsigned long, flags, ordered->flags) | |
336 | ctf_integer(int, compress_type, ordered->compress_type) | |
337 | ctf_integer(int, refs, refcount_read(&ordered->refs)) | |
338 | ctf_integer(u64, root_objectid, | |
339 | BTRFS_I(inode)->root->root_key.objectid) | |
340 | ) | |
341 | ) | |
342 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) | |
5807b1af MJ |
343 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent, |
344 | ||
345 | TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), | |
346 | ||
347 | TP_ARGS(inode, ordered), | |
348 | ||
349 | TP_FIELDS( | |
350 | ctf_integer(ino_t, ino, inode->i_ino) | |
351 | ctf_integer(u64, file_offset, ordered->file_offset) | |
352 | ctf_integer(u64, start, ordered->start) | |
353 | ctf_integer(u64, len, ordered->len) | |
354 | ctf_integer(u64, disk_len, ordered->disk_len) | |
355 | ctf_integer(u64, bytes_left, ordered->bytes_left) | |
356 | ctf_integer(unsigned long, flags, ordered->flags) | |
357 | ctf_integer(int, compress_type, ordered->compress_type) | |
358 | ctf_integer(int, refs, refcount_read(&ordered->refs)) | |
359 | ctf_integer(u64, root_objectid, | |
360 | BTRFS_I(inode)->root->root_key.objectid) | |
361 | ) | |
362 | ) | |
0badc02f MJ |
363 | #elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
364 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ | |
365 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ | |
366 | LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) | |
7ca7cd6e MJ |
367 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent, |
368 | ||
369 | TP_PROTO(const struct inode *inode, const struct btrfs_ordered_extent *ordered), | |
370 | ||
371 | TP_ARGS(inode, ordered), | |
372 | ||
373 | TP_FIELDS( | |
374 | ctf_integer(ino_t, ino, inode->i_ino) | |
375 | ctf_integer(u64, file_offset, ordered->file_offset) | |
376 | ctf_integer(u64, start, ordered->start) | |
377 | ctf_integer(u64, len, ordered->len) | |
378 | ctf_integer(u64, disk_len, ordered->disk_len) | |
379 | ctf_integer(u64, bytes_left, ordered->bytes_left) | |
380 | ctf_integer(unsigned long, flags, ordered->flags) | |
381 | ctf_integer(int, compress_type, ordered->compress_type) | |
382 | ctf_integer(int, refs, atomic_read(&ordered->refs)) | |
383 | ctf_integer(u64, root_objectid, | |
384 | BTRFS_I(inode)->root->root_key.objectid) | |
385 | ) | |
386 | ) | |
5807b1af | 387 | #else |
3bc29f0a | 388 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent, |
b87700e3 AG |
389 | |
390 | TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), | |
391 | ||
392 | TP_ARGS(inode, ordered), | |
393 | ||
f127e61e MD |
394 | TP_FIELDS( |
395 | ctf_integer(ino_t, ino, inode->i_ino) | |
396 | ctf_integer(u64, file_offset, ordered->file_offset) | |
397 | ctf_integer(u64, start, ordered->start) | |
398 | ctf_integer(u64, len, ordered->len) | |
399 | ctf_integer(u64, disk_len, ordered->disk_len) | |
400 | ctf_integer(u64, bytes_left, ordered->bytes_left) | |
401 | ctf_integer(unsigned long, flags, ordered->flags) | |
402 | ctf_integer(int, compress_type, ordered->compress_type) | |
403 | ctf_integer(int, refs, atomic_read(&ordered->refs)) | |
404 | ctf_integer(u64, root_objectid, | |
b87700e3 | 405 | BTRFS_I(inode)->root->root_key.objectid) |
f127e61e | 406 | ) |
b87700e3 | 407 | ) |
5807b1af | 408 | #endif |
b87700e3 | 409 | |
7ca7cd6e | 410 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ |
0badc02f MJ |
411 | LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
412 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ | |
413 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ | |
7ca7cd6e | 414 | LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) |
1f1ec4ed MJ |
415 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_add, |
416 | ||
417 | TP_PROTO(const struct inode *inode, | |
418 | const struct btrfs_ordered_extent *ordered), | |
419 | ||
420 | TP_ARGS(inode, ordered) | |
421 | ) | |
422 | ||
423 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_remove, | |
424 | ||
425 | TP_PROTO(const struct inode *inode, | |
426 | const struct btrfs_ordered_extent *ordered), | |
427 | ||
428 | TP_ARGS(inode, ordered) | |
429 | ) | |
430 | ||
431 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_start, | |
432 | ||
433 | TP_PROTO(const struct inode *inode, | |
434 | const struct btrfs_ordered_extent *ordered), | |
435 | ||
436 | TP_ARGS(inode, ordered) | |
437 | ) | |
438 | ||
439 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_put, | |
440 | ||
441 | TP_PROTO(const struct inode *inode, | |
442 | const struct btrfs_ordered_extent *ordered), | |
443 | ||
444 | TP_ARGS(inode, ordered) | |
445 | ) | |
446 | ||
447 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__writepage, | |
448 | ||
449 | TP_PROTO(const struct page *page, const struct inode *inode, | |
450 | const struct writeback_control *wbc), | |
451 | ||
452 | TP_ARGS(page, inode, wbc), | |
453 | ||
454 | TP_FIELDS( | |
455 | ctf_integer(ino_t, ino, inode->i_ino) | |
456 | ctf_integer(pgoff_t, index, page->index) | |
457 | ctf_integer(long, nr_to_write, wbc->nr_to_write) | |
458 | ctf_integer(long, pages_skipped, wbc->pages_skipped) | |
459 | ctf_integer(loff_t, range_start, wbc->range_start) | |
460 | ctf_integer(loff_t, range_end, wbc->range_end) | |
461 | ctf_integer(char, for_kupdate, wbc->for_kupdate) | |
462 | ctf_integer(char, for_reclaim, wbc->for_reclaim) | |
463 | ctf_integer(char, range_cyclic, wbc->range_cyclic) | |
464 | ctf_integer(pgoff_t, writeback_index, | |
465 | inode->i_mapping->writeback_index) | |
466 | ctf_integer(u64, root_objectid, | |
467 | BTRFS_I(inode)->root->root_key.objectid) | |
468 | ) | |
469 | ) | |
470 | ||
471 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs__writepage, | |
472 | ||
473 | __extent_writepage, | |
474 | ||
475 | btrfs__extent_writepage, | |
476 | ||
477 | TP_PROTO(const struct page *page, const struct inode *inode, | |
478 | const struct writeback_control *wbc), | |
479 | ||
480 | TP_ARGS(page, inode, wbc) | |
481 | ) | |
482 | ||
483 | LTTNG_TRACEPOINT_EVENT(btrfs_writepage_end_io_hook, | |
484 | ||
485 | TP_PROTO(const struct page *page, u64 start, u64 end, int uptodate), | |
486 | ||
487 | TP_ARGS(page, start, end, uptodate), | |
488 | ||
489 | TP_FIELDS( | |
490 | ctf_integer(ino_t, ino, page->mapping->host->i_ino) | |
491 | ctf_integer(pgoff_t, index, page->index) | |
492 | ctf_integer(u64, start, start) | |
493 | ctf_integer(u64, end, end) | |
494 | ctf_integer(int, uptodate, uptodate) | |
495 | ctf_integer(u64, root_objectid, | |
496 | BTRFS_I(page->mapping->host)->root->root_key.objectid) | |
497 | ) | |
498 | ) | |
499 | ||
500 | LTTNG_TRACEPOINT_EVENT(btrfs_sync_file, | |
501 | ||
502 | TP_PROTO(const struct file *file, int datasync), | |
503 | ||
504 | TP_ARGS(file, datasync), | |
505 | ||
506 | TP_FIELDS( | |
507 | ctf_integer(ino_t, ino, file->f_path.dentry->d_inode->i_ino) | |
508 | ctf_integer(ino_t, parent, file->f_path.dentry->d_parent->d_inode->i_ino) | |
509 | ctf_integer(int, datasync, datasync) | |
510 | ctf_integer(u64, root_objectid, | |
511 | BTRFS_I(file->f_path.dentry->d_inode)->root->root_key.objectid) | |
512 | ) | |
513 | ) | |
514 | #else | |
3bc29f0a | 515 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_add, |
b87700e3 AG |
516 | |
517 | TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), | |
518 | ||
519 | TP_ARGS(inode, ordered) | |
520 | ) | |
521 | ||
3bc29f0a | 522 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_remove, |
b87700e3 AG |
523 | |
524 | TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), | |
525 | ||
526 | TP_ARGS(inode, ordered) | |
527 | ) | |
528 | ||
3bc29f0a | 529 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_start, |
b87700e3 AG |
530 | |
531 | TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), | |
532 | ||
533 | TP_ARGS(inode, ordered) | |
534 | ) | |
535 | ||
3bc29f0a | 536 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_put, |
b87700e3 AG |
537 | |
538 | TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), | |
539 | ||
540 | TP_ARGS(inode, ordered) | |
541 | ) | |
542 | ||
3bc29f0a | 543 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__writepage, |
b87700e3 AG |
544 | |
545 | TP_PROTO(struct page *page, struct inode *inode, | |
546 | struct writeback_control *wbc), | |
547 | ||
548 | TP_ARGS(page, inode, wbc), | |
549 | ||
f127e61e MD |
550 | TP_FIELDS( |
551 | ctf_integer(ino_t, ino, inode->i_ino) | |
552 | ctf_integer(pgoff_t, index, page->index) | |
553 | ctf_integer(long, nr_to_write, wbc->nr_to_write) | |
554 | ctf_integer(long, pages_skipped, wbc->pages_skipped) | |
555 | ctf_integer(loff_t, range_start, wbc->range_start) | |
556 | ctf_integer(loff_t, range_end, wbc->range_end) | |
b87700e3 | 557 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)) |
f127e61e | 558 | ctf_integer(char, nonblocking, wbc->nonblocking) |
b87700e3 | 559 | #endif |
f127e61e MD |
560 | ctf_integer(char, for_kupdate, wbc->for_kupdate) |
561 | ctf_integer(char, for_reclaim, wbc->for_reclaim) | |
562 | ctf_integer(char, range_cyclic, wbc->range_cyclic) | |
563 | ctf_integer(pgoff_t, writeback_index, | |
564 | inode->i_mapping->writeback_index) | |
565 | ctf_integer(u64, root_objectid, | |
566 | BTRFS_I(inode)->root->root_key.objectid) | |
567 | ) | |
b87700e3 AG |
568 | ) |
569 | ||
9bbf98da MD |
570 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs__writepage, |
571 | ||
572 | __extent_writepage, | |
573 | ||
574 | btrfs__extent_writepage, | |
b87700e3 AG |
575 | |
576 | TP_PROTO(struct page *page, struct inode *inode, | |
577 | struct writeback_control *wbc), | |
578 | ||
579 | TP_ARGS(page, inode, wbc) | |
580 | ) | |
581 | ||
3bc29f0a | 582 | LTTNG_TRACEPOINT_EVENT(btrfs_writepage_end_io_hook, |
b87700e3 AG |
583 | |
584 | TP_PROTO(struct page *page, u64 start, u64 end, int uptodate), | |
585 | ||
586 | TP_ARGS(page, start, end, uptodate), | |
587 | ||
f127e61e MD |
588 | TP_FIELDS( |
589 | ctf_integer(ino_t, ino, page->mapping->host->i_ino) | |
590 | ctf_integer(pgoff_t, index, page->index) | |
591 | ctf_integer(u64, start, start) | |
592 | ctf_integer(u64, end, end) | |
593 | ctf_integer(int, uptodate, uptodate) | |
594 | ctf_integer(u64, root_objectid, | |
595 | BTRFS_I(page->mapping->host)->root->root_key.objectid) | |
596 | ) | |
b87700e3 AG |
597 | ) |
598 | ||
3bc29f0a | 599 | LTTNG_TRACEPOINT_EVENT(btrfs_sync_file, |
b87700e3 AG |
600 | |
601 | TP_PROTO(struct file *file, int datasync), | |
602 | ||
603 | TP_ARGS(file, datasync), | |
604 | ||
f127e61e MD |
605 | TP_FIELDS( |
606 | ctf_integer(ino_t, ino, file->f_path.dentry->d_inode->i_ino) | |
607 | ctf_integer(ino_t, parent, file->f_path.dentry->d_parent->d_inode->i_ino) | |
608 | ctf_integer(int, datasync, datasync) | |
609 | ctf_integer(u64, root_objectid, | |
b87700e3 | 610 | BTRFS_I(file->f_path.dentry->d_inode)->root->root_key.objectid) |
f127e61e | 611 | ) |
b87700e3 | 612 | ) |
1f1ec4ed | 613 | #endif |
b87700e3 | 614 | |
7ca7cd6e | 615 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ |
0badc02f MJ |
616 | LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
617 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ | |
618 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ | |
619 | LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,103,7,0,0) || \ | |
620 | LTTNG_SLE_KERNEL_RANGE(4,4,114,94,0,0, 4,4,114,95,0,0) || \ | |
621 | LTTNG_SLE_KERNEL_RANGE(4,4,120,94,0,0, 4,4,120,95,0,0) || \ | |
622 | LTTNG_SLE_KERNEL_RANGE(4,4,126,94,0,0, 4,5,0,0,0,0)) | |
1f1ec4ed MJ |
623 | LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs, |
624 | ||
625 | TP_PROTO(const struct btrfs_fs_info *fs_info, int wait), | |
626 | ||
627 | TP_ARGS(fs_info, wait), | |
628 | ||
629 | TP_FIELDS( | |
630 | ctf_integer(int, wait, wait) | |
631 | ) | |
632 | ) | |
633 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) | |
fcd0a11c MD |
634 | LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs, |
635 | ||
636 | TP_PROTO(struct btrfs_fs_info *fs_info, int wait), | |
637 | ||
638 | TP_ARGS(fs_info, wait), | |
639 | ||
640 | TP_FIELDS( | |
641 | ctf_integer(int, wait, wait) | |
642 | ) | |
643 | ) | |
644 | #else | |
3bc29f0a | 645 | LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs, |
b87700e3 AG |
646 | |
647 | TP_PROTO(int wait), | |
648 | ||
649 | TP_ARGS(wait), | |
650 | ||
f127e61e MD |
651 | TP_FIELDS( |
652 | ctf_integer(int, wait, wait) | |
653 | ) | |
b87700e3 | 654 | ) |
fcd0a11c MD |
655 | #endif |
656 | ||
7ca7cd6e | 657 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ |
0badc02f MJ |
658 | LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
659 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ | |
660 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ | |
7ca7cd6e | 661 | LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) |
1f1ec4ed MJ |
662 | LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group, |
663 | ||
664 | TP_PROTO(const struct btrfs_fs_info *fs_info, | |
665 | const struct btrfs_block_group_cache *block_group, int create), | |
666 | ||
667 | TP_ARGS(fs_info, block_group, create), | |
668 | ||
669 | TP_FIELDS( | |
670 | ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE) | |
671 | ctf_integer(u64, offset, block_group->key.objectid) | |
672 | ctf_integer(u64, size, block_group->key.offset) | |
673 | ctf_integer(u64, flags, block_group->flags) | |
674 | ctf_integer(u64, bytes_used, btrfs_block_group_used(&block_group->item)) | |
675 | ctf_integer(u64, bytes_super, block_group->bytes_super) | |
676 | ctf_integer(int, create, create) | |
677 | ) | |
678 | ) | |
679 | #else | |
fcd0a11c | 680 | LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group, |
b87700e3 | 681 | |
fcd0a11c MD |
682 | TP_PROTO(struct btrfs_fs_info *fs_info, |
683 | struct btrfs_block_group_cache *block_group, int create), | |
684 | ||
685 | TP_ARGS(fs_info, block_group, create), | |
686 | ||
687 | TP_FIELDS( | |
688 | ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE) | |
689 | ctf_integer(u64, offset, block_group->key.objectid) | |
690 | ctf_integer(u64, size, block_group->key.offset) | |
691 | ctf_integer(u64, flags, block_group->flags) | |
692 | ctf_integer(u64, bytes_used, btrfs_block_group_used(&block_group->item)) | |
693 | ctf_integer(u64, bytes_super, block_group->bytes_super) | |
694 | ctf_integer(int, create, create) | |
695 | ) | |
696 | ) | |
1f1ec4ed | 697 | #endif |
fcd0a11c | 698 | |
0badc02f MJ |
699 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ |
700 | LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ | |
701 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ | |
702 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ | |
703 | LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,103,7,0,0) || \ | |
704 | LTTNG_SLE_KERNEL_RANGE(4,4,114,94,0,0, 4,4,114,95,0,0) || \ | |
705 | LTTNG_SLE_KERNEL_RANGE(4,4,120,94,0,0, 4,4,120,95,0,0) || \ | |
706 | LTTNG_SLE_KERNEL_RANGE(4,4,126,94,0,0, 4,5,0,0,0,0)) | |
fde8b34a | 707 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_tree_ref, |
1f1ec4ed MJ |
708 | |
709 | TP_PROTO(const struct btrfs_fs_info *fs_info, | |
710 | const struct btrfs_delayed_ref_node *ref, | |
711 | const struct btrfs_delayed_tree_ref *full_ref, | |
712 | int action), | |
713 | ||
714 | TP_ARGS(fs_info, ref, full_ref, action), | |
715 | ||
716 | TP_FIELDS( | |
fde8b34a | 717 | ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE) |
1f1ec4ed MJ |
718 | ctf_integer(u64, bytenr, ref->bytenr) |
719 | ctf_integer(u64, num_bytes, ref->num_bytes) | |
720 | ctf_integer(int, action, action) | |
721 | ctf_integer(u64, parent, full_ref->parent) | |
722 | ctf_integer(u64, ref_root, full_ref->root) | |
723 | ctf_integer(int, level, full_ref->level) | |
724 | ctf_integer(int, type, ref->type) | |
725 | ctf_integer(u64, seq, ref->seq) | |
726 | ) | |
727 | ) | |
fde8b34a | 728 | |
cba6ec2e MD |
729 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref, |
730 | ||
731 | add_delayed_tree_ref, | |
732 | ||
733 | btrfs_add_delayed_tree_ref, | |
fde8b34a MJ |
734 | |
735 | TP_PROTO(const struct btrfs_fs_info *fs_info, | |
736 | const struct btrfs_delayed_ref_node *ref, | |
737 | const struct btrfs_delayed_tree_ref *full_ref, | |
738 | int action), | |
739 | ||
740 | TP_ARGS(fs_info, ref, full_ref, action) | |
741 | ) | |
742 | ||
cba6ec2e MD |
743 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref, |
744 | ||
745 | run_delayed_tree_ref, | |
746 | ||
747 | btrfs_run_delayed_tree_ref, | |
fde8b34a MJ |
748 | |
749 | TP_PROTO(const struct btrfs_fs_info *fs_info, | |
750 | const struct btrfs_delayed_ref_node *ref, | |
751 | const struct btrfs_delayed_tree_ref *full_ref, | |
752 | int action), | |
753 | ||
754 | TP_ARGS(fs_info, ref, full_ref, action) | |
755 | ) | |
1f1ec4ed | 756 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) |
fde8b34a | 757 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_tree_ref, |
fcd0a11c MD |
758 | |
759 | TP_PROTO(struct btrfs_fs_info *fs_info, | |
760 | struct btrfs_delayed_ref_node *ref, | |
761 | struct btrfs_delayed_tree_ref *full_ref, | |
762 | int action), | |
763 | ||
764 | TP_ARGS(fs_info, ref, full_ref, action), | |
765 | ||
766 | TP_FIELDS( | |
fde8b34a | 767 | ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE) |
fcd0a11c MD |
768 | ctf_integer(u64, bytenr, ref->bytenr) |
769 | ctf_integer(u64, num_bytes, ref->num_bytes) | |
770 | ctf_integer(int, action, action) | |
771 | ctf_integer(u64, parent, full_ref->parent) | |
772 | ctf_integer(u64, ref_root, full_ref->root) | |
773 | ctf_integer(int, level, full_ref->level) | |
774 | ctf_integer(int, type, ref->type) | |
775 | ctf_integer(u64, seq, ref->seq) | |
776 | ) | |
777 | ) | |
fde8b34a | 778 | |
cba6ec2e MD |
779 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref, |
780 | ||
781 | add_delayed_tree_ref, | |
782 | ||
783 | btrfs_add_delayed_tree_ref, | |
fde8b34a MJ |
784 | |
785 | TP_PROTO(struct btrfs_fs_info *fs_info, | |
786 | struct btrfs_delayed_ref_node *ref, | |
787 | struct btrfs_delayed_tree_ref *full_ref, | |
788 | int action), | |
789 | ||
790 | TP_ARGS(fs_info, ref, full_ref, action) | |
791 | ) | |
792 | ||
cba6ec2e MD |
793 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref, |
794 | ||
795 | run_delayed_tree_ref, | |
796 | ||
797 | btrfs_run_delayed_tree_ref, | |
fde8b34a MJ |
798 | |
799 | TP_PROTO(struct btrfs_fs_info *fs_info, | |
800 | struct btrfs_delayed_ref_node *ref, | |
801 | struct btrfs_delayed_tree_ref *full_ref, | |
802 | int action), | |
803 | ||
804 | TP_ARGS(fs_info, ref, full_ref, action) | |
805 | ) | |
0badc02f MJ |
806 | #elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,92,0,0, 4,5,0,0,0,0)) |
807 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_tree_ref, | |
808 | ||
809 | TP_PROTO(const struct btrfs_delayed_ref_node *ref, | |
810 | const struct btrfs_delayed_tree_ref *full_ref, | |
811 | int action), | |
812 | ||
813 | TP_ARGS(ref, full_ref, action), | |
814 | ||
815 | TP_FIELDS( | |
816 | ctf_integer(u64, bytenr, ref->bytenr) | |
817 | ctf_integer(u64, num_bytes, ref->num_bytes) | |
818 | ctf_integer(int, action, action) | |
819 | ctf_integer(u64, parent, full_ref->parent) | |
820 | ctf_integer(u64, ref_root, full_ref->root) | |
821 | ctf_integer(int, level, full_ref->level) | |
822 | ctf_integer(int, type, ref->type) | |
823 | ctf_integer(u64, seq, ref->seq) | |
824 | ) | |
825 | ) | |
826 | ||
cba6ec2e MD |
827 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref, |
828 | ||
829 | add_delayed_tree_ref, | |
830 | ||
831 | btrfs_add_delayed_tree_ref, | |
0badc02f MJ |
832 | |
833 | TP_PROTO(const struct btrfs_delayed_ref_node *ref, | |
834 | const struct btrfs_delayed_tree_ref *full_ref, | |
835 | int action), | |
836 | ||
837 | TP_ARGS(ref, full_ref, action) | |
838 | ) | |
839 | ||
cba6ec2e MD |
840 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref, |
841 | ||
842 | run_delayed_tree_ref, | |
843 | ||
844 | btrfs_run_delayed_tree_ref, | |
0badc02f MJ |
845 | |
846 | TP_PROTO(const struct btrfs_delayed_ref_node *ref, | |
847 | const struct btrfs_delayed_tree_ref *full_ref, | |
848 | int action), | |
849 | ||
850 | TP_ARGS(ref, full_ref, action) | |
851 | ) | |
fde8b34a MJ |
852 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
853 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_tree_ref, | |
854 | ||
855 | TP_PROTO(struct btrfs_delayed_ref_node *ref, | |
856 | struct btrfs_delayed_tree_ref *full_ref, | |
857 | int action), | |
858 | ||
859 | TP_ARGS(ref, full_ref, action), | |
860 | ||
861 | TP_FIELDS( | |
862 | ctf_integer(u64, bytenr, ref->bytenr) | |
863 | ctf_integer(u64, num_bytes, ref->num_bytes) | |
864 | ctf_integer(int, action, action) | |
865 | ctf_integer(u64, parent, full_ref->parent) | |
866 | ctf_integer(u64, ref_root, full_ref->root) | |
867 | ctf_integer(int, level, full_ref->level) | |
868 | ctf_integer(int, type, ref->type) | |
869 | ctf_integer(u64, seq, ref->seq) | |
870 | ) | |
871 | ) | |
872 | ||
cba6ec2e MD |
873 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref, |
874 | ||
875 | add_delayed_tree_ref, | |
876 | ||
877 | btrfs_add_delayed_tree_ref, | |
fde8b34a MJ |
878 | |
879 | TP_PROTO(struct btrfs_delayed_ref_node *ref, | |
880 | struct btrfs_delayed_tree_ref *full_ref, | |
881 | int action), | |
882 | ||
883 | TP_ARGS(ref, full_ref, action) | |
884 | ) | |
885 | ||
cba6ec2e MD |
886 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref, |
887 | ||
888 | run_delayed_tree_ref, | |
889 | ||
890 | btrfs_run_delayed_tree_ref, | |
fde8b34a MJ |
891 | |
892 | TP_PROTO(struct btrfs_delayed_ref_node *ref, | |
893 | struct btrfs_delayed_tree_ref *full_ref, | |
894 | int action), | |
895 | ||
896 | TP_ARGS(ref, full_ref, action) | |
897 | ) | |
898 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)) | |
3bc29f0a | 899 | LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref, |
b87700e3 AG |
900 | |
901 | TP_PROTO(struct btrfs_delayed_ref_node *ref, | |
902 | struct btrfs_delayed_tree_ref *full_ref, | |
903 | int action), | |
904 | ||
905 | TP_ARGS(ref, full_ref, action), | |
906 | ||
f127e61e MD |
907 | TP_FIELDS( |
908 | ctf_integer(u64, bytenr, ref->bytenr) | |
909 | ctf_integer(u64, num_bytes, ref->num_bytes) | |
910 | ctf_integer(int, action, action) | |
911 | ctf_integer(u64, parent, full_ref->parent) | |
912 | ctf_integer(u64, ref_root, full_ref->root) | |
913 | ctf_integer(int, level, full_ref->level) | |
914 | ctf_integer(int, type, ref->type) | |
f127e61e | 915 | ctf_integer(u64, seq, ref->seq) |
fde8b34a MJ |
916 | ) |
917 | ) | |
918 | #else | |
919 | LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref, | |
920 | ||
921 | TP_PROTO(struct btrfs_delayed_ref_node *ref, | |
922 | struct btrfs_delayed_tree_ref *full_ref, | |
923 | int action), | |
924 | ||
925 | TP_ARGS(ref, full_ref, action), | |
926 | ||
927 | TP_FIELDS( | |
928 | ctf_integer(u64, bytenr, ref->bytenr) | |
929 | ctf_integer(u64, num_bytes, ref->num_bytes) | |
930 | ctf_integer(int, action, action) | |
931 | ctf_integer(u64, parent, full_ref->parent) | |
932 | ctf_integer(u64, ref_root, full_ref->root) | |
933 | ctf_integer(int, level, full_ref->level) | |
934 | ctf_integer(int, type, ref->type) | |
f127e61e | 935 | ) |
b87700e3 | 936 | ) |
fcd0a11c | 937 | #endif |
b87700e3 | 938 | |
0badc02f MJ |
939 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ |
940 | LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ | |
941 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ | |
942 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ | |
943 | LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,103,7,0,0) || \ | |
944 | LTTNG_SLE_KERNEL_RANGE(4,4,114,94,0,0, 4,4,114,95,0,0) || \ | |
945 | LTTNG_SLE_KERNEL_RANGE(4,4,120,94,0,0, 4,4,120,95,0,0) || \ | |
946 | LTTNG_SLE_KERNEL_RANGE(4,4,126,94,0,0, 4,5,0,0,0,0)) | |
fde8b34a MJ |
947 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_data_ref, |
948 | ||
949 | TP_PROTO(const struct btrfs_fs_info *fs_info, | |
950 | const struct btrfs_delayed_ref_node *ref, | |
951 | const struct btrfs_delayed_data_ref *full_ref, | |
952 | int action), | |
953 | ||
954 | TP_ARGS(fs_info, ref, full_ref, action), | |
955 | ||
956 | TP_FIELDS( | |
957 | ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE) | |
958 | ctf_integer(u64, bytenr, ref->bytenr) | |
959 | ctf_integer(u64, num_bytes, ref->num_bytes) | |
960 | ctf_integer(int, action, action) | |
961 | ctf_integer(u64, parent, full_ref->parent) | |
962 | ctf_integer(u64, ref_root, full_ref->root) | |
963 | ctf_integer(u64, owner, full_ref->objectid) | |
964 | ctf_integer(u64, offset, full_ref->offset) | |
965 | ctf_integer(int, type, ref->type) | |
966 | ctf_integer(u64, seq, ref->seq) | |
967 | ) | |
968 | ) | |
969 | ||
cba6ec2e MD |
970 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref, |
971 | ||
972 | add_delayed_data_ref, | |
973 | ||
974 | btrfs_add_delayed_data_ref, | |
fde8b34a MJ |
975 | |
976 | TP_PROTO(const struct btrfs_fs_info *fs_info, | |
977 | const struct btrfs_delayed_ref_node *ref, | |
978 | const struct btrfs_delayed_data_ref *full_ref, | |
979 | int action), | |
980 | ||
981 | TP_ARGS(fs_info, ref, full_ref, action) | |
982 | ) | |
983 | ||
cba6ec2e MD |
984 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref, |
985 | ||
986 | run_delayed_data_ref, | |
987 | ||
988 | btrfs_run_delayed_data_ref, | |
fde8b34a MJ |
989 | |
990 | TP_PROTO(const struct btrfs_fs_info *fs_info, | |
991 | const struct btrfs_delayed_ref_node *ref, | |
992 | const struct btrfs_delayed_data_ref *full_ref, | |
993 | int action), | |
994 | ||
995 | TP_ARGS(fs_info, ref, full_ref, action) | |
996 | ) | |
997 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) | |
998 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_data_ref, | |
999 | ||
1000 | TP_PROTO(struct btrfs_fs_info *fs_info, | |
1001 | struct btrfs_delayed_ref_node *ref, | |
1002 | struct btrfs_delayed_data_ref *full_ref, | |
1003 | int action), | |
1004 | ||
1005 | TP_ARGS(fs_info, ref, full_ref, action), | |
1006 | ||
1007 | TP_FIELDS( | |
1008 | ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE) | |
1009 | ctf_integer(u64, bytenr, ref->bytenr) | |
1010 | ctf_integer(u64, num_bytes, ref->num_bytes) | |
1011 | ctf_integer(int, action, action) | |
1012 | ctf_integer(u64, parent, full_ref->parent) | |
1013 | ctf_integer(u64, ref_root, full_ref->root) | |
1014 | ctf_integer(u64, owner, full_ref->objectid) | |
1015 | ctf_integer(u64, offset, full_ref->offset) | |
1016 | ctf_integer(int, type, ref->type) | |
1017 | ctf_integer(u64, seq, ref->seq) | |
1018 | ) | |
1019 | ) | |
1020 | ||
cba6ec2e MD |
1021 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref, |
1022 | ||
1023 | add_delayed_data_ref, | |
1024 | ||
1025 | btrfs_add_delayed_data_ref, | |
fde8b34a MJ |
1026 | |
1027 | TP_PROTO(struct btrfs_fs_info *fs_info, | |
1028 | struct btrfs_delayed_ref_node *ref, | |
1029 | struct btrfs_delayed_data_ref *full_ref, | |
1030 | int action), | |
1031 | ||
1032 | TP_ARGS(fs_info, ref, full_ref, action) | |
1033 | ) | |
1034 | ||
cba6ec2e MD |
1035 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref, |
1036 | ||
1037 | run_delayed_data_ref, | |
1038 | ||
1039 | btrfs_run_delayed_data_ref, | |
fde8b34a MJ |
1040 | |
1041 | TP_PROTO(struct btrfs_fs_info *fs_info, | |
1042 | struct btrfs_delayed_ref_node *ref, | |
1043 | struct btrfs_delayed_data_ref *full_ref, | |
1044 | int action), | |
1045 | ||
1046 | TP_ARGS(fs_info, ref, full_ref, action) | |
1047 | ) | |
0badc02f MJ |
1048 | #elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,92,0,0, 4,5,0,0,0,0)) |
1049 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_data_ref, | |
1050 | ||
1051 | TP_PROTO(const struct btrfs_delayed_ref_node *ref, | |
1052 | const struct btrfs_delayed_data_ref *full_ref, | |
1053 | int action), | |
1054 | ||
1055 | TP_ARGS(ref, full_ref, action), | |
1056 | ||
1057 | TP_FIELDS( | |
1058 | ctf_integer(u64, bytenr, ref->bytenr) | |
1059 | ctf_integer(u64, num_bytes, ref->num_bytes) | |
1060 | ctf_integer(int, action, action) | |
1061 | ctf_integer(u64, parent, full_ref->parent) | |
1062 | ctf_integer(u64, ref_root, full_ref->root) | |
1063 | ctf_integer(u64, owner, full_ref->objectid) | |
1064 | ctf_integer(u64, offset, full_ref->offset) | |
1065 | ctf_integer(int, type, ref->type) | |
1066 | ctf_integer(u64, seq, ref->seq) | |
1067 | ) | |
1068 | ) | |
1069 | ||
cba6ec2e MD |
1070 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref, |
1071 | ||
1072 | add_delayed_data_ref, | |
1073 | ||
1074 | btrfs_add_delayed_data_ref, | |
0badc02f MJ |
1075 | |
1076 | TP_PROTO(const struct btrfs_delayed_ref_node *ref, | |
1077 | const struct btrfs_delayed_data_ref *full_ref, | |
1078 | int action), | |
1079 | ||
1080 | TP_ARGS(fs_info, ref, full_ref, action) | |
1081 | ) | |
1082 | ||
cba6ec2e MD |
1083 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref, |
1084 | ||
1085 | run_delayed_data_ref, | |
1086 | ||
1087 | btrfs_run_delayed_data_ref, | |
0badc02f MJ |
1088 | |
1089 | TP_PROTO(const struct btrfs_delayed_ref_node *ref, | |
1090 | const struct btrfs_delayed_data_ref *full_ref, | |
1091 | int action), | |
1092 | ||
1093 | TP_ARGS(fs_info, ref, full_ref, action) | |
1094 | ) | |
fde8b34a MJ |
1095 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
1096 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_data_ref, | |
1097 | ||
1098 | TP_PROTO(struct btrfs_delayed_ref_node *ref, | |
1099 | struct btrfs_delayed_data_ref *full_ref, | |
1100 | int action), | |
1101 | ||
1102 | TP_ARGS(ref, full_ref, action), | |
1103 | ||
1104 | TP_FIELDS( | |
1105 | ctf_integer(u64, bytenr, ref->bytenr) | |
1106 | ctf_integer(u64, num_bytes, ref->num_bytes) | |
1107 | ctf_integer(int, action, action) | |
1108 | ctf_integer(u64, parent, full_ref->parent) | |
1109 | ctf_integer(u64, ref_root, full_ref->root) | |
1110 | ctf_integer(u64, owner, full_ref->objectid) | |
1111 | ctf_integer(u64, offset, full_ref->offset) | |
1112 | ctf_integer(int, type, ref->type) | |
1113 | ctf_integer(u64, seq, ref->seq) | |
1114 | ) | |
1115 | ) | |
1116 | ||
cba6ec2e MD |
1117 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref, |
1118 | ||
1119 | add_delayed_data_ref, | |
1120 | ||
1121 | btrfs_add_delayed_data_ref, | |
fde8b34a MJ |
1122 | |
1123 | TP_PROTO(struct btrfs_delayed_ref_node *ref, | |
1124 | struct btrfs_delayed_data_ref *full_ref, | |
1125 | int action), | |
1126 | ||
1127 | TP_ARGS(fs_info, ref, full_ref, action) | |
1128 | ) | |
1129 | ||
cba6ec2e MD |
1130 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref, |
1131 | ||
1132 | run_delayed_data_ref, | |
1133 | ||
1134 | btrfs_run_delayed_data_ref, | |
fde8b34a MJ |
1135 | |
1136 | TP_PROTO(struct btrfs_delayed_ref_node *ref, | |
1137 | struct btrfs_delayed_data_ref *full_ref, | |
1138 | int action), | |
1139 | ||
1140 | TP_ARGS(fs_info, ref, full_ref, action) | |
1141 | ) | |
1142 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)) | |
3bc29f0a | 1143 | LTTNG_TRACEPOINT_EVENT(btrfs_delayed_data_ref, |
b87700e3 AG |
1144 | |
1145 | TP_PROTO(struct btrfs_delayed_ref_node *ref, | |
1146 | struct btrfs_delayed_data_ref *full_ref, | |
1147 | int action), | |
1148 | ||
1149 | TP_ARGS(ref, full_ref, action), | |
1150 | ||
f127e61e MD |
1151 | TP_FIELDS( |
1152 | ctf_integer(u64, bytenr, ref->bytenr) | |
1153 | ctf_integer(u64, num_bytes, ref->num_bytes) | |
1154 | ctf_integer(int, action, action) | |
1155 | ctf_integer(u64, parent, full_ref->parent) | |
1156 | ctf_integer(u64, ref_root, full_ref->root) | |
1157 | ctf_integer(u64, owner, full_ref->objectid) | |
1158 | ctf_integer(u64, offset, full_ref->offset) | |
1159 | ctf_integer(int, type, ref->type) | |
f127e61e | 1160 | ctf_integer(u64, seq, ref->seq) |
f127e61e | 1161 | ) |
b87700e3 | 1162 | ) |
fde8b34a MJ |
1163 | #else |
1164 | LTTNG_TRACEPOINT_EVENT(btrfs_delayed_data_ref, | |
1165 | ||
1166 | TP_PROTO(struct btrfs_delayed_ref_node *ref, | |
1167 | struct btrfs_delayed_data_ref *full_ref, | |
1168 | int action), | |
1169 | ||
1170 | TP_ARGS(ref, full_ref, action), | |
1171 | ||
1172 | TP_FIELDS( | |
1173 | ctf_integer(u64, bytenr, ref->bytenr) | |
1174 | ctf_integer(u64, num_bytes, ref->num_bytes) | |
1175 | ctf_integer(int, action, action) | |
1176 | ctf_integer(u64, parent, full_ref->parent) | |
1177 | ctf_integer(u64, ref_root, full_ref->root) | |
1178 | ctf_integer(u64, owner, full_ref->objectid) | |
1179 | ctf_integer(u64, offset, full_ref->offset) | |
1180 | ctf_integer(int, type, ref->type) | |
1181 | ) | |
1182 | ) | |
1183 | #endif | |
b87700e3 | 1184 | |
ab9ebe67 MJ |
1185 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) |
1186 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head, | |
1187 | ||
1188 | TP_PROTO(const struct btrfs_fs_info *fs_info, | |
1189 | const struct btrfs_delayed_ref_head *head_ref, | |
1190 | int action), | |
1191 | ||
1192 | TP_ARGS(fs_info, head_ref, action), | |
1193 | ||
1194 | TP_FIELDS( | |
1195 | ctf_integer(u64, bytenr, head_ref->bytenr) | |
1196 | ctf_integer(u64, num_bytes, head_ref->num_bytes) | |
1197 | ctf_integer(int, action, action) | |
1198 | ctf_integer(int, is_data, head_ref->is_data) | |
1199 | ) | |
1200 | ) | |
1201 | ||
d7921a5f MD |
1202 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, |
1203 | ||
1204 | add_delayed_ref_head, | |
1205 | ||
1206 | btrfs_add_delayed_ref_head, | |
ab9ebe67 MJ |
1207 | |
1208 | TP_PROTO(const struct btrfs_fs_info *fs_info, | |
1209 | const struct btrfs_delayed_ref_head *head_ref, | |
1210 | int action), | |
1211 | ||
1212 | TP_ARGS(fs_info, head_ref, action) | |
1213 | ) | |
1214 | ||
d7921a5f MD |
1215 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, |
1216 | ||
1217 | run_delayed_ref_head, | |
1218 | ||
1219 | btrfs_run_delayed_ref_head, | |
ab9ebe67 MJ |
1220 | |
1221 | TP_PROTO(const struct btrfs_fs_info *fs_info, | |
1222 | const struct btrfs_delayed_ref_head *head_ref, | |
1223 | int action), | |
1224 | ||
1225 | TP_ARGS(fs_info, head_ref, action) | |
1226 | ) | |
1227 | ||
7ca7cd6e | 1228 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ |
0badc02f MJ |
1229 | LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
1230 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ | |
1231 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ | |
1232 | LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,103,7,0,0) || \ | |
1233 | LTTNG_SLE_KERNEL_RANGE(4,4,114,94,0,0, 4,4,114,95,0,0) || \ | |
1234 | LTTNG_SLE_KERNEL_RANGE(4,4,120,94,0,0, 4,4,120,95,0,0) || \ | |
1235 | LTTNG_SLE_KERNEL_RANGE(4,4,126,94,0,0, 4,5,0,0,0,0)) | |
1236 | ||
ab9ebe67 MJ |
1237 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head, |
1238 | ||
1239 | TP_PROTO(const struct btrfs_fs_info *fs_info, | |
1240 | const struct btrfs_delayed_ref_node *ref, | |
1241 | const struct btrfs_delayed_ref_head *head_ref, | |
1242 | int action), | |
1243 | ||
1244 | TP_ARGS(fs_info, ref, head_ref, action), | |
1245 | ||
1246 | TP_FIELDS( | |
1247 | ctf_integer(u64, bytenr, ref->bytenr) | |
1248 | ctf_integer(u64, num_bytes, ref->num_bytes) | |
1249 | ctf_integer(int, action, action) | |
1250 | ctf_integer(int, is_data, head_ref->is_data) | |
1251 | ) | |
1252 | ) | |
1253 | ||
d7921a5f MD |
1254 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, |
1255 | ||
1256 | add_delayed_ref_head, | |
1257 | ||
1258 | btrfs_add_delayed_ref_head, | |
ab9ebe67 MJ |
1259 | |
1260 | TP_PROTO(const struct btrfs_fs_info *fs_info, | |
1261 | const struct btrfs_delayed_ref_node *ref, | |
1262 | const struct btrfs_delayed_ref_head *head_ref, | |
1263 | int action), | |
1264 | ||
1265 | TP_ARGS(fs_info, ref, head_ref, action) | |
1266 | ) | |
1267 | ||
d7921a5f MD |
1268 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, |
1269 | ||
1270 | run_delayed_ref_head, | |
1271 | ||
1272 | btrfs_run_delayed_ref_head, | |
ab9ebe67 MJ |
1273 | |
1274 | TP_PROTO(const struct btrfs_fs_info *fs_info, | |
1275 | const struct btrfs_delayed_ref_node *ref, | |
1276 | const struct btrfs_delayed_ref_head *head_ref, | |
1277 | int action), | |
1278 | ||
1279 | TP_ARGS(fs_info, ref, head_ref, action) | |
1280 | ) | |
1281 | ||
1282 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) | |
1283 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head, | |
fcd0a11c MD |
1284 | |
1285 | TP_PROTO(struct btrfs_fs_info *fs_info, | |
1286 | struct btrfs_delayed_ref_node *ref, | |
1287 | struct btrfs_delayed_ref_head *head_ref, | |
1288 | int action), | |
1289 | ||
1290 | TP_ARGS(fs_info, ref, head_ref, action), | |
1291 | ||
1292 | TP_FIELDS( | |
1293 | ctf_integer(u64, bytenr, ref->bytenr) | |
1294 | ctf_integer(u64, num_bytes, ref->num_bytes) | |
1295 | ctf_integer(int, action, action) | |
1296 | ctf_integer(int, is_data, head_ref->is_data) | |
1297 | ) | |
1298 | ) | |
1299 | ||
d7921a5f MD |
1300 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, |
1301 | ||
1302 | add_delayed_ref_head, | |
1303 | ||
1304 | btrfs_add_delayed_ref_head, | |
ab9ebe67 MJ |
1305 | |
1306 | TP_PROTO(struct btrfs_fs_info *fs_info, | |
1307 | struct btrfs_delayed_ref_node *ref, | |
1308 | struct btrfs_delayed_ref_head *head_ref, | |
1309 | int action), | |
1310 | ||
1311 | TP_ARGS(fs_info, ref, head_ref, action) | |
1312 | ) | |
1313 | ||
d7921a5f MD |
1314 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, |
1315 | ||
1316 | run_delayed_ref_head, | |
1317 | ||
1318 | btrfs_run_delayed_ref_head, | |
ab9ebe67 MJ |
1319 | |
1320 | TP_PROTO(struct btrfs_fs_info *fs_info, | |
1321 | struct btrfs_delayed_ref_node *ref, | |
1322 | struct btrfs_delayed_ref_head *head_ref, | |
1323 | int action), | |
1324 | ||
1325 | TP_ARGS(fs_info, ref, head_ref, action) | |
1326 | ) | |
1327 | ||
0badc02f | 1328 | #elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,92,0,0, 4,5,0,0,0,0)) |
0b3f6dcb MJ |
1329 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head, |
1330 | ||
1331 | TP_PROTO(const struct btrfs_delayed_ref_node *ref, | |
1332 | const struct btrfs_delayed_ref_head *head_ref, | |
1333 | int action), | |
1334 | ||
1335 | TP_ARGS(ref, head_ref, action), | |
1336 | ||
1337 | TP_FIELDS( | |
1338 | ctf_integer(u64, bytenr, ref->bytenr) | |
1339 | ctf_integer(u64, num_bytes, ref->num_bytes) | |
1340 | ctf_integer(int, action, action) | |
1341 | ctf_integer(int, is_data, head_ref->is_data) | |
1342 | ) | |
1343 | ) | |
1344 | ||
d7921a5f MD |
1345 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, |
1346 | ||
1347 | add_delayed_ref_head, | |
1348 | ||
1349 | btrfs_add_delayed_ref_head, | |
0b3f6dcb MJ |
1350 | |
1351 | TP_PROTO(const struct btrfs_delayed_ref_node *ref, | |
1352 | const struct btrfs_delayed_ref_head *head_ref, | |
1353 | int action), | |
1354 | ||
1355 | TP_ARGS(ref, head_ref, action) | |
1356 | ) | |
1357 | ||
d7921a5f MD |
1358 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, |
1359 | ||
1360 | run_delayed_ref_head, | |
1361 | ||
1362 | btrfs_run_delayed_ref_head, | |
0b3f6dcb MJ |
1363 | |
1364 | TP_PROTO(const struct btrfs_delayed_ref_node *ref, | |
1365 | const struct btrfs_delayed_ref_head *head_ref, | |
1366 | int action), | |
1367 | ||
1368 | TP_ARGS(ref, head_ref, action) | |
1369 | ) | |
1370 | ||
ab9ebe67 MJ |
1371 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
1372 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head, | |
1373 | ||
1374 | TP_PROTO(struct btrfs_delayed_ref_node *ref, | |
1375 | struct btrfs_delayed_ref_head *head_ref, | |
1376 | int action), | |
1377 | ||
1378 | TP_ARGS(ref, head_ref, action), | |
1379 | ||
1380 | TP_FIELDS( | |
1381 | ctf_integer(u64, bytenr, ref->bytenr) | |
1382 | ctf_integer(u64, num_bytes, ref->num_bytes) | |
1383 | ctf_integer(int, action, action) | |
1384 | ctf_integer(int, is_data, head_ref->is_data) | |
1385 | ) | |
1386 | ) | |
1387 | ||
d7921a5f MD |
1388 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, |
1389 | ||
1390 | add_delayed_ref_head, | |
1391 | ||
1392 | btrfs_add_delayed_ref_head, | |
ab9ebe67 MJ |
1393 | |
1394 | TP_PROTO(struct btrfs_delayed_ref_node *ref, | |
1395 | struct btrfs_delayed_ref_head *head_ref, | |
1396 | int action), | |
1397 | ||
1398 | TP_ARGS(ref, head_ref, action) | |
1399 | ) | |
1400 | ||
d7921a5f MD |
1401 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, |
1402 | ||
1403 | run_delayed_ref_head, | |
1404 | ||
1405 | btrfs_run_delayed_ref_head, | |
ab9ebe67 MJ |
1406 | |
1407 | TP_PROTO(struct btrfs_delayed_ref_node *ref, | |
1408 | struct btrfs_delayed_ref_head *head_ref, | |
1409 | int action), | |
1410 | ||
1411 | TP_ARGS(ref, head_ref, action) | |
1412 | ) | |
1413 | ||
fcd0a11c | 1414 | #else |
3bc29f0a | 1415 | LTTNG_TRACEPOINT_EVENT(btrfs_delayed_ref_head, |
b87700e3 AG |
1416 | |
1417 | TP_PROTO(struct btrfs_delayed_ref_node *ref, | |
1418 | struct btrfs_delayed_ref_head *head_ref, | |
1419 | int action), | |
1420 | ||
1421 | TP_ARGS(ref, head_ref, action), | |
1422 | ||
f127e61e MD |
1423 | TP_FIELDS( |
1424 | ctf_integer(u64, bytenr, ref->bytenr) | |
1425 | ctf_integer(u64, num_bytes, ref->num_bytes) | |
1426 | ctf_integer(int, action, action) | |
1427 | ctf_integer(int, is_data, head_ref->is_data) | |
1428 | ) | |
b87700e3 | 1429 | ) |
fcd0a11c | 1430 | #endif |
b87700e3 | 1431 | |
1f1ec4ed MJ |
1432 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) |
1433 | ||
1434 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk, | |
1435 | ||
1436 | TP_PROTO(const struct btrfs_fs_info *fs_info, const struct map_lookup *map, | |
1437 | u64 offset, u64 size), | |
1438 | ||
1439 | TP_ARGS(fs_info, map, offset, size), | |
1440 | ||
1441 | TP_FIELDS( | |
1442 | ctf_integer(int, num_stripes, map->num_stripes) | |
1443 | ctf_integer(u64, type, map->type) | |
1444 | ctf_integer(int, sub_stripes, map->sub_stripes) | |
1445 | ctf_integer(u64, offset, offset) | |
1446 | ctf_integer(u64, size, size) | |
1447 | ctf_integer(u64, root_objectid, fs_info->chunk_root->root_key.objectid) | |
1448 | ) | |
1449 | ) | |
1450 | ||
1451 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc, | |
1452 | ||
1453 | TP_PROTO(const struct btrfs_fs_info *info, const struct map_lookup *map, | |
1454 | u64 offset, u64 size), | |
1455 | ||
1456 | TP_ARGS(info, map, offset, size) | |
1457 | ) | |
1458 | ||
1459 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free, | |
1460 | ||
1461 | TP_PROTO(const struct btrfs_fs_info *info, const struct map_lookup *map, | |
1462 | u64 offset, u64 size), | |
1463 | ||
1464 | TP_ARGS(info, map, offset, size) | |
1465 | ) | |
1466 | ||
1467 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
ff8bdcc2 MD |
1468 | |
1469 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk, | |
1470 | ||
1471 | TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map, | |
1472 | u64 offset, u64 size), | |
1473 | ||
1474 | TP_ARGS(fs_info, map, offset, size), | |
1475 | ||
1476 | TP_FIELDS( | |
1477 | ctf_integer(int, num_stripes, map->num_stripes) | |
1478 | ctf_integer(u64, type, map->type) | |
1479 | ctf_integer(int, sub_stripes, map->sub_stripes) | |
1480 | ctf_integer(u64, offset, offset) | |
1481 | ctf_integer(u64, size, size) | |
1482 | ctf_integer(u64, root_objectid, fs_info->chunk_root->root_key.objectid) | |
1483 | ) | |
1484 | ) | |
1485 | ||
1486 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc, | |
1487 | ||
1488 | TP_PROTO(struct btrfs_fs_info *info, struct map_lookup *map, | |
1489 | u64 offset, u64 size), | |
1490 | ||
1491 | TP_ARGS(info, map, offset, size) | |
1492 | ) | |
1493 | ||
1494 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free, | |
1495 | ||
1496 | TP_PROTO(struct btrfs_fs_info *info, struct map_lookup *map, | |
1497 | u64 offset, u64 size), | |
1498 | ||
1499 | TP_ARGS(info, map, offset, size) | |
1500 | ) | |
1501 | ||
0badc02f MJ |
1502 | #elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
1503 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ | |
1504 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ | |
1505 | LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) | |
7ca7cd6e MJ |
1506 | |
1507 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk, | |
1508 | ||
1509 | TP_PROTO(const struct btrfs_root *root, const struct map_lookup *map, | |
1510 | u64 offset, u64 size), | |
1511 | ||
1512 | TP_ARGS(root, map, offset, size), | |
1513 | ||
1514 | TP_FIELDS( | |
1515 | ctf_integer(int, num_stripes, map->num_stripes) | |
1516 | ctf_integer(u64, type, map->type) | |
1517 | ctf_integer(int, sub_stripes, map->sub_stripes) | |
1518 | ctf_integer(u64, offset, offset) | |
1519 | ctf_integer(u64, size, size) | |
1520 | ctf_integer(u64, root_objectid, root->root_key.objectid) | |
1521 | ) | |
1522 | ) | |
1523 | ||
1524 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc, | |
1525 | ||
1526 | TP_PROTO(const struct btrfs_root *root, const struct map_lookup *map, | |
1527 | u64 offset, u64 size), | |
1528 | ||
1529 | TP_ARGS(root, map, offset, size) | |
1530 | ) | |
1531 | ||
1532 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free, | |
1533 | ||
1534 | TP_PROTO(const struct btrfs_root *root, const struct map_lookup *map, | |
1535 | u64 offset, u64 size), | |
1536 | ||
1537 | TP_ARGS(root, map, offset, size) | |
1538 | ) | |
1539 | ||
ff8bdcc2 MD |
1540 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ |
1541 | ||
3bc29f0a | 1542 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk, |
b87700e3 AG |
1543 | |
1544 | TP_PROTO(struct btrfs_root *root, struct map_lookup *map, | |
1545 | u64 offset, u64 size), | |
1546 | ||
1547 | TP_ARGS(root, map, offset, size), | |
1548 | ||
f127e61e MD |
1549 | TP_FIELDS( |
1550 | ctf_integer(int, num_stripes, map->num_stripes) | |
1551 | ctf_integer(u64, type, map->type) | |
1552 | ctf_integer(int, sub_stripes, map->sub_stripes) | |
1553 | ctf_integer(u64, offset, offset) | |
1554 | ctf_integer(u64, size, size) | |
1555 | ctf_integer(u64, root_objectid, root->root_key.objectid) | |
1556 | ) | |
b87700e3 AG |
1557 | ) |
1558 | ||
3bc29f0a | 1559 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc, |
b87700e3 AG |
1560 | |
1561 | TP_PROTO(struct btrfs_root *root, struct map_lookup *map, | |
1562 | u64 offset, u64 size), | |
1563 | ||
1564 | TP_ARGS(root, map, offset, size) | |
1565 | ) | |
1566 | ||
3bc29f0a | 1567 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free, |
b87700e3 AG |
1568 | |
1569 | TP_PROTO(struct btrfs_root *root, struct map_lookup *map, | |
1570 | u64 offset, u64 size), | |
1571 | ||
1572 | TP_ARGS(root, map, offset, size) | |
1573 | ) | |
1574 | ||
ff8bdcc2 MD |
1575 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ |
1576 | ||
7ca7cd6e | 1577 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ |
0badc02f MJ |
1578 | LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
1579 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ | |
1580 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ | |
7ca7cd6e | 1581 | LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) |
1f1ec4ed MJ |
1582 | LTTNG_TRACEPOINT_EVENT(btrfs_cow_block, |
1583 | ||
1584 | TP_PROTO(const struct btrfs_root *root, const struct extent_buffer *buf, | |
1585 | const struct extent_buffer *cow), | |
1586 | ||
1587 | TP_ARGS(root, buf, cow), | |
1588 | ||
1589 | TP_FIELDS( | |
1590 | ctf_integer(u64, root_objectid, root->root_key.objectid) | |
1591 | ctf_integer(u64, buf_start, buf->start) | |
1592 | ctf_integer(int, refs, atomic_read(&buf->refs)) | |
1593 | ctf_integer(u64, cow_start, cow->start) | |
1594 | ctf_integer(int, buf_level, btrfs_header_level(buf)) | |
1595 | ctf_integer(int, cow_level, btrfs_header_level(cow)) | |
1596 | ) | |
1597 | ) | |
1598 | #else | |
3bc29f0a | 1599 | LTTNG_TRACEPOINT_EVENT(btrfs_cow_block, |
b87700e3 AG |
1600 | |
1601 | TP_PROTO(struct btrfs_root *root, struct extent_buffer *buf, | |
1602 | struct extent_buffer *cow), | |
1603 | ||
1604 | TP_ARGS(root, buf, cow), | |
1605 | ||
f127e61e MD |
1606 | TP_FIELDS( |
1607 | ctf_integer(u64, root_objectid, root->root_key.objectid) | |
1608 | ctf_integer(u64, buf_start, buf->start) | |
1609 | ctf_integer(int, refs, atomic_read(&buf->refs)) | |
1610 | ctf_integer(u64, cow_start, cow->start) | |
1611 | ctf_integer(int, buf_level, btrfs_header_level(buf)) | |
1612 | ctf_integer(int, cow_level, btrfs_header_level(cow)) | |
1613 | ) | |
b87700e3 | 1614 | ) |
1f1ec4ed | 1615 | #endif |
b87700e3 | 1616 | |
7ca7cd6e | 1617 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ |
0badc02f MJ |
1618 | LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
1619 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ | |
1620 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ | |
7ca7cd6e | 1621 | LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) |
1f1ec4ed MJ |
1622 | LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation, |
1623 | ||
1624 | TP_PROTO(const struct btrfs_fs_info *fs_info, char *type, u64 val, | |
1625 | u64 bytes, int reserve), | |
1626 | ||
1627 | TP_ARGS(fs_info, type, val, bytes, reserve), | |
1628 | ||
1629 | TP_FIELDS( | |
1630 | ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE) | |
1631 | ctf_string(type, type) | |
1632 | ctf_integer(u64, val, val) | |
1633 | ctf_integer(u64, bytes, bytes) | |
1634 | ctf_integer(int, reserve, reserve) | |
1635 | ) | |
1636 | ) | |
1637 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
3bc29f0a | 1638 | LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation, |
b87700e3 AG |
1639 | |
1640 | TP_PROTO(struct btrfs_fs_info *fs_info, char *type, u64 val, | |
1641 | u64 bytes, int reserve), | |
1642 | ||
1643 | TP_ARGS(fs_info, type, val, bytes, reserve), | |
1644 | ||
f127e61e MD |
1645 | TP_FIELDS( |
1646 | ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE) | |
1647 | ctf_string(type, type) | |
1648 | ctf_integer(u64, val, val) | |
1649 | ctf_integer(u64, bytes, bytes) | |
1650 | ctf_integer(int, reserve, reserve) | |
1651 | ) | |
b87700e3 AG |
1652 | ) |
1653 | #endif | |
1654 | ||
1f1ec4ed MJ |
1655 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) |
1656 | ||
1657 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, | |
1658 | ||
1659 | TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len), | |
1660 | ||
1661 | TP_ARGS(info, start, len), | |
1662 | ||
1663 | TP_FIELDS( | |
1664 | ctf_integer(u64, start, start) | |
1665 | ctf_integer(u64, len, len) | |
1666 | ) | |
1667 | ) | |
1668 | ||
1669 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc, | |
1670 | ||
1671 | TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len), | |
1672 | ||
1673 | TP_ARGS(info, start, len) | |
1674 | ) | |
1675 | ||
1676 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free, | |
1677 | ||
1678 | TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len), | |
1679 | ||
1680 | TP_ARGS(info, start, len) | |
1681 | ) | |
1682 | ||
1683 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
ff8bdcc2 MD |
1684 | |
1685 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, | |
1686 | ||
1687 | TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len), | |
1688 | ||
1689 | TP_ARGS(info, start, len), | |
1690 | ||
1691 | TP_FIELDS( | |
1692 | ctf_integer(u64, start, start) | |
1693 | ctf_integer(u64, len, len) | |
1694 | ) | |
1695 | ) | |
1696 | ||
1697 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc, | |
1698 | ||
1699 | TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len), | |
1700 | ||
1701 | TP_ARGS(info, start, len) | |
1702 | ) | |
1703 | ||
1704 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free, | |
1705 | ||
1706 | TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len), | |
1707 | ||
1708 | TP_ARGS(info, start, len) | |
1709 | ) | |
1710 | ||
0badc02f MJ |
1711 | #elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
1712 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ | |
1713 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ | |
1714 | LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) | |
7ca7cd6e MJ |
1715 | |
1716 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, | |
1717 | ||
1718 | TP_PROTO(const struct btrfs_root *root, u64 start, u64 len), | |
1719 | ||
1720 | TP_ARGS(root, start, len), | |
1721 | ||
1722 | TP_FIELDS( | |
1723 | ctf_integer(u64, root_objectid, root->root_key.objectid) | |
1724 | ctf_integer(u64, start, start) | |
1725 | ctf_integer(u64, len, len) | |
1726 | ) | |
1727 | ) | |
1728 | ||
1729 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc, | |
1730 | ||
1731 | TP_PROTO(const struct btrfs_root *root, u64 start, u64 len), | |
1732 | ||
1733 | TP_ARGS(root, start, len) | |
1734 | ) | |
1735 | ||
1736 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free, | |
1737 | ||
1738 | TP_PROTO(const struct btrfs_root *root, u64 start, u64 len), | |
1739 | ||
1740 | TP_ARGS(root, start, len) | |
1741 | ) | |
1742 | ||
ff8bdcc2 MD |
1743 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ |
1744 | ||
3bc29f0a | 1745 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, |
b87700e3 AG |
1746 | |
1747 | TP_PROTO(struct btrfs_root *root, u64 start, u64 len), | |
1748 | ||
1749 | TP_ARGS(root, start, len), | |
1750 | ||
f127e61e MD |
1751 | TP_FIELDS( |
1752 | ctf_integer(u64, root_objectid, root->root_key.objectid) | |
1753 | ctf_integer(u64, start, start) | |
1754 | ctf_integer(u64, len, len) | |
1755 | ) | |
b87700e3 AG |
1756 | ) |
1757 | ||
3bc29f0a | 1758 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc, |
b87700e3 AG |
1759 | |
1760 | TP_PROTO(struct btrfs_root *root, u64 start, u64 len), | |
1761 | ||
1762 | TP_ARGS(root, start, len) | |
1763 | ) | |
1764 | ||
3bc29f0a | 1765 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free, |
b87700e3 AG |
1766 | |
1767 | TP_PROTO(struct btrfs_root *root, u64 start, u64 len), | |
1768 | ||
1769 | TP_ARGS(root, start, len) | |
1770 | ) | |
1771 | ||
ff8bdcc2 MD |
1772 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ |
1773 | ||
51ab0b1d MJ |
1774 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0)) |
1775 | LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, | |
1776 | ||
1777 | btrfs_find_free_extent, | |
1778 | ||
1779 | TP_PROTO(const struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size, | |
1780 | u64 data), | |
1781 | ||
1782 | TP_ARGS(info, num_bytes, empty_size, data), | |
1783 | ||
1784 | TP_FIELDS( | |
1785 | ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE) | |
1786 | ctf_integer(u64, num_bytes, num_bytes) | |
1787 | ctf_integer(u64, empty_size, empty_size) | |
1788 | ctf_integer(u64, data, data) | |
1789 | ) | |
1790 | ) | |
1791 | ||
1792 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, | |
1793 | ||
1794 | TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start, | |
1795 | u64 len), | |
1796 | ||
1797 | TP_ARGS(block_group, start, len), | |
1798 | ||
1799 | TP_FIELDS( | |
1800 | ctf_array(u8, fsid, block_group->fs_info->fsid, BTRFS_UUID_SIZE) | |
1801 | ctf_integer(u64, bg_objectid, block_group->key.objectid) | |
1802 | ctf_integer(u64, flags, block_group->flags) | |
1803 | ctf_integer(u64, start, start) | |
1804 | ctf_integer(u64, len, len) | |
1805 | ) | |
1806 | ) | |
1807 | ||
1808 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent, | |
1809 | ||
1810 | TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start, | |
1811 | u64 len), | |
1812 | ||
1813 | TP_ARGS(block_group, start, len) | |
1814 | ) | |
1815 | ||
1816 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster, | |
1817 | ||
1818 | TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start, | |
1819 | u64 len), | |
1820 | ||
1821 | TP_ARGS(block_group, start, len) | |
1822 | ) | |
ff8bdcc2 | 1823 | |
51ab0b1d | 1824 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) |
1f1ec4ed MJ |
1825 | LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, |
1826 | ||
1827 | btrfs_find_free_extent, | |
1828 | ||
1829 | TP_PROTO(const struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size, | |
1830 | u64 data), | |
1831 | ||
1832 | TP_ARGS(info, num_bytes, empty_size, data), | |
1833 | ||
1834 | TP_FIELDS( | |
51ab0b1d | 1835 | ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE) |
1f1ec4ed MJ |
1836 | ctf_integer(u64, num_bytes, num_bytes) |
1837 | ctf_integer(u64, empty_size, empty_size) | |
1838 | ctf_integer(u64, data, data) | |
1839 | ) | |
1840 | ) | |
1841 | ||
1842 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, | |
1843 | ||
1844 | TP_PROTO(const struct btrfs_fs_info *info, | |
1845 | const struct btrfs_block_group_cache *block_group, u64 start, | |
1846 | u64 len), | |
1847 | ||
1848 | TP_ARGS(info, block_group, start, len), | |
1849 | ||
1850 | TP_FIELDS( | |
51ab0b1d | 1851 | ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE) |
1f1ec4ed MJ |
1852 | ctf_integer(u64, bg_objectid, block_group->key.objectid) |
1853 | ctf_integer(u64, flags, block_group->flags) | |
1854 | ctf_integer(u64, start, start) | |
1855 | ctf_integer(u64, len, len) | |
1856 | ) | |
1857 | ) | |
1858 | ||
1859 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent, | |
1860 | ||
1861 | TP_PROTO(const struct btrfs_fs_info *info, | |
1862 | const struct btrfs_block_group_cache *block_group, u64 start, | |
1863 | u64 len), | |
1864 | ||
1865 | TP_ARGS(info, block_group, start, len) | |
1866 | ) | |
1867 | ||
1868 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster, | |
1869 | ||
1870 | TP_PROTO(const struct btrfs_fs_info *info, | |
1871 | const struct btrfs_block_group_cache *block_group, u64 start, | |
1872 | u64 len), | |
1873 | ||
1874 | TP_ARGS(info, block_group, start, len) | |
1875 | ) | |
1876 | ||
1877 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
1878 | ||
ff8bdcc2 MD |
1879 | LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, |
1880 | ||
1881 | btrfs_find_free_extent, | |
1882 | ||
1883 | TP_PROTO(struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size, | |
1884 | u64 data), | |
1885 | ||
1886 | TP_ARGS(info, num_bytes, empty_size, data), | |
1887 | ||
1888 | TP_FIELDS( | |
51ab0b1d | 1889 | ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE) |
ff8bdcc2 MD |
1890 | ctf_integer(u64, num_bytes, num_bytes) |
1891 | ctf_integer(u64, empty_size, empty_size) | |
1892 | ctf_integer(u64, data, data) | |
1893 | ) | |
1894 | ) | |
1895 | ||
1896 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, | |
1897 | ||
1898 | TP_PROTO(struct btrfs_fs_info *info, | |
1899 | struct btrfs_block_group_cache *block_group, u64 start, | |
1900 | u64 len), | |
1901 | ||
1902 | TP_ARGS(info, block_group, start, len), | |
1903 | ||
1904 | TP_FIELDS( | |
1905 | ctf_integer(u64, bg_objectid, block_group->key.objectid) | |
1906 | ctf_integer(u64, flags, block_group->flags) | |
1907 | ctf_integer(u64, start, start) | |
1908 | ctf_integer(u64, len, len) | |
1909 | ) | |
1910 | ) | |
1911 | ||
1912 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent, | |
1913 | ||
1914 | TP_PROTO(struct btrfs_fs_info *info, | |
1915 | struct btrfs_block_group_cache *block_group, u64 start, | |
1916 | u64 len), | |
1917 | ||
1918 | TP_ARGS(info, block_group, start, len) | |
1919 | ) | |
1920 | ||
1921 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster, | |
1922 | ||
1923 | TP_PROTO(struct btrfs_fs_info *info, | |
1924 | struct btrfs_block_group_cache *block_group, u64 start, | |
1925 | u64 len), | |
1926 | ||
1927 | TP_ARGS(info, block_group, start, len) | |
1928 | ) | |
0badc02f MJ |
1929 | #elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
1930 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ | |
1931 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ | |
1932 | LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) | |
7ca7cd6e MJ |
1933 | |
1934 | LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, | |
1935 | ||
1936 | btrfs_find_free_extent, | |
1937 | ||
1938 | TP_PROTO(const struct btrfs_root *root, u64 num_bytes, u64 empty_size, | |
1939 | u64 data), | |
1940 | ||
1941 | TP_ARGS(root, num_bytes, empty_size, data), | |
1942 | ||
1943 | TP_FIELDS( | |
1944 | ctf_integer(u64, root_objectid, root->root_key.objectid) | |
1945 | ctf_integer(u64, num_bytes, num_bytes) | |
1946 | ctf_integer(u64, empty_size, empty_size) | |
1947 | ctf_integer(u64, data, data) | |
1948 | ) | |
1949 | ) | |
1950 | ||
1951 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, | |
1952 | ||
1953 | TP_PROTO(const struct btrfs_root *root, | |
1954 | const struct btrfs_block_group_cache *block_group, u64 start, | |
1955 | u64 len), | |
1956 | ||
1957 | TP_ARGS(root, block_group, start, len), | |
1958 | ||
1959 | TP_FIELDS( | |
1960 | ctf_integer(u64, root_objectid, root->root_key.objectid) | |
1961 | ctf_integer(u64, bg_objectid, block_group->key.objectid) | |
1962 | ctf_integer(u64, flags, block_group->flags) | |
1963 | ctf_integer(u64, start, start) | |
1964 | ctf_integer(u64, len, len) | |
1965 | ) | |
1966 | ) | |
1967 | ||
1968 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent, | |
1969 | ||
1970 | TP_PROTO(const struct btrfs_root *root, | |
1971 | const struct btrfs_block_group_cache *block_group, u64 start, | |
1972 | u64 len), | |
1973 | ||
1974 | TP_ARGS(root, block_group, start, len) | |
1975 | ) | |
1976 | ||
1977 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster, | |
1978 | ||
1979 | TP_PROTO(const struct btrfs_root *root, | |
1980 | const struct btrfs_block_group_cache *block_group, u64 start, | |
1981 | u64 len), | |
1982 | ||
1983 | TP_ARGS(root, block_group, start, len) | |
1984 | ) | |
ff8bdcc2 | 1985 | |
1f1ec4ed | 1986 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) |
ff8bdcc2 | 1987 | |
3bc29f0a | 1988 | LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, |
9cf29d3e MD |
1989 | |
1990 | btrfs_find_free_extent, | |
b87700e3 AG |
1991 | |
1992 | TP_PROTO(struct btrfs_root *root, u64 num_bytes, u64 empty_size, | |
1993 | u64 data), | |
1994 | ||
1995 | TP_ARGS(root, num_bytes, empty_size, data), | |
1996 | ||
f127e61e MD |
1997 | TP_FIELDS( |
1998 | ctf_integer(u64, root_objectid, root->root_key.objectid) | |
1999 | ctf_integer(u64, num_bytes, num_bytes) | |
2000 | ctf_integer(u64, empty_size, empty_size) | |
2001 | ctf_integer(u64, data, data) | |
2002 | ) | |
b87700e3 AG |
2003 | ) |
2004 | ||
3bc29f0a | 2005 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, |
b87700e3 AG |
2006 | |
2007 | TP_PROTO(struct btrfs_root *root, | |
2008 | struct btrfs_block_group_cache *block_group, u64 start, | |
2009 | u64 len), | |
2010 | ||
2011 | TP_ARGS(root, block_group, start, len), | |
2012 | ||
f127e61e MD |
2013 | TP_FIELDS( |
2014 | ctf_integer(u64, root_objectid, root->root_key.objectid) | |
2015 | ctf_integer(u64, bg_objectid, block_group->key.objectid) | |
2016 | ctf_integer(u64, flags, block_group->flags) | |
2017 | ctf_integer(u64, start, start) | |
2018 | ctf_integer(u64, len, len) | |
2019 | ) | |
b87700e3 AG |
2020 | ) |
2021 | ||
3bc29f0a | 2022 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent, |
b87700e3 AG |
2023 | |
2024 | TP_PROTO(struct btrfs_root *root, | |
2025 | struct btrfs_block_group_cache *block_group, u64 start, | |
2026 | u64 len), | |
2027 | ||
2028 | TP_ARGS(root, block_group, start, len) | |
2029 | ) | |
2030 | ||
3bc29f0a | 2031 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster, |
b87700e3 AG |
2032 | |
2033 | TP_PROTO(struct btrfs_root *root, | |
2034 | struct btrfs_block_group_cache *block_group, u64 start, | |
2035 | u64 len), | |
2036 | ||
2037 | TP_ARGS(root, block_group, start, len) | |
2038 | ) | |
2039 | ||
ff8bdcc2 MD |
2040 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ |
2041 | ||
7ca7cd6e | 2042 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ |
0badc02f MJ |
2043 | LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
2044 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ | |
2045 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ | |
7ca7cd6e | 2046 | LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) |
1f1ec4ed MJ |
2047 | LTTNG_TRACEPOINT_EVENT(btrfs_find_cluster, |
2048 | ||
2049 | TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start, | |
2050 | u64 bytes, u64 empty_size, u64 min_bytes), | |
2051 | ||
2052 | TP_ARGS(block_group, start, bytes, empty_size, min_bytes), | |
2053 | ||
2054 | TP_FIELDS( | |
2055 | ctf_integer(u64, bg_objectid, block_group->key.objectid) | |
2056 | ctf_integer(u64, flags, block_group->flags) | |
2057 | ctf_integer(u64, start, start) | |
2058 | ctf_integer(u64, bytes, bytes) | |
2059 | ctf_integer(u64, empty_size, empty_size) | |
2060 | ctf_integer(u64, min_bytes, min_bytes) | |
2061 | ) | |
2062 | ) | |
2063 | ||
2064 | LTTNG_TRACEPOINT_EVENT(btrfs_failed_cluster_setup, | |
2065 | ||
2066 | TP_PROTO(const struct btrfs_block_group_cache *block_group), | |
2067 | ||
2068 | TP_ARGS(block_group), | |
2069 | ||
2070 | TP_FIELDS( | |
2071 | ctf_integer(u64, bg_objectid, block_group->key.objectid) | |
2072 | ) | |
2073 | ) | |
2074 | ||
2075 | LTTNG_TRACEPOINT_EVENT(btrfs_setup_cluster, | |
2076 | ||
2077 | TP_PROTO(const struct btrfs_block_group_cache *block_group, | |
2078 | const struct btrfs_free_cluster *cluster, u64 size, int bitmap), | |
2079 | ||
2080 | TP_ARGS(block_group, cluster, size, bitmap), | |
2081 | ||
2082 | TP_FIELDS( | |
2083 | ctf_integer(u64, bg_objectid, block_group->key.objectid) | |
2084 | ctf_integer(u64, flags, block_group->flags) | |
2085 | ctf_integer(u64, start, cluster->window_start) | |
2086 | ctf_integer(u64, max_size, cluster->max_size) | |
2087 | ctf_integer(u64, size, size) | |
2088 | ctf_integer(int, bitmap, bitmap) | |
2089 | ) | |
2090 | ) | |
2091 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
3bc29f0a | 2092 | LTTNG_TRACEPOINT_EVENT(btrfs_find_cluster, |
b87700e3 AG |
2093 | |
2094 | TP_PROTO(struct btrfs_block_group_cache *block_group, u64 start, | |
2095 | u64 bytes, u64 empty_size, u64 min_bytes), | |
2096 | ||
2097 | TP_ARGS(block_group, start, bytes, empty_size, min_bytes), | |
2098 | ||
f127e61e MD |
2099 | TP_FIELDS( |
2100 | ctf_integer(u64, bg_objectid, block_group->key.objectid) | |
2101 | ctf_integer(u64, flags, block_group->flags) | |
2102 | ctf_integer(u64, start, start) | |
2103 | ctf_integer(u64, bytes, bytes) | |
2104 | ctf_integer(u64, empty_size, empty_size) | |
2105 | ctf_integer(u64, min_bytes, min_bytes) | |
2106 | ) | |
b87700e3 AG |
2107 | ) |
2108 | ||
3bc29f0a | 2109 | LTTNG_TRACEPOINT_EVENT(btrfs_failed_cluster_setup, |
b87700e3 AG |
2110 | |
2111 | TP_PROTO(struct btrfs_block_group_cache *block_group), | |
2112 | ||
2113 | TP_ARGS(block_group), | |
2114 | ||
f127e61e MD |
2115 | TP_FIELDS( |
2116 | ctf_integer(u64, bg_objectid, block_group->key.objectid) | |
2117 | ) | |
b87700e3 AG |
2118 | ) |
2119 | ||
3bc29f0a | 2120 | LTTNG_TRACEPOINT_EVENT(btrfs_setup_cluster, |
b87700e3 AG |
2121 | |
2122 | TP_PROTO(struct btrfs_block_group_cache *block_group, | |
2123 | struct btrfs_free_cluster *cluster, u64 size, int bitmap), | |
2124 | ||
2125 | TP_ARGS(block_group, cluster, size, bitmap), | |
2126 | ||
f127e61e MD |
2127 | TP_FIELDS( |
2128 | ctf_integer(u64, bg_objectid, block_group->key.objectid) | |
2129 | ctf_integer(u64, flags, block_group->flags) | |
2130 | ctf_integer(u64, start, cluster->window_start) | |
2131 | ctf_integer(u64, max_size, cluster->max_size) | |
2132 | ctf_integer(u64, size, size) | |
2133 | ctf_integer(int, bitmap, bitmap) | |
2134 | ) | |
b87700e3 AG |
2135 | ) |
2136 | #endif | |
2137 | ||
7ca7cd6e | 2138 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ |
0badc02f MJ |
2139 | LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
2140 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ | |
2141 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ | |
7ca7cd6e | 2142 | LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) |
1f1ec4ed MJ |
2143 | LTTNG_TRACEPOINT_EVENT_MAP(alloc_extent_state, |
2144 | ||
2145 | btrfs_alloc_extent_state, | |
2146 | ||
2147 | TP_PROTO(const struct extent_state *state, gfp_t mask, unsigned long IP), | |
2148 | ||
2149 | TP_ARGS(state, mask, IP), | |
2150 | ||
2151 | TP_FIELDS( | |
2152 | ctf_integer_hex(const struct extent_state *, state, state) | |
2153 | ctf_integer(gfp_t, mask, mask) | |
2154 | ctf_integer(unsigned long, ip, IP) | |
2155 | ) | |
2156 | ) | |
2157 | ||
2158 | LTTNG_TRACEPOINT_EVENT_MAP(free_extent_state, | |
2159 | ||
2160 | btrfs_free_extent_state, | |
2161 | ||
2162 | TP_PROTO(const struct extent_state *state, unsigned long IP), | |
2163 | ||
2164 | TP_ARGS(state, IP), | |
2165 | ||
2166 | TP_FIELDS( | |
2167 | ctf_integer_hex(const struct extent_state *, state, state) | |
2168 | ctf_integer(unsigned long, ip, IP) | |
2169 | ) | |
2170 | ) | |
2171 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
3bc29f0a | 2172 | LTTNG_TRACEPOINT_EVENT_MAP(alloc_extent_state, |
9cf29d3e MD |
2173 | |
2174 | btrfs_alloc_extent_state, | |
b87700e3 AG |
2175 | |
2176 | TP_PROTO(struct extent_state *state, gfp_t mask, unsigned long IP), | |
2177 | ||
2178 | TP_ARGS(state, mask, IP), | |
2179 | ||
f127e61e | 2180 | TP_FIELDS( |
fa91fcac | 2181 | ctf_integer_hex(struct extent_state *, state, state) |
f127e61e MD |
2182 | ctf_integer(gfp_t, mask, mask) |
2183 | ctf_integer(unsigned long, ip, IP) | |
2184 | ) | |
b87700e3 AG |
2185 | ) |
2186 | ||
3bc29f0a | 2187 | LTTNG_TRACEPOINT_EVENT_MAP(free_extent_state, |
9cf29d3e MD |
2188 | |
2189 | btrfs_free_extent_state, | |
b87700e3 AG |
2190 | |
2191 | TP_PROTO(struct extent_state *state, unsigned long IP), | |
2192 | ||
2193 | TP_ARGS(state, IP), | |
2194 | ||
f127e61e | 2195 | TP_FIELDS( |
fa91fcac | 2196 | ctf_integer_hex(struct extent_state *, state, state) |
f127e61e MD |
2197 | ctf_integer(unsigned long, ip, IP) |
2198 | ) | |
b87700e3 AG |
2199 | ) |
2200 | #endif | |
2201 | ||
3bc29f0a | 2202 | #endif /* LTTNG_TRACE_BTRFS_H */ |
b87700e3 AG |
2203 | |
2204 | /* This part must be outside protection */ | |
6ec43db8 | 2205 | #include <probes/define_trace.h> |