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