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