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