Fix: version check error in btrfs instrumentation
[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
1f1ec4ed
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)
1f1ec4ed
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
1f1ec4ed 162#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
5807b1af
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
1f1ec4ed
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))
5807b1af
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)
5807b1af 318#endif
b87700e3 319
1f1ec4ed
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)
1f1ec4ed 519#endif
b87700e3 520
1f1ec4ed
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
1f1ec4ed
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)
1f1ec4ed 592#endif
fcd0a11c 593
1f1ec4ed
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
fcd0a11c
MD
683#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
684LTTNG_TRACEPOINT_EVENT(btrfs_delayed_ref_head,
685
686 TP_PROTO(struct btrfs_fs_info *fs_info,
687 struct btrfs_delayed_ref_node *ref,
688 struct btrfs_delayed_ref_head *head_ref,
689 int action),
690
691 TP_ARGS(fs_info, ref, head_ref, action),
692
693 TP_FIELDS(
694 ctf_integer(u64, bytenr, ref->bytenr)
695 ctf_integer(u64, num_bytes, ref->num_bytes)
696 ctf_integer(int, action, action)
697 ctf_integer(int, is_data, head_ref->is_data)
698 )
699)
700
701#else
3bc29f0a 702LTTNG_TRACEPOINT_EVENT(btrfs_delayed_ref_head,
b87700e3
AG
703
704 TP_PROTO(struct btrfs_delayed_ref_node *ref,
705 struct btrfs_delayed_ref_head *head_ref,
706 int action),
707
708 TP_ARGS(ref, head_ref, action),
709
f127e61e
MD
710 TP_FIELDS(
711 ctf_integer(u64, bytenr, ref->bytenr)
712 ctf_integer(u64, num_bytes, ref->num_bytes)
713 ctf_integer(int, action, action)
714 ctf_integer(int, is_data, head_ref->is_data)
715 )
b87700e3 716)
fcd0a11c 717#endif
b87700e3 718
1f1ec4ed
MJ
719#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
720
721LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk,
722
723 TP_PROTO(const struct btrfs_fs_info *fs_info, const struct map_lookup *map,
724 u64 offset, u64 size),
725
726 TP_ARGS(fs_info, map, offset, size),
727
728 TP_FIELDS(
729 ctf_integer(int, num_stripes, map->num_stripes)
730 ctf_integer(u64, type, map->type)
731 ctf_integer(int, sub_stripes, map->sub_stripes)
732 ctf_integer(u64, offset, offset)
733 ctf_integer(u64, size, size)
734 ctf_integer(u64, root_objectid, fs_info->chunk_root->root_key.objectid)
735 )
736)
737
738LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc,
739
740 TP_PROTO(const struct btrfs_fs_info *info, const struct map_lookup *map,
741 u64 offset, u64 size),
742
743 TP_ARGS(info, map, offset, size)
744)
745
746LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free,
747
748 TP_PROTO(const struct btrfs_fs_info *info, const struct map_lookup *map,
749 u64 offset, u64 size),
750
751 TP_ARGS(info, map, offset, size)
752)
753
754#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
ff8bdcc2
MD
755
756LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk,
757
758 TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map,
759 u64 offset, u64 size),
760
761 TP_ARGS(fs_info, map, offset, size),
762
763 TP_FIELDS(
764 ctf_integer(int, num_stripes, map->num_stripes)
765 ctf_integer(u64, type, map->type)
766 ctf_integer(int, sub_stripes, map->sub_stripes)
767 ctf_integer(u64, offset, offset)
768 ctf_integer(u64, size, size)
769 ctf_integer(u64, root_objectid, fs_info->chunk_root->root_key.objectid)
770 )
771)
772
773LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc,
774
775 TP_PROTO(struct btrfs_fs_info *info, struct map_lookup *map,
776 u64 offset, u64 size),
777
778 TP_ARGS(info, map, offset, size)
779)
780
781LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free,
782
783 TP_PROTO(struct btrfs_fs_info *info, struct map_lookup *map,
784 u64 offset, u64 size),
785
786 TP_ARGS(info, map, offset, size)
787)
788
789#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
790
3bc29f0a 791LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk,
b87700e3
AG
792
793 TP_PROTO(struct btrfs_root *root, struct map_lookup *map,
794 u64 offset, u64 size),
795
796 TP_ARGS(root, map, offset, size),
797
f127e61e
MD
798 TP_FIELDS(
799 ctf_integer(int, num_stripes, map->num_stripes)
800 ctf_integer(u64, type, map->type)
801 ctf_integer(int, sub_stripes, map->sub_stripes)
802 ctf_integer(u64, offset, offset)
803 ctf_integer(u64, size, size)
804 ctf_integer(u64, root_objectid, root->root_key.objectid)
805 )
b87700e3
AG
806)
807
3bc29f0a 808LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc,
b87700e3
AG
809
810 TP_PROTO(struct btrfs_root *root, struct map_lookup *map,
811 u64 offset, u64 size),
812
813 TP_ARGS(root, map, offset, size)
814)
815
3bc29f0a 816LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free,
b87700e3
AG
817
818 TP_PROTO(struct btrfs_root *root, struct map_lookup *map,
819 u64 offset, u64 size),
820
821 TP_ARGS(root, map, offset, size)
822)
823
ff8bdcc2
MD
824#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
825
1f1ec4ed
MJ
826#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
827LTTNG_TRACEPOINT_EVENT(btrfs_cow_block,
828
829 TP_PROTO(const struct btrfs_root *root, const struct extent_buffer *buf,
830 const struct extent_buffer *cow),
831
832 TP_ARGS(root, buf, cow),
833
834 TP_FIELDS(
835 ctf_integer(u64, root_objectid, root->root_key.objectid)
836 ctf_integer(u64, buf_start, buf->start)
837 ctf_integer(int, refs, atomic_read(&buf->refs))
838 ctf_integer(u64, cow_start, cow->start)
839 ctf_integer(int, buf_level, btrfs_header_level(buf))
840 ctf_integer(int, cow_level, btrfs_header_level(cow))
841 )
842)
843#else
3bc29f0a 844LTTNG_TRACEPOINT_EVENT(btrfs_cow_block,
b87700e3
AG
845
846 TP_PROTO(struct btrfs_root *root, struct extent_buffer *buf,
847 struct extent_buffer *cow),
848
849 TP_ARGS(root, buf, cow),
850
f127e61e
MD
851 TP_FIELDS(
852 ctf_integer(u64, root_objectid, root->root_key.objectid)
853 ctf_integer(u64, buf_start, buf->start)
854 ctf_integer(int, refs, atomic_read(&buf->refs))
855 ctf_integer(u64, cow_start, cow->start)
856 ctf_integer(int, buf_level, btrfs_header_level(buf))
857 ctf_integer(int, cow_level, btrfs_header_level(cow))
858 )
b87700e3 859)
1f1ec4ed 860#endif
b87700e3 861
1f1ec4ed
MJ
862#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
863LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation,
864
865 TP_PROTO(const struct btrfs_fs_info *fs_info, char *type, u64 val,
866 u64 bytes, int reserve),
867
868 TP_ARGS(fs_info, type, val, bytes, reserve),
869
870 TP_FIELDS(
871 ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
872 ctf_string(type, type)
873 ctf_integer(u64, val, val)
874 ctf_integer(u64, bytes, bytes)
875 ctf_integer(int, reserve, reserve)
876 )
877)
878#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
3bc29f0a 879LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation,
b87700e3
AG
880
881 TP_PROTO(struct btrfs_fs_info *fs_info, char *type, u64 val,
882 u64 bytes, int reserve),
883
884 TP_ARGS(fs_info, type, val, bytes, reserve),
885
f127e61e
MD
886 TP_FIELDS(
887 ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
888 ctf_string(type, type)
889 ctf_integer(u64, val, val)
890 ctf_integer(u64, bytes, bytes)
891 ctf_integer(int, reserve, reserve)
892 )
b87700e3
AG
893)
894#endif
895
1f1ec4ed
MJ
896#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
897
898LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent,
899
900 TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len),
901
902 TP_ARGS(info, start, len),
903
904 TP_FIELDS(
905 ctf_integer(u64, start, start)
906 ctf_integer(u64, len, len)
907 )
908)
909
910LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc,
911
912 TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len),
913
914 TP_ARGS(info, start, len)
915)
916
917LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free,
918
919 TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len),
920
921 TP_ARGS(info, start, len)
922)
923
924#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
ff8bdcc2
MD
925
926LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent,
927
928 TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len),
929
930 TP_ARGS(info, start, len),
931
932 TP_FIELDS(
933 ctf_integer(u64, start, start)
934 ctf_integer(u64, len, len)
935 )
936)
937
938LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc,
939
940 TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len),
941
942 TP_ARGS(info, start, len)
943)
944
945LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free,
946
947 TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len),
948
949 TP_ARGS(info, start, len)
950)
951
952#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
953
3bc29f0a 954LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent,
b87700e3
AG
955
956 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
957
958 TP_ARGS(root, start, len),
959
f127e61e
MD
960 TP_FIELDS(
961 ctf_integer(u64, root_objectid, root->root_key.objectid)
962 ctf_integer(u64, start, start)
963 ctf_integer(u64, len, len)
964 )
b87700e3
AG
965)
966
3bc29f0a 967LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc,
b87700e3
AG
968
969 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
970
971 TP_ARGS(root, start, len)
972)
973
3bc29f0a 974LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free,
b87700e3
AG
975
976 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
977
978 TP_ARGS(root, start, len)
979)
980
ff8bdcc2
MD
981#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
982
da3122a5 983#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
ff8bdcc2 984
1f1ec4ed
MJ
985LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
986
987 btrfs_find_free_extent,
988
989 TP_PROTO(const struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size,
990 u64 data),
991
992 TP_ARGS(info, num_bytes, empty_size, data),
993
994 TP_FIELDS(
995 ctf_integer(u64, num_bytes, num_bytes)
996 ctf_integer(u64, empty_size, empty_size)
997 ctf_integer(u64, data, data)
998 )
999)
1000
1001LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
1002
1003 TP_PROTO(const struct btrfs_fs_info *info,
1004 const struct btrfs_block_group_cache *block_group, u64 start,
1005 u64 len),
1006
1007 TP_ARGS(info, block_group, start, len),
1008
1009 TP_FIELDS(
1010 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1011 ctf_integer(u64, flags, block_group->flags)
1012 ctf_integer(u64, start, start)
1013 ctf_integer(u64, len, len)
1014 )
1015)
1016
1017LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent,
1018
1019 TP_PROTO(const struct btrfs_fs_info *info,
1020 const struct btrfs_block_group_cache *block_group, u64 start,
1021 u64 len),
1022
1023 TP_ARGS(info, block_group, start, len)
1024)
1025
1026LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
1027
1028 TP_PROTO(const struct btrfs_fs_info *info,
1029 const struct btrfs_block_group_cache *block_group, u64 start,
1030 u64 len),
1031
1032 TP_ARGS(info, block_group, start, len)
1033)
1034
1035#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
1036
ff8bdcc2
MD
1037LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
1038
1039 btrfs_find_free_extent,
1040
1041 TP_PROTO(struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size,
1042 u64 data),
1043
1044 TP_ARGS(info, num_bytes, empty_size, data),
1045
1046 TP_FIELDS(
1047 ctf_integer(u64, num_bytes, num_bytes)
1048 ctf_integer(u64, empty_size, empty_size)
1049 ctf_integer(u64, data, data)
1050 )
1051)
1052
1053LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
1054
1055 TP_PROTO(struct btrfs_fs_info *info,
1056 struct btrfs_block_group_cache *block_group, u64 start,
1057 u64 len),
1058
1059 TP_ARGS(info, block_group, start, len),
1060
1061 TP_FIELDS(
1062 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1063 ctf_integer(u64, flags, block_group->flags)
1064 ctf_integer(u64, start, start)
1065 ctf_integer(u64, len, len)
1066 )
1067)
1068
1069LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent,
1070
1071 TP_PROTO(struct btrfs_fs_info *info,
1072 struct btrfs_block_group_cache *block_group, u64 start,
1073 u64 len),
1074
1075 TP_ARGS(info, block_group, start, len)
1076)
1077
1078LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
1079
1080 TP_PROTO(struct btrfs_fs_info *info,
1081 struct btrfs_block_group_cache *block_group, u64 start,
1082 u64 len),
1083
1084 TP_ARGS(info, block_group, start, len)
1085)
1086
1f1ec4ed 1087#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
ff8bdcc2 1088
3bc29f0a 1089LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
9cf29d3e
MD
1090
1091 btrfs_find_free_extent,
b87700e3
AG
1092
1093 TP_PROTO(struct btrfs_root *root, u64 num_bytes, u64 empty_size,
1094 u64 data),
1095
1096 TP_ARGS(root, num_bytes, empty_size, data),
1097
f127e61e
MD
1098 TP_FIELDS(
1099 ctf_integer(u64, root_objectid, root->root_key.objectid)
1100 ctf_integer(u64, num_bytes, num_bytes)
1101 ctf_integer(u64, empty_size, empty_size)
1102 ctf_integer(u64, data, data)
1103 )
b87700e3
AG
1104)
1105
3bc29f0a 1106LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
b87700e3
AG
1107
1108 TP_PROTO(struct btrfs_root *root,
1109 struct btrfs_block_group_cache *block_group, u64 start,
1110 u64 len),
1111
1112 TP_ARGS(root, block_group, start, len),
1113
f127e61e
MD
1114 TP_FIELDS(
1115 ctf_integer(u64, root_objectid, root->root_key.objectid)
1116 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1117 ctf_integer(u64, flags, block_group->flags)
1118 ctf_integer(u64, start, start)
1119 ctf_integer(u64, len, len)
1120 )
b87700e3
AG
1121)
1122
3bc29f0a 1123LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent,
b87700e3
AG
1124
1125 TP_PROTO(struct btrfs_root *root,
1126 struct btrfs_block_group_cache *block_group, u64 start,
1127 u64 len),
1128
1129 TP_ARGS(root, block_group, start, len)
1130)
1131
3bc29f0a 1132LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
b87700e3
AG
1133
1134 TP_PROTO(struct btrfs_root *root,
1135 struct btrfs_block_group_cache *block_group, u64 start,
1136 u64 len),
1137
1138 TP_ARGS(root, block_group, start, len)
1139)
1140
ff8bdcc2
MD
1141#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
1142
1f1ec4ed
MJ
1143#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1144LTTNG_TRACEPOINT_EVENT(btrfs_find_cluster,
1145
1146 TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start,
1147 u64 bytes, u64 empty_size, u64 min_bytes),
1148
1149 TP_ARGS(block_group, start, bytes, empty_size, min_bytes),
1150
1151 TP_FIELDS(
1152 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1153 ctf_integer(u64, flags, block_group->flags)
1154 ctf_integer(u64, start, start)
1155 ctf_integer(u64, bytes, bytes)
1156 ctf_integer(u64, empty_size, empty_size)
1157 ctf_integer(u64, min_bytes, min_bytes)
1158 )
1159)
1160
1161LTTNG_TRACEPOINT_EVENT(btrfs_failed_cluster_setup,
1162
1163 TP_PROTO(const struct btrfs_block_group_cache *block_group),
1164
1165 TP_ARGS(block_group),
1166
1167 TP_FIELDS(
1168 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1169 )
1170)
1171
1172LTTNG_TRACEPOINT_EVENT(btrfs_setup_cluster,
1173
1174 TP_PROTO(const struct btrfs_block_group_cache *block_group,
1175 const struct btrfs_free_cluster *cluster, u64 size, int bitmap),
1176
1177 TP_ARGS(block_group, cluster, size, bitmap),
1178
1179 TP_FIELDS(
1180 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1181 ctf_integer(u64, flags, block_group->flags)
1182 ctf_integer(u64, start, cluster->window_start)
1183 ctf_integer(u64, max_size, cluster->max_size)
1184 ctf_integer(u64, size, size)
1185 ctf_integer(int, bitmap, bitmap)
1186 )
1187)
1188#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
3bc29f0a 1189LTTNG_TRACEPOINT_EVENT(btrfs_find_cluster,
b87700e3
AG
1190
1191 TP_PROTO(struct btrfs_block_group_cache *block_group, u64 start,
1192 u64 bytes, u64 empty_size, u64 min_bytes),
1193
1194 TP_ARGS(block_group, start, bytes, empty_size, min_bytes),
1195
f127e61e
MD
1196 TP_FIELDS(
1197 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1198 ctf_integer(u64, flags, block_group->flags)
1199 ctf_integer(u64, start, start)
1200 ctf_integer(u64, bytes, bytes)
1201 ctf_integer(u64, empty_size, empty_size)
1202 ctf_integer(u64, min_bytes, min_bytes)
1203 )
b87700e3
AG
1204)
1205
3bc29f0a 1206LTTNG_TRACEPOINT_EVENT(btrfs_failed_cluster_setup,
b87700e3
AG
1207
1208 TP_PROTO(struct btrfs_block_group_cache *block_group),
1209
1210 TP_ARGS(block_group),
1211
f127e61e
MD
1212 TP_FIELDS(
1213 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1214 )
b87700e3
AG
1215)
1216
3bc29f0a 1217LTTNG_TRACEPOINT_EVENT(btrfs_setup_cluster,
b87700e3
AG
1218
1219 TP_PROTO(struct btrfs_block_group_cache *block_group,
1220 struct btrfs_free_cluster *cluster, u64 size, int bitmap),
1221
1222 TP_ARGS(block_group, cluster, size, bitmap),
1223
f127e61e
MD
1224 TP_FIELDS(
1225 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1226 ctf_integer(u64, flags, block_group->flags)
1227 ctf_integer(u64, start, cluster->window_start)
1228 ctf_integer(u64, max_size, cluster->max_size)
1229 ctf_integer(u64, size, size)
1230 ctf_integer(int, bitmap, bitmap)
1231 )
b87700e3
AG
1232)
1233#endif
1234
1f1ec4ed
MJ
1235#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1236LTTNG_TRACEPOINT_EVENT_MAP(alloc_extent_state,
1237
1238 btrfs_alloc_extent_state,
1239
1240 TP_PROTO(const struct extent_state *state, gfp_t mask, unsigned long IP),
1241
1242 TP_ARGS(state, mask, IP),
1243
1244 TP_FIELDS(
1245 ctf_integer_hex(const struct extent_state *, state, state)
1246 ctf_integer(gfp_t, mask, mask)
1247 ctf_integer(unsigned long, ip, IP)
1248 )
1249)
1250
1251LTTNG_TRACEPOINT_EVENT_MAP(free_extent_state,
1252
1253 btrfs_free_extent_state,
1254
1255 TP_PROTO(const struct extent_state *state, unsigned long IP),
1256
1257 TP_ARGS(state, IP),
1258
1259 TP_FIELDS(
1260 ctf_integer_hex(const struct extent_state *, state, state)
1261 ctf_integer(unsigned long, ip, IP)
1262 )
1263)
1264#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
3bc29f0a 1265LTTNG_TRACEPOINT_EVENT_MAP(alloc_extent_state,
9cf29d3e
MD
1266
1267 btrfs_alloc_extent_state,
b87700e3
AG
1268
1269 TP_PROTO(struct extent_state *state, gfp_t mask, unsigned long IP),
1270
1271 TP_ARGS(state, mask, IP),
1272
f127e61e 1273 TP_FIELDS(
fa91fcac 1274 ctf_integer_hex(struct extent_state *, state, state)
f127e61e
MD
1275 ctf_integer(gfp_t, mask, mask)
1276 ctf_integer(unsigned long, ip, IP)
1277 )
b87700e3
AG
1278)
1279
3bc29f0a 1280LTTNG_TRACEPOINT_EVENT_MAP(free_extent_state,
9cf29d3e
MD
1281
1282 btrfs_free_extent_state,
b87700e3
AG
1283
1284 TP_PROTO(struct extent_state *state, unsigned long IP),
1285
1286 TP_ARGS(state, IP),
1287
f127e61e 1288 TP_FIELDS(
fa91fcac 1289 ctf_integer_hex(struct extent_state *, state, state)
f127e61e
MD
1290 ctf_integer(unsigned long, ip, IP)
1291 )
b87700e3
AG
1292)
1293#endif
1294
3bc29f0a 1295#endif /* LTTNG_TRACE_BTRFS_H */
b87700e3
AG
1296
1297/* This part must be outside protection */
6ec43db8 1298#include <probes/define_trace.h>
This page took 0.085497 seconds and 4 git commands to generate.