Fix: btrfs_delayed_ref_head was unwired since v3.12
[deliverable/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
83a4fd47
MJ
35#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
36LTTNG_TRACEPOINT_EVENT(btrfs_transaction_commit,
37
38 TP_PROTO(const struct btrfs_root *root),
39
40 TP_ARGS(root),
41
42 TP_FIELDS(
43 ctf_integer(u64, generation, root->fs_info->generation)
44 ctf_integer(u64, root_objectid, root->root_key.objectid)
45 )
46)
47
48LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__inode,
49
50 TP_PROTO(const struct inode *inode),
51
52 TP_ARGS(inode),
53
54 TP_FIELDS(
55 ctf_integer(ino_t, ino, inode->i_ino)
56 ctf_integer(blkcnt_t, blocks, inode->i_blocks)
57 ctf_integer(u64, disk_i_size, BTRFS_I(inode)->disk_i_size)
58 ctf_integer(u64, generation, BTRFS_I(inode)->generation)
59 ctf_integer(u64, last_trans, BTRFS_I(inode)->last_trans)
60 ctf_integer(u64, logged_trans, BTRFS_I(inode)->logged_trans)
61 ctf_integer(u64, root_objectid,
62 BTRFS_I(inode)->root->root_key.objectid)
63 )
64)
65
66LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_new,
67
68 TP_PROTO(const struct inode *inode),
69
70 TP_ARGS(inode)
71)
72
73LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_request,
74
75 TP_PROTO(const struct inode *inode),
76
77 TP_ARGS(inode)
78)
79
80LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_evict,
81
82 TP_PROTO(const struct inode *inode),
83
84 TP_ARGS(inode)
85)
86#else
3bc29f0a 87LTTNG_TRACEPOINT_EVENT(btrfs_transaction_commit,
b87700e3
AG
88
89 TP_PROTO(struct btrfs_root *root),
90
91 TP_ARGS(root),
92
f127e61e
MD
93 TP_FIELDS(
94 ctf_integer(u64, generation, root->fs_info->generation)
95 ctf_integer(u64, root_objectid, root->root_key.objectid)
96 )
b87700e3
AG
97)
98
3bc29f0a 99LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__inode,
b87700e3
AG
100
101 TP_PROTO(struct inode *inode),
102
103 TP_ARGS(inode),
104
f127e61e
MD
105 TP_FIELDS(
106 ctf_integer(ino_t, ino, inode->i_ino)
107 ctf_integer(blkcnt_t, blocks, inode->i_blocks)
108 ctf_integer(u64, disk_i_size, BTRFS_I(inode)->disk_i_size)
109 ctf_integer(u64, generation, BTRFS_I(inode)->generation)
110 ctf_integer(u64, last_trans, BTRFS_I(inode)->last_trans)
111 ctf_integer(u64, logged_trans, BTRFS_I(inode)->logged_trans)
112 ctf_integer(u64, root_objectid,
b87700e3 113 BTRFS_I(inode)->root->root_key.objectid)
f127e61e 114 )
b87700e3
AG
115)
116
3bc29f0a 117LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_new,
b87700e3
AG
118
119 TP_PROTO(struct inode *inode),
120
121 TP_ARGS(inode)
122)
123
3bc29f0a 124LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_request,
b87700e3
AG
125
126 TP_PROTO(struct inode *inode),
127
128 TP_ARGS(inode)
129)
130
3bc29f0a 131LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_evict,
b87700e3
AG
132
133 TP_PROTO(struct inode *inode),
134
135 TP_ARGS(inode)
136)
83a4fd47
MJ
137#endif
138
139#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
140
141LTTNG_TRACEPOINT_EVENT(btrfs_get_extent,
142
143 TP_PROTO(const struct btrfs_root *root, const struct btrfs_inode *inode,
144 const struct extent_map *map),
145
146 TP_ARGS(root, inode, map),
147
148 TP_FIELDS(
149 ctf_integer(u64, root_objectid, root->root_key.objectid)
150 ctf_integer(u64, ino, btrfs_ino(inode))
151 ctf_integer(u64, start, map->start)
152 ctf_integer(u64, len, map->len)
153 ctf_integer(u64, orig_start, map->orig_start)
154 ctf_integer(u64, block_start, map->block_start)
155 ctf_integer(u64, block_len, map->block_len)
156 ctf_integer(unsigned long, flags, map->flags)
157 ctf_integer(int, refs, refcount_read(&map->refs))
158 ctf_integer(unsigned int, compress_type, map->compress_type)
159 )
160)
b87700e3 161
83a4fd47 162#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
6f34b85f
MJ
163
164LTTNG_TRACEPOINT_EVENT(btrfs_get_extent,
165
166 TP_PROTO(struct btrfs_root *root, struct btrfs_inode *inode,
167 struct extent_map *map),
168
169 TP_ARGS(root, inode, map),
170
171 TP_FIELDS(
172 ctf_integer(u64, root_objectid, root->root_key.objectid)
173 ctf_integer(u64, ino, btrfs_ino(inode))
174 ctf_integer(u64, start, map->start)
175 ctf_integer(u64, len, map->len)
176 ctf_integer(u64, orig_start, map->orig_start)
177 ctf_integer(u64, block_start, map->block_start)
178 ctf_integer(u64, block_len, map->block_len)
179 ctf_integer(unsigned long, flags, map->flags)
180 ctf_integer(int, refs, refcount_read(&map->refs))
181 ctf_integer(unsigned int, compress_type, map->compress_type)
182 )
183)
184
185#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
e52717ea
FD
186
187LTTNG_TRACEPOINT_EVENT(btrfs_get_extent,
188
189 TP_PROTO(struct btrfs_root *root, struct btrfs_inode *inode,
190 struct extent_map *map),
191
192 TP_ARGS(root, inode, map),
193
194 TP_FIELDS(
195 ctf_integer(u64, root_objectid, root->root_key.objectid)
196 ctf_integer(u64, ino, btrfs_ino(inode))
197 ctf_integer(u64, start, map->start)
198 ctf_integer(u64, len, map->len)
199 ctf_integer(u64, orig_start, map->orig_start)
200 ctf_integer(u64, block_start, map->block_start)
201 ctf_integer(u64, block_len, map->block_len)
202 ctf_integer(unsigned long, flags, map->flags)
203 ctf_integer(int, refs, atomic_read(&map->refs))
204 ctf_integer(unsigned int, compress_type, map->compress_type)
205 )
206)
207
208#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
f1a87e24 209
3bc29f0a 210LTTNG_TRACEPOINT_EVENT(btrfs_get_extent,
b87700e3 211
f3166f27
MD
212 TP_PROTO(struct btrfs_root *root, struct inode *inode,
213 struct extent_map *map),
b87700e3 214
f3166f27 215 TP_ARGS(root, inode, map),
b87700e3 216
f127e61e
MD
217 TP_FIELDS(
218 ctf_integer(u64, root_objectid, root->root_key.objectid)
f3166f27 219 ctf_integer(u64, ino, btrfs_ino(inode))
f127e61e
MD
220 ctf_integer(u64, start, map->start)
221 ctf_integer(u64, len, map->len)
222 ctf_integer(u64, orig_start, map->orig_start)
223 ctf_integer(u64, block_start, map->block_start)
224 ctf_integer(u64, block_len, map->block_len)
225 ctf_integer(unsigned long, flags, map->flags)
226 ctf_integer(int, refs, atomic_read(&map->refs))
227 ctf_integer(unsigned int, compress_type, map->compress_type)
228 )
b87700e3
AG
229)
230
f1a87e24
MD
231#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
232
233LTTNG_TRACEPOINT_EVENT(btrfs_get_extent,
234
235 TP_PROTO(struct btrfs_root *root, struct extent_map *map),
236
237 TP_ARGS(root, map),
238
239 TP_FIELDS(
240 ctf_integer(u64, root_objectid, root->root_key.objectid)
241 ctf_integer(u64, start, map->start)
242 ctf_integer(u64, len, map->len)
243 ctf_integer(u64, orig_start, map->orig_start)
244 ctf_integer(u64, block_start, map->block_start)
245 ctf_integer(u64, block_len, map->block_len)
246 ctf_integer(unsigned long, flags, map->flags)
247 ctf_integer(int, refs, atomic_read(&map->refs))
248 ctf_integer(unsigned int, compress_type, map->compress_type)
249 )
250)
251
252#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
253
83a4fd47
MJ
254#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
255LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
256
257 TP_PROTO(const struct inode *inode,
258 const struct btrfs_ordered_extent *ordered),
259
260 TP_ARGS(inode, ordered),
261
262 TP_FIELDS(
263 ctf_integer(ino_t, ino, inode->i_ino)
264 ctf_integer(u64, file_offset, ordered->file_offset)
265 ctf_integer(u64, start, ordered->start)
266 ctf_integer(u64, len, ordered->len)
267 ctf_integer(u64, disk_len, ordered->disk_len)
268 ctf_integer(u64, bytes_left, ordered->bytes_left)
269 ctf_integer(unsigned long, flags, ordered->flags)
270 ctf_integer(int, compress_type, ordered->compress_type)
271 ctf_integer(int, refs, refcount_read(&ordered->refs))
272 ctf_integer(u64, root_objectid,
273 BTRFS_I(inode)->root->root_key.objectid)
274 )
275)
276#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
6f34b85f
MJ
277LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
278
279 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
280
281 TP_ARGS(inode, ordered),
282
283 TP_FIELDS(
284 ctf_integer(ino_t, ino, inode->i_ino)
285 ctf_integer(u64, file_offset, ordered->file_offset)
286 ctf_integer(u64, start, ordered->start)
287 ctf_integer(u64, len, ordered->len)
288 ctf_integer(u64, disk_len, ordered->disk_len)
289 ctf_integer(u64, bytes_left, ordered->bytes_left)
290 ctf_integer(unsigned long, flags, ordered->flags)
291 ctf_integer(int, compress_type, ordered->compress_type)
292 ctf_integer(int, refs, refcount_read(&ordered->refs))
293 ctf_integer(u64, root_objectid,
294 BTRFS_I(inode)->root->root_key.objectid)
295 )
296)
297#else
3bc29f0a 298LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
b87700e3
AG
299
300 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
301
302 TP_ARGS(inode, ordered),
303
f127e61e
MD
304 TP_FIELDS(
305 ctf_integer(ino_t, ino, inode->i_ino)
306 ctf_integer(u64, file_offset, ordered->file_offset)
307 ctf_integer(u64, start, ordered->start)
308 ctf_integer(u64, len, ordered->len)
309 ctf_integer(u64, disk_len, ordered->disk_len)
310 ctf_integer(u64, bytes_left, ordered->bytes_left)
311 ctf_integer(unsigned long, flags, ordered->flags)
312 ctf_integer(int, compress_type, ordered->compress_type)
313 ctf_integer(int, refs, atomic_read(&ordered->refs))
314 ctf_integer(u64, root_objectid,
b87700e3 315 BTRFS_I(inode)->root->root_key.objectid)
f127e61e 316 )
b87700e3 317)
6f34b85f 318#endif
b87700e3 319
83a4fd47
MJ
320#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
321LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_add,
322
323 TP_PROTO(const struct inode *inode,
324 const struct btrfs_ordered_extent *ordered),
325
326 TP_ARGS(inode, ordered)
327)
328
329LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_remove,
330
331 TP_PROTO(const struct inode *inode,
332 const struct btrfs_ordered_extent *ordered),
333
334 TP_ARGS(inode, ordered)
335)
336
337LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_start,
338
339 TP_PROTO(const struct inode *inode,
340 const struct btrfs_ordered_extent *ordered),
341
342 TP_ARGS(inode, ordered)
343)
344
345LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_put,
346
347 TP_PROTO(const struct inode *inode,
348 const struct btrfs_ordered_extent *ordered),
349
350 TP_ARGS(inode, ordered)
351)
352
353LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__writepage,
354
355 TP_PROTO(const struct page *page, const struct inode *inode,
356 const struct writeback_control *wbc),
357
358 TP_ARGS(page, inode, wbc),
359
360 TP_FIELDS(
361 ctf_integer(ino_t, ino, inode->i_ino)
362 ctf_integer(pgoff_t, index, page->index)
363 ctf_integer(long, nr_to_write, wbc->nr_to_write)
364 ctf_integer(long, pages_skipped, wbc->pages_skipped)
365 ctf_integer(loff_t, range_start, wbc->range_start)
366 ctf_integer(loff_t, range_end, wbc->range_end)
367 ctf_integer(char, for_kupdate, wbc->for_kupdate)
368 ctf_integer(char, for_reclaim, wbc->for_reclaim)
369 ctf_integer(char, range_cyclic, wbc->range_cyclic)
370 ctf_integer(pgoff_t, writeback_index,
371 inode->i_mapping->writeback_index)
372 ctf_integer(u64, root_objectid,
373 BTRFS_I(inode)->root->root_key.objectid)
374 )
375)
376
377LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs__writepage,
378
379 __extent_writepage,
380
381 btrfs__extent_writepage,
382
383 TP_PROTO(const struct page *page, const struct inode *inode,
384 const struct writeback_control *wbc),
385
386 TP_ARGS(page, inode, wbc)
387)
388
389LTTNG_TRACEPOINT_EVENT(btrfs_writepage_end_io_hook,
390
391 TP_PROTO(const struct page *page, u64 start, u64 end, int uptodate),
392
393 TP_ARGS(page, start, end, uptodate),
394
395 TP_FIELDS(
396 ctf_integer(ino_t, ino, page->mapping->host->i_ino)
397 ctf_integer(pgoff_t, index, page->index)
398 ctf_integer(u64, start, start)
399 ctf_integer(u64, end, end)
400 ctf_integer(int, uptodate, uptodate)
401 ctf_integer(u64, root_objectid,
402 BTRFS_I(page->mapping->host)->root->root_key.objectid)
403 )
404)
405
406LTTNG_TRACEPOINT_EVENT(btrfs_sync_file,
407
408 TP_PROTO(const struct file *file, int datasync),
409
410 TP_ARGS(file, datasync),
411
412 TP_FIELDS(
413 ctf_integer(ino_t, ino, file->f_path.dentry->d_inode->i_ino)
414 ctf_integer(ino_t, parent, file->f_path.dentry->d_parent->d_inode->i_ino)
415 ctf_integer(int, datasync, datasync)
416 ctf_integer(u64, root_objectid,
417 BTRFS_I(file->f_path.dentry->d_inode)->root->root_key.objectid)
418 )
419)
420#else
3bc29f0a 421LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_add,
b87700e3
AG
422
423 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
424
425 TP_ARGS(inode, ordered)
426)
427
3bc29f0a 428LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_remove,
b87700e3
AG
429
430 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
431
432 TP_ARGS(inode, ordered)
433)
434
3bc29f0a 435LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_start,
b87700e3
AG
436
437 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
438
439 TP_ARGS(inode, ordered)
440)
441
3bc29f0a 442LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_put,
b87700e3
AG
443
444 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
445
446 TP_ARGS(inode, ordered)
447)
448
3bc29f0a 449LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__writepage,
b87700e3
AG
450
451 TP_PROTO(struct page *page, struct inode *inode,
452 struct writeback_control *wbc),
453
454 TP_ARGS(page, inode, wbc),
455
f127e61e
MD
456 TP_FIELDS(
457 ctf_integer(ino_t, ino, inode->i_ino)
458 ctf_integer(pgoff_t, index, page->index)
459 ctf_integer(long, nr_to_write, wbc->nr_to_write)
460 ctf_integer(long, pages_skipped, wbc->pages_skipped)
461 ctf_integer(loff_t, range_start, wbc->range_start)
462 ctf_integer(loff_t, range_end, wbc->range_end)
b87700e3 463#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0))
f127e61e 464 ctf_integer(char, nonblocking, wbc->nonblocking)
b87700e3 465#endif
f127e61e
MD
466 ctf_integer(char, for_kupdate, wbc->for_kupdate)
467 ctf_integer(char, for_reclaim, wbc->for_reclaim)
468 ctf_integer(char, range_cyclic, wbc->range_cyclic)
469 ctf_integer(pgoff_t, writeback_index,
470 inode->i_mapping->writeback_index)
471 ctf_integer(u64, root_objectid,
472 BTRFS_I(inode)->root->root_key.objectid)
473 )
b87700e3
AG
474)
475
9bbf98da
MD
476LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs__writepage,
477
478 __extent_writepage,
479
480 btrfs__extent_writepage,
b87700e3
AG
481
482 TP_PROTO(struct page *page, struct inode *inode,
483 struct writeback_control *wbc),
484
485 TP_ARGS(page, inode, wbc)
486)
487
3bc29f0a 488LTTNG_TRACEPOINT_EVENT(btrfs_writepage_end_io_hook,
b87700e3
AG
489
490 TP_PROTO(struct page *page, u64 start, u64 end, int uptodate),
491
492 TP_ARGS(page, start, end, uptodate),
493
f127e61e
MD
494 TP_FIELDS(
495 ctf_integer(ino_t, ino, page->mapping->host->i_ino)
496 ctf_integer(pgoff_t, index, page->index)
497 ctf_integer(u64, start, start)
498 ctf_integer(u64, end, end)
499 ctf_integer(int, uptodate, uptodate)
500 ctf_integer(u64, root_objectid,
501 BTRFS_I(page->mapping->host)->root->root_key.objectid)
502 )
b87700e3
AG
503)
504
3bc29f0a 505LTTNG_TRACEPOINT_EVENT(btrfs_sync_file,
b87700e3
AG
506
507 TP_PROTO(struct file *file, int datasync),
508
509 TP_ARGS(file, datasync),
510
f127e61e
MD
511 TP_FIELDS(
512 ctf_integer(ino_t, ino, file->f_path.dentry->d_inode->i_ino)
513 ctf_integer(ino_t, parent, file->f_path.dentry->d_parent->d_inode->i_ino)
514 ctf_integer(int, datasync, datasync)
515 ctf_integer(u64, root_objectid,
b87700e3 516 BTRFS_I(file->f_path.dentry->d_inode)->root->root_key.objectid)
f127e61e 517 )
b87700e3 518)
83a4fd47 519#endif
b87700e3 520
83a4fd47
MJ
521#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
522LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs,
523
524 TP_PROTO(const struct btrfs_fs_info *fs_info, int wait),
525
526 TP_ARGS(fs_info, wait),
527
528 TP_FIELDS(
529 ctf_integer(int, wait, wait)
530 )
531)
532#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
fcd0a11c
MD
533LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs,
534
535 TP_PROTO(struct btrfs_fs_info *fs_info, int wait),
536
537 TP_ARGS(fs_info, wait),
538
539 TP_FIELDS(
540 ctf_integer(int, wait, wait)
541 )
542)
543#else
3bc29f0a 544LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs,
b87700e3
AG
545
546 TP_PROTO(int wait),
547
548 TP_ARGS(wait),
549
f127e61e
MD
550 TP_FIELDS(
551 ctf_integer(int, wait, wait)
552 )
b87700e3 553)
fcd0a11c
MD
554#endif
555
83a4fd47
MJ
556#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
557LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group,
558
559 TP_PROTO(const struct btrfs_fs_info *fs_info,
560 const struct btrfs_block_group_cache *block_group, int create),
561
562 TP_ARGS(fs_info, block_group, create),
563
564 TP_FIELDS(
565 ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
566 ctf_integer(u64, offset, block_group->key.objectid)
567 ctf_integer(u64, size, block_group->key.offset)
568 ctf_integer(u64, flags, block_group->flags)
569 ctf_integer(u64, bytes_used, btrfs_block_group_used(&block_group->item))
570 ctf_integer(u64, bytes_super, block_group->bytes_super)
571 ctf_integer(int, create, create)
572 )
573)
574#else
fcd0a11c 575LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group,
b87700e3 576
fcd0a11c
MD
577 TP_PROTO(struct btrfs_fs_info *fs_info,
578 struct btrfs_block_group_cache *block_group, int create),
579
580 TP_ARGS(fs_info, block_group, create),
581
582 TP_FIELDS(
583 ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
584 ctf_integer(u64, offset, block_group->key.objectid)
585 ctf_integer(u64, size, block_group->key.offset)
586 ctf_integer(u64, flags, block_group->flags)
587 ctf_integer(u64, bytes_used, btrfs_block_group_used(&block_group->item))
588 ctf_integer(u64, bytes_super, block_group->bytes_super)
589 ctf_integer(int, create, create)
590 )
591)
83a4fd47 592#endif
fcd0a11c 593
83a4fd47
MJ
594#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
595LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref,
596
597 TP_PROTO(const struct btrfs_fs_info *fs_info,
598 const struct btrfs_delayed_ref_node *ref,
599 const struct btrfs_delayed_tree_ref *full_ref,
600 int action),
601
602 TP_ARGS(fs_info, ref, full_ref, action),
603
604 TP_FIELDS(
605 ctf_integer(u64, bytenr, ref->bytenr)
606 ctf_integer(u64, num_bytes, ref->num_bytes)
607 ctf_integer(int, action, action)
608 ctf_integer(u64, parent, full_ref->parent)
609 ctf_integer(u64, ref_root, full_ref->root)
610 ctf_integer(int, level, full_ref->level)
611 ctf_integer(int, type, ref->type)
612 ctf_integer(u64, seq, ref->seq)
613 )
614)
615#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
fcd0a11c
MD
616LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref,
617
618 TP_PROTO(struct btrfs_fs_info *fs_info,
619 struct btrfs_delayed_ref_node *ref,
620 struct btrfs_delayed_tree_ref *full_ref,
621 int action),
622
623 TP_ARGS(fs_info, ref, full_ref, action),
624
625 TP_FIELDS(
626 ctf_integer(u64, bytenr, ref->bytenr)
627 ctf_integer(u64, num_bytes, ref->num_bytes)
628 ctf_integer(int, action, action)
629 ctf_integer(u64, parent, full_ref->parent)
630 ctf_integer(u64, ref_root, full_ref->root)
631 ctf_integer(int, level, full_ref->level)
632 ctf_integer(int, type, ref->type)
633 ctf_integer(u64, seq, ref->seq)
634 )
635)
636#else
3bc29f0a 637LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref,
b87700e3
AG
638
639 TP_PROTO(struct btrfs_delayed_ref_node *ref,
640 struct btrfs_delayed_tree_ref *full_ref,
641 int action),
642
643 TP_ARGS(ref, full_ref, action),
644
f127e61e
MD
645 TP_FIELDS(
646 ctf_integer(u64, bytenr, ref->bytenr)
647 ctf_integer(u64, num_bytes, ref->num_bytes)
648 ctf_integer(int, action, action)
649 ctf_integer(u64, parent, full_ref->parent)
650 ctf_integer(u64, ref_root, full_ref->root)
651 ctf_integer(int, level, full_ref->level)
652 ctf_integer(int, type, ref->type)
b87700e3 653#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
f127e61e 654 ctf_integer(u64, seq, ref->seq)
b87700e3 655#endif
f127e61e 656 )
b87700e3 657)
fcd0a11c 658#endif
b87700e3 659
3bc29f0a 660LTTNG_TRACEPOINT_EVENT(btrfs_delayed_data_ref,
b87700e3
AG
661
662 TP_PROTO(struct btrfs_delayed_ref_node *ref,
663 struct btrfs_delayed_data_ref *full_ref,
664 int action),
665
666 TP_ARGS(ref, full_ref, action),
667
f127e61e
MD
668 TP_FIELDS(
669 ctf_integer(u64, bytenr, ref->bytenr)
670 ctf_integer(u64, num_bytes, ref->num_bytes)
671 ctf_integer(int, action, action)
672 ctf_integer(u64, parent, full_ref->parent)
673 ctf_integer(u64, ref_root, full_ref->root)
674 ctf_integer(u64, owner, full_ref->objectid)
675 ctf_integer(u64, offset, full_ref->offset)
676 ctf_integer(int, type, ref->type)
b87700e3 677#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
f127e61e 678 ctf_integer(u64, seq, ref->seq)
b87700e3 679#endif
f127e61e 680 )
b87700e3
AG
681)
682
1105710a
MJ
683#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0))
684LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head,
685
686 TP_PROTO(const struct btrfs_fs_info *fs_info,
687 const struct btrfs_delayed_ref_head *head_ref,
688 int action),
689
690 TP_ARGS(fs_info, head_ref, action),
691
692 TP_FIELDS(
693 ctf_integer(u64, bytenr, head_ref->bytenr)
694 ctf_integer(u64, num_bytes, head_ref->num_bytes)
695 ctf_integer(int, action, action)
696 ctf_integer(int, is_data, head_ref->is_data)
697 )
698)
699
700LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, add_delayed_ref_head,
701
702 TP_PROTO(const struct btrfs_fs_info *fs_info,
703 const struct btrfs_delayed_ref_head *head_ref,
704 int action),
705
706 TP_ARGS(fs_info, head_ref, action)
707)
708
709LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, run_delayed_ref_head,
710
711 TP_PROTO(const struct btrfs_fs_info *fs_info,
712 const struct btrfs_delayed_ref_head *head_ref,
713 int action),
714
715 TP_ARGS(fs_info, head_ref, action)
716)
717
718#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
719LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head,
720
721 TP_PROTO(const struct btrfs_fs_info *fs_info,
722 const struct btrfs_delayed_ref_node *ref,
723 const struct btrfs_delayed_ref_head *head_ref,
724 int action),
725
726 TP_ARGS(fs_info, ref, head_ref, action),
727
728 TP_FIELDS(
729 ctf_integer(u64, bytenr, ref->bytenr)
730 ctf_integer(u64, num_bytes, ref->num_bytes)
731 ctf_integer(int, action, action)
732 ctf_integer(int, is_data, head_ref->is_data)
733 )
734)
735
736LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, add_delayed_ref_head,
737
738 TP_PROTO(const struct btrfs_fs_info *fs_info,
739 const struct btrfs_delayed_ref_node *ref,
740 const struct btrfs_delayed_ref_head *head_ref,
741 int action),
742
743 TP_ARGS(fs_info, ref, head_ref, action)
744)
745
746LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, run_delayed_ref_head,
747
748 TP_PROTO(const struct btrfs_fs_info *fs_info,
749 const struct btrfs_delayed_ref_node *ref,
750 const struct btrfs_delayed_ref_head *head_ref,
751 int action),
752
753 TP_ARGS(fs_info, ref, head_ref, action)
754)
755
756#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
757LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head,
fcd0a11c
MD
758
759 TP_PROTO(struct btrfs_fs_info *fs_info,
760 struct btrfs_delayed_ref_node *ref,
761 struct btrfs_delayed_ref_head *head_ref,
762 int action),
763
764 TP_ARGS(fs_info, ref, head_ref, action),
765
766 TP_FIELDS(
767 ctf_integer(u64, bytenr, ref->bytenr)
768 ctf_integer(u64, num_bytes, ref->num_bytes)
769 ctf_integer(int, action, action)
770 ctf_integer(int, is_data, head_ref->is_data)
771 )
772)
773
1105710a
MJ
774LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, add_delayed_ref_head,
775
776 TP_PROTO(struct btrfs_fs_info *fs_info,
777 struct btrfs_delayed_ref_node *ref,
778 struct btrfs_delayed_ref_head *head_ref,
779 int action),
780
781 TP_ARGS(fs_info, ref, head_ref, action)
782)
783
784LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, run_delayed_ref_head,
785
786 TP_PROTO(struct btrfs_fs_info *fs_info,
787 struct btrfs_delayed_ref_node *ref,
788 struct btrfs_delayed_ref_head *head_ref,
789 int action),
790
791 TP_ARGS(fs_info, ref, head_ref, action)
792)
793
794#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
795LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head,
796
797 TP_PROTO(struct btrfs_delayed_ref_node *ref,
798 struct btrfs_delayed_ref_head *head_ref,
799 int action),
800
801 TP_ARGS(ref, head_ref, action),
802
803 TP_FIELDS(
804 ctf_integer(u64, bytenr, ref->bytenr)
805 ctf_integer(u64, num_bytes, ref->num_bytes)
806 ctf_integer(int, action, action)
807 ctf_integer(int, is_data, head_ref->is_data)
808 )
809)
810
811LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, add_delayed_ref_head,
812
813 TP_PROTO(struct btrfs_delayed_ref_node *ref,
814 struct btrfs_delayed_ref_head *head_ref,
815 int action),
816
817 TP_ARGS(ref, head_ref, action)
818)
819
820LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, run_delayed_ref_head,
821
822 TP_PROTO(struct btrfs_delayed_ref_node *ref,
823 struct btrfs_delayed_ref_head *head_ref,
824 int action),
825
826 TP_ARGS(ref, head_ref, action)
827)
828
fcd0a11c 829#else
3bc29f0a 830LTTNG_TRACEPOINT_EVENT(btrfs_delayed_ref_head,
b87700e3
AG
831
832 TP_PROTO(struct btrfs_delayed_ref_node *ref,
833 struct btrfs_delayed_ref_head *head_ref,
834 int action),
835
836 TP_ARGS(ref, head_ref, action),
837
f127e61e
MD
838 TP_FIELDS(
839 ctf_integer(u64, bytenr, ref->bytenr)
840 ctf_integer(u64, num_bytes, ref->num_bytes)
841 ctf_integer(int, action, action)
842 ctf_integer(int, is_data, head_ref->is_data)
843 )
b87700e3 844)
fcd0a11c 845#endif
b87700e3 846
83a4fd47
MJ
847#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
848
849LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk,
850
851 TP_PROTO(const struct btrfs_fs_info *fs_info, const struct map_lookup *map,
852 u64 offset, u64 size),
853
854 TP_ARGS(fs_info, map, offset, size),
855
856 TP_FIELDS(
857 ctf_integer(int, num_stripes, map->num_stripes)
858 ctf_integer(u64, type, map->type)
859 ctf_integer(int, sub_stripes, map->sub_stripes)
860 ctf_integer(u64, offset, offset)
861 ctf_integer(u64, size, size)
862 ctf_integer(u64, root_objectid, fs_info->chunk_root->root_key.objectid)
863 )
864)
865
866LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc,
867
868 TP_PROTO(const struct btrfs_fs_info *info, const struct map_lookup *map,
869 u64 offset, u64 size),
870
871 TP_ARGS(info, map, offset, size)
872)
873
874LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free,
875
876 TP_PROTO(const struct btrfs_fs_info *info, const struct map_lookup *map,
877 u64 offset, u64 size),
878
879 TP_ARGS(info, map, offset, size)
880)
881
882#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
ff8bdcc2
MD
883
884LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk,
885
886 TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map,
887 u64 offset, u64 size),
888
889 TP_ARGS(fs_info, map, offset, size),
890
891 TP_FIELDS(
892 ctf_integer(int, num_stripes, map->num_stripes)
893 ctf_integer(u64, type, map->type)
894 ctf_integer(int, sub_stripes, map->sub_stripes)
895 ctf_integer(u64, offset, offset)
896 ctf_integer(u64, size, size)
897 ctf_integer(u64, root_objectid, fs_info->chunk_root->root_key.objectid)
898 )
899)
900
901LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc,
902
903 TP_PROTO(struct btrfs_fs_info *info, struct map_lookup *map,
904 u64 offset, u64 size),
905
906 TP_ARGS(info, map, offset, size)
907)
908
909LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free,
910
911 TP_PROTO(struct btrfs_fs_info *info, struct map_lookup *map,
912 u64 offset, u64 size),
913
914 TP_ARGS(info, map, offset, size)
915)
916
917#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
918
3bc29f0a 919LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk,
b87700e3
AG
920
921 TP_PROTO(struct btrfs_root *root, struct map_lookup *map,
922 u64 offset, u64 size),
923
924 TP_ARGS(root, map, offset, size),
925
f127e61e
MD
926 TP_FIELDS(
927 ctf_integer(int, num_stripes, map->num_stripes)
928 ctf_integer(u64, type, map->type)
929 ctf_integer(int, sub_stripes, map->sub_stripes)
930 ctf_integer(u64, offset, offset)
931 ctf_integer(u64, size, size)
932 ctf_integer(u64, root_objectid, root->root_key.objectid)
933 )
b87700e3
AG
934)
935
3bc29f0a 936LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc,
b87700e3
AG
937
938 TP_PROTO(struct btrfs_root *root, struct map_lookup *map,
939 u64 offset, u64 size),
940
941 TP_ARGS(root, map, offset, size)
942)
943
3bc29f0a 944LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free,
b87700e3
AG
945
946 TP_PROTO(struct btrfs_root *root, struct map_lookup *map,
947 u64 offset, u64 size),
948
949 TP_ARGS(root, map, offset, size)
950)
951
ff8bdcc2
MD
952#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
953
83a4fd47
MJ
954#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
955LTTNG_TRACEPOINT_EVENT(btrfs_cow_block,
956
957 TP_PROTO(const struct btrfs_root *root, const struct extent_buffer *buf,
958 const struct extent_buffer *cow),
959
960 TP_ARGS(root, buf, cow),
961
962 TP_FIELDS(
963 ctf_integer(u64, root_objectid, root->root_key.objectid)
964 ctf_integer(u64, buf_start, buf->start)
965 ctf_integer(int, refs, atomic_read(&buf->refs))
966 ctf_integer(u64, cow_start, cow->start)
967 ctf_integer(int, buf_level, btrfs_header_level(buf))
968 ctf_integer(int, cow_level, btrfs_header_level(cow))
969 )
970)
971#else
3bc29f0a 972LTTNG_TRACEPOINT_EVENT(btrfs_cow_block,
b87700e3
AG
973
974 TP_PROTO(struct btrfs_root *root, struct extent_buffer *buf,
975 struct extent_buffer *cow),
976
977 TP_ARGS(root, buf, cow),
978
f127e61e
MD
979 TP_FIELDS(
980 ctf_integer(u64, root_objectid, root->root_key.objectid)
981 ctf_integer(u64, buf_start, buf->start)
982 ctf_integer(int, refs, atomic_read(&buf->refs))
983 ctf_integer(u64, cow_start, cow->start)
984 ctf_integer(int, buf_level, btrfs_header_level(buf))
985 ctf_integer(int, cow_level, btrfs_header_level(cow))
986 )
b87700e3 987)
83a4fd47 988#endif
b87700e3 989
83a4fd47
MJ
990#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
991LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation,
992
993 TP_PROTO(const struct btrfs_fs_info *fs_info, char *type, u64 val,
994 u64 bytes, int reserve),
995
996 TP_ARGS(fs_info, type, val, bytes, reserve),
997
998 TP_FIELDS(
999 ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
1000 ctf_string(type, type)
1001 ctf_integer(u64, val, val)
1002 ctf_integer(u64, bytes, bytes)
1003 ctf_integer(int, reserve, reserve)
1004 )
1005)
1006#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
3bc29f0a 1007LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation,
b87700e3
AG
1008
1009 TP_PROTO(struct btrfs_fs_info *fs_info, char *type, u64 val,
1010 u64 bytes, int reserve),
1011
1012 TP_ARGS(fs_info, type, val, bytes, reserve),
1013
f127e61e
MD
1014 TP_FIELDS(
1015 ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
1016 ctf_string(type, type)
1017 ctf_integer(u64, val, val)
1018 ctf_integer(u64, bytes, bytes)
1019 ctf_integer(int, reserve, reserve)
1020 )
b87700e3
AG
1021)
1022#endif
1023
83a4fd47
MJ
1024#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1025
1026LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent,
1027
1028 TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len),
1029
1030 TP_ARGS(info, start, len),
1031
1032 TP_FIELDS(
1033 ctf_integer(u64, start, start)
1034 ctf_integer(u64, len, len)
1035 )
1036)
1037
1038LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc,
1039
1040 TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len),
1041
1042 TP_ARGS(info, start, len)
1043)
1044
1045LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free,
1046
1047 TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len),
1048
1049 TP_ARGS(info, start, len)
1050)
1051
1052#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
ff8bdcc2
MD
1053
1054LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent,
1055
1056 TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len),
1057
1058 TP_ARGS(info, start, len),
1059
1060 TP_FIELDS(
1061 ctf_integer(u64, start, start)
1062 ctf_integer(u64, len, len)
1063 )
1064)
1065
1066LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc,
1067
1068 TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len),
1069
1070 TP_ARGS(info, start, len)
1071)
1072
1073LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free,
1074
1075 TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len),
1076
1077 TP_ARGS(info, start, len)
1078)
1079
1080#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
1081
3bc29f0a 1082LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent,
b87700e3
AG
1083
1084 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
1085
1086 TP_ARGS(root, start, len),
1087
f127e61e
MD
1088 TP_FIELDS(
1089 ctf_integer(u64, root_objectid, root->root_key.objectid)
1090 ctf_integer(u64, start, start)
1091 ctf_integer(u64, len, len)
1092 )
b87700e3
AG
1093)
1094
3bc29f0a 1095LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc,
b87700e3
AG
1096
1097 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
1098
1099 TP_ARGS(root, start, len)
1100)
1101
3bc29f0a 1102LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free,
b87700e3
AG
1103
1104 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
1105
1106 TP_ARGS(root, start, len)
1107)
1108
ff8bdcc2
MD
1109#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
1110
68fd6a25 1111#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
ff8bdcc2 1112
83a4fd47
MJ
1113LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
1114
1115 btrfs_find_free_extent,
1116
1117 TP_PROTO(const struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size,
1118 u64 data),
1119
1120 TP_ARGS(info, num_bytes, empty_size, data),
1121
1122 TP_FIELDS(
1123 ctf_integer(u64, num_bytes, num_bytes)
1124 ctf_integer(u64, empty_size, empty_size)
1125 ctf_integer(u64, data, data)
1126 )
1127)
1128
1129LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
1130
1131 TP_PROTO(const struct btrfs_fs_info *info,
1132 const struct btrfs_block_group_cache *block_group, u64 start,
1133 u64 len),
1134
1135 TP_ARGS(info, block_group, start, len),
1136
1137 TP_FIELDS(
1138 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1139 ctf_integer(u64, flags, block_group->flags)
1140 ctf_integer(u64, start, start)
1141 ctf_integer(u64, len, len)
1142 )
1143)
1144
1145LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent,
1146
1147 TP_PROTO(const struct btrfs_fs_info *info,
1148 const struct btrfs_block_group_cache *block_group, u64 start,
1149 u64 len),
1150
1151 TP_ARGS(info, block_group, start, len)
1152)
1153
1154LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
1155
1156 TP_PROTO(const struct btrfs_fs_info *info,
1157 const struct btrfs_block_group_cache *block_group, u64 start,
1158 u64 len),
1159
1160 TP_ARGS(info, block_group, start, len)
1161)
1162
1163#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
1164
ff8bdcc2
MD
1165LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
1166
1167 btrfs_find_free_extent,
1168
1169 TP_PROTO(struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size,
1170 u64 data),
1171
1172 TP_ARGS(info, num_bytes, empty_size, data),
1173
1174 TP_FIELDS(
1175 ctf_integer(u64, num_bytes, num_bytes)
1176 ctf_integer(u64, empty_size, empty_size)
1177 ctf_integer(u64, data, data)
1178 )
1179)
1180
1181LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
1182
1183 TP_PROTO(struct btrfs_fs_info *info,
1184 struct btrfs_block_group_cache *block_group, u64 start,
1185 u64 len),
1186
1187 TP_ARGS(info, block_group, start, len),
1188
1189 TP_FIELDS(
1190 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1191 ctf_integer(u64, flags, block_group->flags)
1192 ctf_integer(u64, start, start)
1193 ctf_integer(u64, len, len)
1194 )
1195)
1196
1197LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent,
1198
1199 TP_PROTO(struct btrfs_fs_info *info,
1200 struct btrfs_block_group_cache *block_group, u64 start,
1201 u64 len),
1202
1203 TP_ARGS(info, block_group, start, len)
1204)
1205
1206LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
1207
1208 TP_PROTO(struct btrfs_fs_info *info,
1209 struct btrfs_block_group_cache *block_group, u64 start,
1210 u64 len),
1211
1212 TP_ARGS(info, block_group, start, len)
1213)
1214
83a4fd47 1215#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
ff8bdcc2 1216
3bc29f0a 1217LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
9cf29d3e
MD
1218
1219 btrfs_find_free_extent,
b87700e3
AG
1220
1221 TP_PROTO(struct btrfs_root *root, u64 num_bytes, u64 empty_size,
1222 u64 data),
1223
1224 TP_ARGS(root, num_bytes, empty_size, data),
1225
f127e61e
MD
1226 TP_FIELDS(
1227 ctf_integer(u64, root_objectid, root->root_key.objectid)
1228 ctf_integer(u64, num_bytes, num_bytes)
1229 ctf_integer(u64, empty_size, empty_size)
1230 ctf_integer(u64, data, data)
1231 )
b87700e3
AG
1232)
1233
3bc29f0a 1234LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
b87700e3
AG
1235
1236 TP_PROTO(struct btrfs_root *root,
1237 struct btrfs_block_group_cache *block_group, u64 start,
1238 u64 len),
1239
1240 TP_ARGS(root, block_group, start, len),
1241
f127e61e
MD
1242 TP_FIELDS(
1243 ctf_integer(u64, root_objectid, root->root_key.objectid)
1244 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1245 ctf_integer(u64, flags, block_group->flags)
1246 ctf_integer(u64, start, start)
1247 ctf_integer(u64, len, len)
1248 )
b87700e3
AG
1249)
1250
3bc29f0a 1251LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent,
b87700e3
AG
1252
1253 TP_PROTO(struct btrfs_root *root,
1254 struct btrfs_block_group_cache *block_group, u64 start,
1255 u64 len),
1256
1257 TP_ARGS(root, block_group, start, len)
1258)
1259
3bc29f0a 1260LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
b87700e3
AG
1261
1262 TP_PROTO(struct btrfs_root *root,
1263 struct btrfs_block_group_cache *block_group, u64 start,
1264 u64 len),
1265
1266 TP_ARGS(root, block_group, start, len)
1267)
1268
ff8bdcc2
MD
1269#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
1270
83a4fd47
MJ
1271#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1272LTTNG_TRACEPOINT_EVENT(btrfs_find_cluster,
1273
1274 TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start,
1275 u64 bytes, u64 empty_size, u64 min_bytes),
1276
1277 TP_ARGS(block_group, start, bytes, empty_size, min_bytes),
1278
1279 TP_FIELDS(
1280 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1281 ctf_integer(u64, flags, block_group->flags)
1282 ctf_integer(u64, start, start)
1283 ctf_integer(u64, bytes, bytes)
1284 ctf_integer(u64, empty_size, empty_size)
1285 ctf_integer(u64, min_bytes, min_bytes)
1286 )
1287)
1288
1289LTTNG_TRACEPOINT_EVENT(btrfs_failed_cluster_setup,
1290
1291 TP_PROTO(const struct btrfs_block_group_cache *block_group),
1292
1293 TP_ARGS(block_group),
1294
1295 TP_FIELDS(
1296 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1297 )
1298)
1299
1300LTTNG_TRACEPOINT_EVENT(btrfs_setup_cluster,
1301
1302 TP_PROTO(const struct btrfs_block_group_cache *block_group,
1303 const struct btrfs_free_cluster *cluster, u64 size, int bitmap),
1304
1305 TP_ARGS(block_group, cluster, size, bitmap),
1306
1307 TP_FIELDS(
1308 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1309 ctf_integer(u64, flags, block_group->flags)
1310 ctf_integer(u64, start, cluster->window_start)
1311 ctf_integer(u64, max_size, cluster->max_size)
1312 ctf_integer(u64, size, size)
1313 ctf_integer(int, bitmap, bitmap)
1314 )
1315)
1316#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
3bc29f0a 1317LTTNG_TRACEPOINT_EVENT(btrfs_find_cluster,
b87700e3
AG
1318
1319 TP_PROTO(struct btrfs_block_group_cache *block_group, u64 start,
1320 u64 bytes, u64 empty_size, u64 min_bytes),
1321
1322 TP_ARGS(block_group, start, bytes, empty_size, min_bytes),
1323
f127e61e
MD
1324 TP_FIELDS(
1325 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1326 ctf_integer(u64, flags, block_group->flags)
1327 ctf_integer(u64, start, start)
1328 ctf_integer(u64, bytes, bytes)
1329 ctf_integer(u64, empty_size, empty_size)
1330 ctf_integer(u64, min_bytes, min_bytes)
1331 )
b87700e3
AG
1332)
1333
3bc29f0a 1334LTTNG_TRACEPOINT_EVENT(btrfs_failed_cluster_setup,
b87700e3
AG
1335
1336 TP_PROTO(struct btrfs_block_group_cache *block_group),
1337
1338 TP_ARGS(block_group),
1339
f127e61e
MD
1340 TP_FIELDS(
1341 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1342 )
b87700e3
AG
1343)
1344
3bc29f0a 1345LTTNG_TRACEPOINT_EVENT(btrfs_setup_cluster,
b87700e3
AG
1346
1347 TP_PROTO(struct btrfs_block_group_cache *block_group,
1348 struct btrfs_free_cluster *cluster, u64 size, int bitmap),
1349
1350 TP_ARGS(block_group, cluster, size, bitmap),
1351
f127e61e
MD
1352 TP_FIELDS(
1353 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1354 ctf_integer(u64, flags, block_group->flags)
1355 ctf_integer(u64, start, cluster->window_start)
1356 ctf_integer(u64, max_size, cluster->max_size)
1357 ctf_integer(u64, size, size)
1358 ctf_integer(int, bitmap, bitmap)
1359 )
b87700e3
AG
1360)
1361#endif
1362
83a4fd47
MJ
1363#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1364LTTNG_TRACEPOINT_EVENT_MAP(alloc_extent_state,
1365
1366 btrfs_alloc_extent_state,
1367
1368 TP_PROTO(const struct extent_state *state, gfp_t mask, unsigned long IP),
1369
1370 TP_ARGS(state, mask, IP),
1371
1372 TP_FIELDS(
1373 ctf_integer_hex(const struct extent_state *, state, state)
1374 ctf_integer(gfp_t, mask, mask)
1375 ctf_integer(unsigned long, ip, IP)
1376 )
1377)
1378
1379LTTNG_TRACEPOINT_EVENT_MAP(free_extent_state,
1380
1381 btrfs_free_extent_state,
1382
1383 TP_PROTO(const struct extent_state *state, unsigned long IP),
1384
1385 TP_ARGS(state, IP),
1386
1387 TP_FIELDS(
1388 ctf_integer_hex(const struct extent_state *, state, state)
1389 ctf_integer(unsigned long, ip, IP)
1390 )
1391)
1392#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
3bc29f0a 1393LTTNG_TRACEPOINT_EVENT_MAP(alloc_extent_state,
9cf29d3e
MD
1394
1395 btrfs_alloc_extent_state,
b87700e3
AG
1396
1397 TP_PROTO(struct extent_state *state, gfp_t mask, unsigned long IP),
1398
1399 TP_ARGS(state, mask, IP),
1400
f127e61e 1401 TP_FIELDS(
fa91fcac 1402 ctf_integer_hex(struct extent_state *, state, state)
f127e61e
MD
1403 ctf_integer(gfp_t, mask, mask)
1404 ctf_integer(unsigned long, ip, IP)
1405 )
b87700e3
AG
1406)
1407
3bc29f0a 1408LTTNG_TRACEPOINT_EVENT_MAP(free_extent_state,
9cf29d3e
MD
1409
1410 btrfs_free_extent_state,
b87700e3
AG
1411
1412 TP_PROTO(struct extent_state *state, unsigned long IP),
1413
1414 TP_ARGS(state, IP),
1415
f127e61e 1416 TP_FIELDS(
fa91fcac 1417 ctf_integer_hex(struct extent_state *, state, state)
f127e61e
MD
1418 ctf_integer(unsigned long, ip, IP)
1419 )
b87700e3
AG
1420)
1421#endif
1422
3bc29f0a 1423#endif /* LTTNG_TRACE_BTRFS_H */
b87700e3
AG
1424
1425/* This part must be outside protection */
6ec43db8 1426#include <probes/define_trace.h>
This page took 0.16809 seconds and 5 git commands to generate.