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