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