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