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