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