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