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