.. | .. |
---|
19 | 19 | struct btrfs_delayed_tree_ref; |
---|
20 | 20 | struct btrfs_delayed_data_ref; |
---|
21 | 21 | struct btrfs_delayed_ref_head; |
---|
22 | | -struct btrfs_block_group_cache; |
---|
| 22 | +struct btrfs_block_group; |
---|
23 | 23 | struct btrfs_free_cluster; |
---|
24 | 24 | struct map_lookup; |
---|
25 | 25 | struct extent_buffer; |
---|
.. | .. |
---|
27 | 27 | struct __btrfs_workqueue; |
---|
28 | 28 | struct btrfs_qgroup_extent_record; |
---|
29 | 29 | struct btrfs_qgroup; |
---|
| 30 | +struct extent_io_tree; |
---|
30 | 31 | struct prelim_ref; |
---|
31 | | - |
---|
32 | | -TRACE_DEFINE_ENUM(FLUSH_DELAYED_ITEMS_NR); |
---|
33 | | -TRACE_DEFINE_ENUM(FLUSH_DELAYED_ITEMS); |
---|
34 | | -TRACE_DEFINE_ENUM(FLUSH_DELALLOC); |
---|
35 | | -TRACE_DEFINE_ENUM(FLUSH_DELALLOC_WAIT); |
---|
36 | | -TRACE_DEFINE_ENUM(ALLOC_CHUNK); |
---|
37 | | -TRACE_DEFINE_ENUM(COMMIT_TRANS); |
---|
| 32 | +struct btrfs_space_info; |
---|
38 | 33 | |
---|
39 | 34 | #define show_ref_type(type) \ |
---|
40 | 35 | __print_symbolic(type, \ |
---|
.. | .. |
---|
65 | 60 | (obj >= BTRFS_ROOT_TREE_OBJECTID && \ |
---|
66 | 61 | obj <= BTRFS_QUOTA_TREE_OBJECTID)) ? __show_root_type(obj) : "-" |
---|
67 | 62 | |
---|
68 | | -#define show_fi_type(type) \ |
---|
69 | | - __print_symbolic(type, \ |
---|
70 | | - { BTRFS_FILE_EXTENT_INLINE, "INLINE" }, \ |
---|
71 | | - { BTRFS_FILE_EXTENT_REG, "REG" }, \ |
---|
72 | | - { BTRFS_FILE_EXTENT_PREALLOC, "PREALLOC"}) |
---|
| 63 | +#define FLUSH_ACTIONS \ |
---|
| 64 | + EM( BTRFS_RESERVE_NO_FLUSH, "BTRFS_RESERVE_NO_FLUSH") \ |
---|
| 65 | + EM( BTRFS_RESERVE_FLUSH_LIMIT, "BTRFS_RESERVE_FLUSH_LIMIT") \ |
---|
| 66 | + EM( BTRFS_RESERVE_FLUSH_ALL, "BTRFS_RESERVE_FLUSH_ALL") \ |
---|
| 67 | + EMe(BTRFS_RESERVE_FLUSH_ALL_STEAL, "BTRFS_RESERVE_FLUSH_ALL_STEAL") |
---|
73 | 68 | |
---|
74 | | -#define show_qgroup_rsv_type(type) \ |
---|
75 | | - __print_symbolic(type, \ |
---|
76 | | - { BTRFS_QGROUP_RSV_DATA, "DATA" }, \ |
---|
77 | | - { BTRFS_QGROUP_RSV_META_PERTRANS, "META_PERTRANS" }, \ |
---|
78 | | - { BTRFS_QGROUP_RSV_META_PREALLOC, "META_PREALLOC" }) |
---|
| 69 | +#define FI_TYPES \ |
---|
| 70 | + EM( BTRFS_FILE_EXTENT_INLINE, "INLINE") \ |
---|
| 71 | + EM( BTRFS_FILE_EXTENT_REG, "REG") \ |
---|
| 72 | + EMe(BTRFS_FILE_EXTENT_PREALLOC, "PREALLOC") |
---|
| 73 | + |
---|
| 74 | +#define QGROUP_RSV_TYPES \ |
---|
| 75 | + EM( BTRFS_QGROUP_RSV_DATA, "DATA") \ |
---|
| 76 | + EM( BTRFS_QGROUP_RSV_META_PERTRANS, "META_PERTRANS") \ |
---|
| 77 | + EMe(BTRFS_QGROUP_RSV_META_PREALLOC, "META_PREALLOC") |
---|
| 78 | + |
---|
| 79 | +#define IO_TREE_OWNER \ |
---|
| 80 | + EM( IO_TREE_FS_PINNED_EXTENTS, "PINNED_EXTENTS") \ |
---|
| 81 | + EM( IO_TREE_FS_EXCLUDED_EXTENTS, "EXCLUDED_EXTENTS") \ |
---|
| 82 | + EM( IO_TREE_BTREE_INODE_IO, "BTREE_INODE_IO") \ |
---|
| 83 | + EM( IO_TREE_INODE_IO, "INODE_IO") \ |
---|
| 84 | + EM( IO_TREE_INODE_IO_FAILURE, "INODE_IO_FAILURE") \ |
---|
| 85 | + EM( IO_TREE_RELOC_BLOCKS, "RELOC_BLOCKS") \ |
---|
| 86 | + EM( IO_TREE_TRANS_DIRTY_PAGES, "TRANS_DIRTY_PAGES") \ |
---|
| 87 | + EM( IO_TREE_ROOT_DIRTY_LOG_PAGES, "ROOT_DIRTY_LOG_PAGES") \ |
---|
| 88 | + EM( IO_TREE_INODE_FILE_EXTENT, "INODE_FILE_EXTENT") \ |
---|
| 89 | + EM( IO_TREE_LOG_CSUM_RANGE, "LOG_CSUM_RANGE") \ |
---|
| 90 | + EMe(IO_TREE_SELFTEST, "SELFTEST") |
---|
| 91 | + |
---|
| 92 | +#define FLUSH_STATES \ |
---|
| 93 | + EM( FLUSH_DELAYED_ITEMS_NR, "FLUSH_DELAYED_ITEMS_NR") \ |
---|
| 94 | + EM( FLUSH_DELAYED_ITEMS, "FLUSH_DELAYED_ITEMS") \ |
---|
| 95 | + EM( FLUSH_DELALLOC, "FLUSH_DELALLOC") \ |
---|
| 96 | + EM( FLUSH_DELALLOC_WAIT, "FLUSH_DELALLOC_WAIT") \ |
---|
| 97 | + EM( FLUSH_DELAYED_REFS_NR, "FLUSH_DELAYED_REFS_NR") \ |
---|
| 98 | + EM( FLUSH_DELAYED_REFS, "FLUSH_ELAYED_REFS") \ |
---|
| 99 | + EM( ALLOC_CHUNK, "ALLOC_CHUNK") \ |
---|
| 100 | + EM( ALLOC_CHUNK_FORCE, "ALLOC_CHUNK_FORCE") \ |
---|
| 101 | + EM( RUN_DELAYED_IPUTS, "RUN_DELAYED_IPUTS") \ |
---|
| 102 | + EMe(COMMIT_TRANS, "COMMIT_TRANS") |
---|
| 103 | + |
---|
| 104 | +/* |
---|
| 105 | + * First define the enums in the above macros to be exported to userspace via |
---|
| 106 | + * TRACE_DEFINE_ENUM(). |
---|
| 107 | + */ |
---|
| 108 | + |
---|
| 109 | +#undef EM |
---|
| 110 | +#undef EMe |
---|
| 111 | +#define EM(a, b) TRACE_DEFINE_ENUM(a); |
---|
| 112 | +#define EMe(a, b) TRACE_DEFINE_ENUM(a); |
---|
| 113 | + |
---|
| 114 | +FLUSH_ACTIONS |
---|
| 115 | +FI_TYPES |
---|
| 116 | +QGROUP_RSV_TYPES |
---|
| 117 | +IO_TREE_OWNER |
---|
| 118 | +FLUSH_STATES |
---|
| 119 | + |
---|
| 120 | +/* |
---|
| 121 | + * Now redefine the EM and EMe macros to map the enums to the strings that will |
---|
| 122 | + * be printed in the output |
---|
| 123 | + */ |
---|
| 124 | + |
---|
| 125 | +#undef EM |
---|
| 126 | +#undef EMe |
---|
| 127 | +#define EM(a, b) {a, b}, |
---|
| 128 | +#define EMe(a, b) {a, b} |
---|
| 129 | + |
---|
79 | 130 | |
---|
80 | 131 | #define BTRFS_GROUP_FLAGS \ |
---|
81 | 132 | { BTRFS_BLOCK_GROUP_DATA, "DATA"}, \ |
---|
.. | .. |
---|
88 | 139 | { BTRFS_BLOCK_GROUP_RAID5, "RAID5"}, \ |
---|
89 | 140 | { BTRFS_BLOCK_GROUP_RAID6, "RAID6"} |
---|
90 | 141 | |
---|
| 142 | +#define EXTENT_FLAGS \ |
---|
| 143 | + { EXTENT_DIRTY, "DIRTY"}, \ |
---|
| 144 | + { EXTENT_UPTODATE, "UPTODATE"}, \ |
---|
| 145 | + { EXTENT_LOCKED, "LOCKED"}, \ |
---|
| 146 | + { EXTENT_NEW, "NEW"}, \ |
---|
| 147 | + { EXTENT_DELALLOC, "DELALLOC"}, \ |
---|
| 148 | + { EXTENT_DEFRAG, "DEFRAG"}, \ |
---|
| 149 | + { EXTENT_BOUNDARY, "BOUNDARY"}, \ |
---|
| 150 | + { EXTENT_NODATASUM, "NODATASUM"}, \ |
---|
| 151 | + { EXTENT_CLEAR_META_RESV, "CLEAR_META_RESV"}, \ |
---|
| 152 | + { EXTENT_NEED_WAIT, "NEED_WAIT"}, \ |
---|
| 153 | + { EXTENT_DAMAGED, "DAMAGED"}, \ |
---|
| 154 | + { EXTENT_NORESERVE, "NORESERVE"}, \ |
---|
| 155 | + { EXTENT_QGROUP_RESERVED, "QGROUP_RESERVED"}, \ |
---|
| 156 | + { EXTENT_CLEAR_DATA_RESV, "CLEAR_DATA_RESV"}, \ |
---|
| 157 | + { EXTENT_DELALLOC_NEW, "DELALLOC_NEW"} |
---|
| 158 | + |
---|
91 | 159 | #define BTRFS_FSID_SIZE 16 |
---|
92 | 160 | #define TP_STRUCT__entry_fsid __array(u8, fsid, BTRFS_FSID_SIZE) |
---|
93 | 161 | |
---|
94 | 162 | #define TP_fast_assign_fsid(fs_info) \ |
---|
95 | | - memcpy(__entry->fsid, fs_info->fsid, BTRFS_FSID_SIZE) |
---|
| 163 | +({ \ |
---|
| 164 | + if (fs_info) \ |
---|
| 165 | + memcpy(__entry->fsid, fs_info->fs_devices->fsid, \ |
---|
| 166 | + BTRFS_FSID_SIZE); \ |
---|
| 167 | + else \ |
---|
| 168 | + memset(__entry->fsid, 0, BTRFS_FSID_SIZE); \ |
---|
| 169 | +}) |
---|
96 | 170 | |
---|
97 | 171 | #define TP_STRUCT__entry_btrfs(args...) \ |
---|
98 | 172 | TP_STRUCT__entry( \ |
---|
.. | .. |
---|
134 | 208 | |
---|
135 | 209 | TP_STRUCT__entry_btrfs( |
---|
136 | 210 | __field( u64, ino ) |
---|
137 | | - __field( blkcnt_t, blocks ) |
---|
| 211 | + __field( u64, blocks ) |
---|
138 | 212 | __field( u64, disk_i_size ) |
---|
139 | 213 | __field( u64, generation ) |
---|
140 | 214 | __field( u64, last_trans ) |
---|
.. | .. |
---|
158 | 232 | show_root_type(__entry->root_objectid), |
---|
159 | 233 | __entry->generation, |
---|
160 | 234 | __entry->ino, |
---|
161 | | - (unsigned long long)__entry->blocks, |
---|
| 235 | + __entry->blocks, |
---|
162 | 236 | __entry->disk_i_size, |
---|
163 | 237 | __entry->last_trans, |
---|
164 | 238 | __entry->logged_trans) |
---|
.. | .. |
---|
256 | 330 | |
---|
257 | 331 | TRACE_EVENT(btrfs_handle_em_exist, |
---|
258 | 332 | |
---|
259 | | - TP_PROTO(struct btrfs_fs_info *fs_info, |
---|
| 333 | + TP_PROTO(const struct btrfs_fs_info *fs_info, |
---|
260 | 334 | const struct extent_map *existing, const struct extent_map *map, |
---|
261 | 335 | u64 start, u64 len), |
---|
262 | 336 | |
---|
.. | .. |
---|
294 | 368 | /* file extent item */ |
---|
295 | 369 | DECLARE_EVENT_CLASS(btrfs__file_extent_item_regular, |
---|
296 | 370 | |
---|
297 | | - TP_PROTO(struct btrfs_inode *bi, struct extent_buffer *l, |
---|
298 | | - struct btrfs_file_extent_item *fi, u64 start), |
---|
| 371 | + TP_PROTO(const struct btrfs_inode *bi, const struct extent_buffer *l, |
---|
| 372 | + const struct btrfs_file_extent_item *fi, u64 start), |
---|
299 | 373 | |
---|
300 | 374 | TP_ARGS(bi, l, fi, start), |
---|
301 | 375 | |
---|
.. | .. |
---|
316 | 390 | ), |
---|
317 | 391 | |
---|
318 | 392 | TP_fast_assign_btrfs(bi->root->fs_info, |
---|
319 | | - __entry->root_obj = bi->root->objectid; |
---|
| 393 | + __entry->root_obj = bi->root->root_key.objectid; |
---|
320 | 394 | __entry->ino = btrfs_ino(bi); |
---|
321 | 395 | __entry->isize = bi->vfs_inode.i_size; |
---|
322 | 396 | __entry->disk_isize = bi->disk_i_size; |
---|
.. | .. |
---|
342 | 416 | __entry->disk_isize, __entry->extent_start, |
---|
343 | 417 | __entry->extent_end, __entry->num_bytes, __entry->ram_bytes, |
---|
344 | 418 | __entry->disk_bytenr, __entry->disk_num_bytes, |
---|
345 | | - __entry->extent_offset, show_fi_type(__entry->extent_type), |
---|
| 419 | + __entry->extent_offset, __print_symbolic(__entry->extent_type, FI_TYPES), |
---|
346 | 420 | __entry->compression) |
---|
347 | 421 | ); |
---|
348 | 422 | |
---|
349 | 423 | DECLARE_EVENT_CLASS( |
---|
350 | 424 | btrfs__file_extent_item_inline, |
---|
351 | 425 | |
---|
352 | | - TP_PROTO(struct btrfs_inode *bi, struct extent_buffer *l, |
---|
353 | | - struct btrfs_file_extent_item *fi, int slot, u64 start), |
---|
| 426 | + TP_PROTO(const struct btrfs_inode *bi, const struct extent_buffer *l, |
---|
| 427 | + const struct btrfs_file_extent_item *fi, int slot, u64 start), |
---|
354 | 428 | |
---|
355 | 429 | TP_ARGS(bi, l, fi, slot, start), |
---|
356 | 430 | |
---|
.. | .. |
---|
367 | 441 | |
---|
368 | 442 | TP_fast_assign_btrfs( |
---|
369 | 443 | bi->root->fs_info, |
---|
370 | | - __entry->root_obj = bi->root->objectid; |
---|
| 444 | + __entry->root_obj = bi->root->root_key.objectid; |
---|
371 | 445 | __entry->ino = btrfs_ino(bi); |
---|
372 | 446 | __entry->isize = bi->vfs_inode.i_size; |
---|
373 | 447 | __entry->disk_isize = bi->disk_i_size; |
---|
.. | .. |
---|
383 | 457 | "extent_type=%s compression=%u", |
---|
384 | 458 | show_root_type(__entry->root_obj), __entry->ino, __entry->isize, |
---|
385 | 459 | __entry->disk_isize, __entry->extent_start, |
---|
386 | | - __entry->extent_end, show_fi_type(__entry->extent_type), |
---|
| 460 | + __entry->extent_end, __print_symbolic(__entry->extent_type, FI_TYPES), |
---|
387 | 461 | __entry->compression) |
---|
388 | 462 | ); |
---|
389 | 463 | |
---|
390 | 464 | DEFINE_EVENT( |
---|
391 | 465 | btrfs__file_extent_item_regular, btrfs_get_extent_show_fi_regular, |
---|
392 | 466 | |
---|
393 | | - TP_PROTO(struct btrfs_inode *bi, struct extent_buffer *l, |
---|
394 | | - struct btrfs_file_extent_item *fi, u64 start), |
---|
| 467 | + TP_PROTO(const struct btrfs_inode *bi, const struct extent_buffer *l, |
---|
| 468 | + const struct btrfs_file_extent_item *fi, u64 start), |
---|
395 | 469 | |
---|
396 | 470 | TP_ARGS(bi, l, fi, start) |
---|
397 | 471 | ); |
---|
.. | .. |
---|
399 | 473 | DEFINE_EVENT( |
---|
400 | 474 | btrfs__file_extent_item_regular, btrfs_truncate_show_fi_regular, |
---|
401 | 475 | |
---|
402 | | - TP_PROTO(struct btrfs_inode *bi, struct extent_buffer *l, |
---|
403 | | - struct btrfs_file_extent_item *fi, u64 start), |
---|
| 476 | + TP_PROTO(const struct btrfs_inode *bi, const struct extent_buffer *l, |
---|
| 477 | + const struct btrfs_file_extent_item *fi, u64 start), |
---|
404 | 478 | |
---|
405 | 479 | TP_ARGS(bi, l, fi, start) |
---|
406 | 480 | ); |
---|
.. | .. |
---|
408 | 482 | DEFINE_EVENT( |
---|
409 | 483 | btrfs__file_extent_item_inline, btrfs_get_extent_show_fi_inline, |
---|
410 | 484 | |
---|
411 | | - TP_PROTO(struct btrfs_inode *bi, struct extent_buffer *l, |
---|
412 | | - struct btrfs_file_extent_item *fi, int slot, u64 start), |
---|
| 485 | + TP_PROTO(const struct btrfs_inode *bi, const struct extent_buffer *l, |
---|
| 486 | + const struct btrfs_file_extent_item *fi, int slot, u64 start), |
---|
413 | 487 | |
---|
414 | 488 | TP_ARGS(bi, l, fi, slot, start) |
---|
415 | 489 | ); |
---|
.. | .. |
---|
417 | 491 | DEFINE_EVENT( |
---|
418 | 492 | btrfs__file_extent_item_inline, btrfs_truncate_show_fi_inline, |
---|
419 | 493 | |
---|
420 | | - TP_PROTO(struct btrfs_inode *bi, struct extent_buffer *l, |
---|
421 | | - struct btrfs_file_extent_item *fi, int slot, u64 start), |
---|
| 494 | + TP_PROTO(const struct btrfs_inode *bi, const struct extent_buffer *l, |
---|
| 495 | + const struct btrfs_file_extent_item *fi, int slot, u64 start), |
---|
422 | 496 | |
---|
423 | 497 | TP_ARGS(bi, l, fi, slot, start) |
---|
424 | 498 | ); |
---|
.. | .. |
---|
432 | 506 | { (1 << BTRFS_ORDERED_PREALLOC), "PREALLOC" }, \ |
---|
433 | 507 | { (1 << BTRFS_ORDERED_DIRECT), "DIRECT" }, \ |
---|
434 | 508 | { (1 << BTRFS_ORDERED_IOERR), "IOERR" }, \ |
---|
435 | | - { (1 << BTRFS_ORDERED_UPDATED_ISIZE), "UPDATED_ISIZE" }, \ |
---|
436 | 509 | { (1 << BTRFS_ORDERED_TRUNCATED), "TRUNCATED" }) |
---|
437 | 510 | |
---|
438 | 511 | |
---|
439 | 512 | DECLARE_EVENT_CLASS(btrfs__ordered_extent, |
---|
440 | 513 | |
---|
441 | | - TP_PROTO(const struct inode *inode, |
---|
| 514 | + TP_PROTO(const struct btrfs_inode *inode, |
---|
442 | 515 | const struct btrfs_ordered_extent *ordered), |
---|
443 | 516 | |
---|
444 | 517 | TP_ARGS(inode, ordered), |
---|
.. | .. |
---|
457 | 530 | __field( u64, truncated_len ) |
---|
458 | 531 | ), |
---|
459 | 532 | |
---|
460 | | - TP_fast_assign_btrfs(btrfs_sb(inode->i_sb), |
---|
461 | | - __entry->ino = btrfs_ino(BTRFS_I(inode)); |
---|
| 533 | + TP_fast_assign_btrfs(inode->root->fs_info, |
---|
| 534 | + __entry->ino = btrfs_ino(inode); |
---|
462 | 535 | __entry->file_offset = ordered->file_offset; |
---|
463 | | - __entry->start = ordered->start; |
---|
464 | | - __entry->len = ordered->len; |
---|
465 | | - __entry->disk_len = ordered->disk_len; |
---|
| 536 | + __entry->start = ordered->disk_bytenr; |
---|
| 537 | + __entry->len = ordered->num_bytes; |
---|
| 538 | + __entry->disk_len = ordered->disk_num_bytes; |
---|
466 | 539 | __entry->bytes_left = ordered->bytes_left; |
---|
467 | 540 | __entry->flags = ordered->flags; |
---|
468 | 541 | __entry->compress_type = ordered->compress_type; |
---|
469 | 542 | __entry->refs = refcount_read(&ordered->refs); |
---|
470 | | - __entry->root_objectid = |
---|
471 | | - BTRFS_I(inode)->root->root_key.objectid; |
---|
| 543 | + __entry->root_objectid = inode->root->root_key.objectid; |
---|
472 | 544 | __entry->truncated_len = ordered->truncated_len; |
---|
473 | 545 | ), |
---|
474 | 546 | |
---|
.. | .. |
---|
491 | 563 | |
---|
492 | 564 | DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_add, |
---|
493 | 565 | |
---|
494 | | - TP_PROTO(const struct inode *inode, |
---|
| 566 | + TP_PROTO(const struct btrfs_inode *inode, |
---|
495 | 567 | const struct btrfs_ordered_extent *ordered), |
---|
496 | 568 | |
---|
497 | 569 | TP_ARGS(inode, ordered) |
---|
.. | .. |
---|
499 | 571 | |
---|
500 | 572 | DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_remove, |
---|
501 | 573 | |
---|
502 | | - TP_PROTO(const struct inode *inode, |
---|
| 574 | + TP_PROTO(const struct btrfs_inode *inode, |
---|
503 | 575 | const struct btrfs_ordered_extent *ordered), |
---|
504 | 576 | |
---|
505 | 577 | TP_ARGS(inode, ordered) |
---|
.. | .. |
---|
507 | 579 | |
---|
508 | 580 | DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_start, |
---|
509 | 581 | |
---|
510 | | - TP_PROTO(const struct inode *inode, |
---|
| 582 | + TP_PROTO(const struct btrfs_inode *inode, |
---|
511 | 583 | const struct btrfs_ordered_extent *ordered), |
---|
512 | 584 | |
---|
513 | 585 | TP_ARGS(inode, ordered) |
---|
.. | .. |
---|
515 | 587 | |
---|
516 | 588 | DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_put, |
---|
517 | 589 | |
---|
518 | | - TP_PROTO(const struct inode *inode, |
---|
| 590 | + TP_PROTO(const struct btrfs_inode *inode, |
---|
519 | 591 | const struct btrfs_ordered_extent *ordered), |
---|
520 | 592 | |
---|
521 | 593 | TP_ARGS(inode, ordered) |
---|
.. | .. |
---|
538 | 610 | __field( char, for_kupdate ) |
---|
539 | 611 | __field( char, for_reclaim ) |
---|
540 | 612 | __field( char, range_cyclic ) |
---|
541 | | - __field( pgoff_t, writeback_index ) |
---|
| 613 | + __field( unsigned long, writeback_index ) |
---|
542 | 614 | __field( u64, root_objectid ) |
---|
543 | 615 | ), |
---|
544 | 616 | |
---|
.. | .. |
---|
567 | 639 | __entry->range_start, __entry->range_end, |
---|
568 | 640 | __entry->for_kupdate, |
---|
569 | 641 | __entry->for_reclaim, __entry->range_cyclic, |
---|
570 | | - (unsigned long)__entry->writeback_index) |
---|
| 642 | + __entry->writeback_index) |
---|
571 | 643 | ); |
---|
572 | 644 | |
---|
573 | 645 | DEFINE_EVENT(btrfs__writepage, __extent_writepage, |
---|
.. | .. |
---|
586 | 658 | |
---|
587 | 659 | TP_STRUCT__entry_btrfs( |
---|
588 | 660 | __field( u64, ino ) |
---|
589 | | - __field( pgoff_t, index ) |
---|
| 661 | + __field( unsigned long, index ) |
---|
590 | 662 | __field( u64, start ) |
---|
591 | 663 | __field( u64, end ) |
---|
592 | 664 | __field( int, uptodate ) |
---|
.. | .. |
---|
606 | 678 | TP_printk_btrfs("root=%llu(%s) ino=%llu page_index=%lu start=%llu " |
---|
607 | 679 | "end=%llu uptodate=%d", |
---|
608 | 680 | show_root_type(__entry->root_objectid), |
---|
609 | | - __entry->ino, (unsigned long)__entry->index, |
---|
| 681 | + __entry->ino, __entry->index, |
---|
610 | 682 | __entry->start, |
---|
611 | 683 | __entry->end, __entry->uptodate) |
---|
612 | 684 | ); |
---|
.. | .. |
---|
663 | 735 | TRACE_EVENT(btrfs_add_block_group, |
---|
664 | 736 | |
---|
665 | 737 | TP_PROTO(const struct btrfs_fs_info *fs_info, |
---|
666 | | - const struct btrfs_block_group_cache *block_group, int create), |
---|
| 738 | + const struct btrfs_block_group *block_group, int create), |
---|
667 | 739 | |
---|
668 | 740 | TP_ARGS(fs_info, block_group, create), |
---|
669 | 741 | |
---|
.. | .. |
---|
677 | 749 | ), |
---|
678 | 750 | |
---|
679 | 751 | TP_fast_assign_btrfs(fs_info, |
---|
680 | | - __entry->offset = block_group->key.objectid; |
---|
681 | | - __entry->size = block_group->key.offset; |
---|
| 752 | + __entry->offset = block_group->start; |
---|
| 753 | + __entry->size = block_group->length; |
---|
682 | 754 | __entry->flags = block_group->flags; |
---|
683 | | - __entry->bytes_used = |
---|
684 | | - btrfs_block_group_used(&block_group->item); |
---|
| 755 | + __entry->bytes_used = block_group->used; |
---|
685 | 756 | __entry->bytes_super = block_group->bytes_super; |
---|
686 | 757 | __entry->create = create; |
---|
687 | 758 | ), |
---|
.. | .. |
---|
982 | 1053 | |
---|
983 | 1054 | TRACE_EVENT(btrfs_space_reservation, |
---|
984 | 1055 | |
---|
985 | | - TP_PROTO(const struct btrfs_fs_info *fs_info, char *type, u64 val, |
---|
| 1056 | + TP_PROTO(const struct btrfs_fs_info *fs_info, const char *type, u64 val, |
---|
986 | 1057 | u64 bytes, int reserve), |
---|
987 | 1058 | |
---|
988 | 1059 | TP_ARGS(fs_info, type, val, bytes, reserve), |
---|
.. | .. |
---|
1006 | 1077 | __entry->bytes) |
---|
1007 | 1078 | ); |
---|
1008 | 1079 | |
---|
1009 | | -#define show_flush_action(action) \ |
---|
1010 | | - __print_symbolic(action, \ |
---|
1011 | | - { BTRFS_RESERVE_NO_FLUSH, "BTRFS_RESERVE_NO_FLUSH"}, \ |
---|
1012 | | - { BTRFS_RESERVE_FLUSH_LIMIT, "BTRFS_RESERVE_FLUSH_LIMIT"}, \ |
---|
1013 | | - { BTRFS_RESERVE_FLUSH_ALL, "BTRFS_RESERVE_FLUSH_ALL"}) |
---|
1014 | | - |
---|
1015 | 1080 | TRACE_EVENT(btrfs_trigger_flush, |
---|
1016 | 1081 | |
---|
1017 | 1082 | TP_PROTO(const struct btrfs_fs_info *fs_info, u64 flags, u64 bytes, |
---|
1018 | | - int flush, char *reason), |
---|
| 1083 | + int flush, const char *reason), |
---|
1019 | 1084 | |
---|
1020 | 1085 | TP_ARGS(fs_info, flags, bytes, flush, reason), |
---|
1021 | 1086 | |
---|
.. | .. |
---|
1035 | 1100 | |
---|
1036 | 1101 | TP_printk_btrfs("%s: flush=%d(%s) flags=%llu(%s) bytes=%llu", |
---|
1037 | 1102 | __get_str(reason), __entry->flush, |
---|
1038 | | - show_flush_action(__entry->flush), |
---|
| 1103 | + __print_symbolic(__entry->flush, FLUSH_ACTIONS), |
---|
1039 | 1104 | __entry->flags, |
---|
1040 | 1105 | __print_flags((unsigned long)__entry->flags, "|", |
---|
1041 | 1106 | BTRFS_GROUP_FLAGS), |
---|
1042 | 1107 | __entry->bytes) |
---|
1043 | 1108 | ); |
---|
1044 | 1109 | |
---|
1045 | | -#define show_flush_state(state) \ |
---|
1046 | | - __print_symbolic(state, \ |
---|
1047 | | - { FLUSH_DELAYED_ITEMS_NR, "FLUSH_DELAYED_ITEMS_NR"}, \ |
---|
1048 | | - { FLUSH_DELAYED_ITEMS, "FLUSH_DELAYED_ITEMS"}, \ |
---|
1049 | | - { FLUSH_DELALLOC, "FLUSH_DELALLOC"}, \ |
---|
1050 | | - { FLUSH_DELALLOC_WAIT, "FLUSH_DELALLOC_WAIT"}, \ |
---|
1051 | | - { ALLOC_CHUNK, "ALLOC_CHUNK"}, \ |
---|
1052 | | - { COMMIT_TRANS, "COMMIT_TRANS"}) |
---|
1053 | 1110 | |
---|
1054 | 1111 | TRACE_EVENT(btrfs_flush_space, |
---|
1055 | 1112 | |
---|
.. | .. |
---|
1074 | 1131 | |
---|
1075 | 1132 | TP_printk_btrfs("state=%d(%s) flags=%llu(%s) num_bytes=%llu ret=%d", |
---|
1076 | 1133 | __entry->state, |
---|
1077 | | - show_flush_state(__entry->state), |
---|
| 1134 | + __print_symbolic(__entry->state, FLUSH_STATES), |
---|
1078 | 1135 | __entry->flags, |
---|
1079 | 1136 | __print_flags((unsigned long)__entry->flags, "|", |
---|
1080 | 1137 | BTRFS_GROUP_FLAGS), |
---|
.. | .. |
---|
1119 | 1176 | |
---|
1120 | 1177 | TRACE_EVENT(find_free_extent, |
---|
1121 | 1178 | |
---|
1122 | | - TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, |
---|
| 1179 | + TP_PROTO(const struct btrfs_root *root, u64 num_bytes, |
---|
1123 | 1180 | u64 empty_size, u64 data), |
---|
1124 | 1181 | |
---|
1125 | | - TP_ARGS(fs_info, num_bytes, empty_size, data), |
---|
| 1182 | + TP_ARGS(root, num_bytes, empty_size, data), |
---|
1126 | 1183 | |
---|
1127 | 1184 | TP_STRUCT__entry_btrfs( |
---|
| 1185 | + __field( u64, root_objectid ) |
---|
1128 | 1186 | __field( u64, num_bytes ) |
---|
1129 | 1187 | __field( u64, empty_size ) |
---|
1130 | 1188 | __field( u64, data ) |
---|
1131 | 1189 | ), |
---|
1132 | 1190 | |
---|
1133 | | - TP_fast_assign_btrfs(fs_info, |
---|
| 1191 | + TP_fast_assign_btrfs(root->fs_info, |
---|
| 1192 | + __entry->root_objectid = root->root_key.objectid; |
---|
1134 | 1193 | __entry->num_bytes = num_bytes; |
---|
1135 | 1194 | __entry->empty_size = empty_size; |
---|
1136 | 1195 | __entry->data = data; |
---|
1137 | 1196 | ), |
---|
1138 | 1197 | |
---|
1139 | 1198 | TP_printk_btrfs("root=%llu(%s) len=%llu empty_size=%llu flags=%llu(%s)", |
---|
1140 | | - show_root_type(BTRFS_EXTENT_TREE_OBJECTID), |
---|
| 1199 | + show_root_type(__entry->root_objectid), |
---|
1141 | 1200 | __entry->num_bytes, __entry->empty_size, __entry->data, |
---|
1142 | 1201 | __print_flags((unsigned long)__entry->data, "|", |
---|
1143 | 1202 | BTRFS_GROUP_FLAGS)) |
---|
.. | .. |
---|
1145 | 1204 | |
---|
1146 | 1205 | DECLARE_EVENT_CLASS(btrfs__reserve_extent, |
---|
1147 | 1206 | |
---|
1148 | | - TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start, |
---|
| 1207 | + TP_PROTO(const struct btrfs_block_group *block_group, u64 start, |
---|
1149 | 1208 | u64 len), |
---|
1150 | 1209 | |
---|
1151 | 1210 | TP_ARGS(block_group, start, len), |
---|
.. | .. |
---|
1158 | 1217 | ), |
---|
1159 | 1218 | |
---|
1160 | 1219 | TP_fast_assign_btrfs(block_group->fs_info, |
---|
1161 | | - __entry->bg_objectid = block_group->key.objectid; |
---|
| 1220 | + __entry->bg_objectid = block_group->start; |
---|
1162 | 1221 | __entry->flags = block_group->flags; |
---|
1163 | 1222 | __entry->start = start; |
---|
1164 | 1223 | __entry->len = len; |
---|
.. | .. |
---|
1175 | 1234 | |
---|
1176 | 1235 | DEFINE_EVENT(btrfs__reserve_extent, btrfs_reserve_extent, |
---|
1177 | 1236 | |
---|
1178 | | - TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start, |
---|
| 1237 | + TP_PROTO(const struct btrfs_block_group *block_group, u64 start, |
---|
1179 | 1238 | u64 len), |
---|
1180 | 1239 | |
---|
1181 | 1240 | TP_ARGS(block_group, start, len) |
---|
.. | .. |
---|
1183 | 1242 | |
---|
1184 | 1243 | DEFINE_EVENT(btrfs__reserve_extent, btrfs_reserve_extent_cluster, |
---|
1185 | 1244 | |
---|
1186 | | - TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start, |
---|
| 1245 | + TP_PROTO(const struct btrfs_block_group *block_group, u64 start, |
---|
1187 | 1246 | u64 len), |
---|
1188 | 1247 | |
---|
1189 | 1248 | TP_ARGS(block_group, start, len) |
---|
.. | .. |
---|
1191 | 1250 | |
---|
1192 | 1251 | TRACE_EVENT(btrfs_find_cluster, |
---|
1193 | 1252 | |
---|
1194 | | - TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start, |
---|
| 1253 | + TP_PROTO(const struct btrfs_block_group *block_group, u64 start, |
---|
1195 | 1254 | u64 bytes, u64 empty_size, u64 min_bytes), |
---|
1196 | 1255 | |
---|
1197 | 1256 | TP_ARGS(block_group, start, bytes, empty_size, min_bytes), |
---|
.. | .. |
---|
1206 | 1265 | ), |
---|
1207 | 1266 | |
---|
1208 | 1267 | TP_fast_assign_btrfs(block_group->fs_info, |
---|
1209 | | - __entry->bg_objectid = block_group->key.objectid; |
---|
| 1268 | + __entry->bg_objectid = block_group->start; |
---|
1210 | 1269 | __entry->flags = block_group->flags; |
---|
1211 | 1270 | __entry->start = start; |
---|
1212 | 1271 | __entry->bytes = bytes; |
---|
.. | .. |
---|
1224 | 1283 | |
---|
1225 | 1284 | TRACE_EVENT(btrfs_failed_cluster_setup, |
---|
1226 | 1285 | |
---|
1227 | | - TP_PROTO(const struct btrfs_block_group_cache *block_group), |
---|
| 1286 | + TP_PROTO(const struct btrfs_block_group *block_group), |
---|
1228 | 1287 | |
---|
1229 | 1288 | TP_ARGS(block_group), |
---|
1230 | 1289 | |
---|
.. | .. |
---|
1233 | 1292 | ), |
---|
1234 | 1293 | |
---|
1235 | 1294 | TP_fast_assign_btrfs(block_group->fs_info, |
---|
1236 | | - __entry->bg_objectid = block_group->key.objectid; |
---|
| 1295 | + __entry->bg_objectid = block_group->start; |
---|
1237 | 1296 | ), |
---|
1238 | 1297 | |
---|
1239 | 1298 | TP_printk_btrfs("block_group=%llu", __entry->bg_objectid) |
---|
.. | .. |
---|
1241 | 1300 | |
---|
1242 | 1301 | TRACE_EVENT(btrfs_setup_cluster, |
---|
1243 | 1302 | |
---|
1244 | | - TP_PROTO(const struct btrfs_block_group_cache *block_group, |
---|
| 1303 | + TP_PROTO(const struct btrfs_block_group *block_group, |
---|
1245 | 1304 | const struct btrfs_free_cluster *cluster, |
---|
1246 | 1305 | u64 size, int bitmap), |
---|
1247 | 1306 | |
---|
.. | .. |
---|
1257 | 1316 | ), |
---|
1258 | 1317 | |
---|
1259 | 1318 | TP_fast_assign_btrfs(block_group->fs_info, |
---|
1260 | | - __entry->bg_objectid = block_group->key.objectid; |
---|
| 1319 | + __entry->bg_objectid = block_group->start; |
---|
1261 | 1320 | __entry->flags = block_group->flags; |
---|
1262 | 1321 | __entry->start = cluster->window_start; |
---|
1263 | 1322 | __entry->max_size = cluster->max_size; |
---|
.. | .. |
---|
1285 | 1344 | TP_STRUCT__entry( |
---|
1286 | 1345 | __field(const struct extent_state *, state) |
---|
1287 | 1346 | __field(gfp_t, mask) |
---|
1288 | | - __field(unsigned long, ip) |
---|
| 1347 | + __field(const void*, ip) |
---|
1289 | 1348 | ), |
---|
1290 | 1349 | |
---|
1291 | 1350 | TP_fast_assign( |
---|
1292 | 1351 | __entry->state = state, |
---|
1293 | 1352 | __entry->mask = mask, |
---|
1294 | | - __entry->ip = IP |
---|
| 1353 | + __entry->ip = (const void *)IP |
---|
1295 | 1354 | ), |
---|
1296 | 1355 | |
---|
1297 | 1356 | TP_printk("state=%p mask=%s caller=%pS", __entry->state, |
---|
1298 | | - show_gfp_flags(__entry->mask), (const void *)__entry->ip) |
---|
| 1357 | + show_gfp_flags(__entry->mask), __entry->ip) |
---|
1299 | 1358 | ); |
---|
1300 | 1359 | |
---|
1301 | 1360 | TRACE_EVENT(free_extent_state, |
---|
.. | .. |
---|
1306 | 1365 | |
---|
1307 | 1366 | TP_STRUCT__entry( |
---|
1308 | 1367 | __field(const struct extent_state *, state) |
---|
1309 | | - __field(unsigned long, ip) |
---|
| 1368 | + __field(const void*, ip) |
---|
1310 | 1369 | ), |
---|
1311 | 1370 | |
---|
1312 | 1371 | TP_fast_assign( |
---|
1313 | 1372 | __entry->state = state, |
---|
1314 | | - __entry->ip = IP |
---|
| 1373 | + __entry->ip = (const void *)IP |
---|
1315 | 1374 | ), |
---|
1316 | 1375 | |
---|
1317 | | - TP_printk("state=%p caller=%pS", __entry->state, |
---|
1318 | | - (const void *)__entry->ip) |
---|
| 1376 | + TP_printk("state=%p caller=%pS", __entry->state, __entry->ip) |
---|
1319 | 1377 | ); |
---|
1320 | 1378 | |
---|
1321 | 1379 | DECLARE_EVENT_CLASS(btrfs__work, |
---|
.. | .. |
---|
1342 | 1400 | __entry->normal_work = &work->normal_work; |
---|
1343 | 1401 | ), |
---|
1344 | 1402 | |
---|
1345 | | - TP_printk_btrfs("work=%p (normal_work=%p) wq=%p func=%pf ordered_func=%p " |
---|
| 1403 | + TP_printk_btrfs("work=%p (normal_work=%p) wq=%p func=%ps ordered_func=%p " |
---|
1346 | 1404 | "ordered_free=%p", |
---|
1347 | 1405 | __entry->work, __entry->normal_work, __entry->wq, |
---|
1348 | 1406 | __entry->func, __entry->ordered_func, __entry->ordered_free) |
---|
1349 | 1407 | ); |
---|
1350 | 1408 | |
---|
1351 | 1409 | /* |
---|
1352 | | - * For situiations when the work is freed, we pass fs_info and a tag that that |
---|
1353 | | - * matches address of the work structure so it can be paired with the |
---|
1354 | | - * scheduling event. |
---|
| 1410 | + * For situations when the work is freed, we pass fs_info and a tag that matches |
---|
| 1411 | + * the address of the work structure so it can be paired with the scheduling |
---|
| 1412 | + * event. DO NOT add anything here that dereferences wtag. |
---|
1355 | 1413 | */ |
---|
1356 | 1414 | DECLARE_EVENT_CLASS(btrfs__work__done, |
---|
1357 | 1415 | |
---|
.. | .. |
---|
1477 | 1535 | ), |
---|
1478 | 1536 | |
---|
1479 | 1537 | TP_fast_assign_btrfs(btrfs_sb(inode->i_sb), |
---|
1480 | | - __entry->rootid = BTRFS_I(inode)->root->objectid; |
---|
| 1538 | + __entry->rootid = |
---|
| 1539 | + BTRFS_I(inode)->root->root_key.objectid; |
---|
1481 | 1540 | __entry->ino = btrfs_ino(BTRFS_I(inode)); |
---|
1482 | 1541 | __entry->start = start; |
---|
1483 | 1542 | __entry->len = len; |
---|
.. | .. |
---|
1509 | 1568 | TP_ARGS(inode, start, len, reserved, op) |
---|
1510 | 1569 | ); |
---|
1511 | 1570 | |
---|
1512 | | -DECLARE_EVENT_CLASS(btrfs__qgroup_delayed_ref, |
---|
1513 | | - |
---|
1514 | | - TP_PROTO(const struct btrfs_fs_info *fs_info, |
---|
1515 | | - u64 ref_root, u64 reserved), |
---|
1516 | | - |
---|
1517 | | - TP_ARGS(fs_info, ref_root, reserved), |
---|
1518 | | - |
---|
1519 | | - TP_STRUCT__entry_btrfs( |
---|
1520 | | - __field( u64, ref_root ) |
---|
1521 | | - __field( u64, reserved ) |
---|
1522 | | - ), |
---|
1523 | | - |
---|
1524 | | - TP_fast_assign_btrfs(fs_info, |
---|
1525 | | - __entry->ref_root = ref_root; |
---|
1526 | | - __entry->reserved = reserved; |
---|
1527 | | - ), |
---|
1528 | | - |
---|
1529 | | - TP_printk_btrfs("root=%llu reserved=%llu op=free", |
---|
1530 | | - __entry->ref_root, __entry->reserved) |
---|
1531 | | -); |
---|
1532 | | - |
---|
1533 | | -DEFINE_EVENT(btrfs__qgroup_delayed_ref, btrfs_qgroup_free_delayed_ref, |
---|
1534 | | - |
---|
1535 | | - TP_PROTO(const struct btrfs_fs_info *fs_info, |
---|
1536 | | - u64 ref_root, u64 reserved), |
---|
1537 | | - |
---|
1538 | | - TP_ARGS(fs_info, ref_root, reserved) |
---|
1539 | | -); |
---|
1540 | | - |
---|
1541 | 1571 | DECLARE_EVENT_CLASS(btrfs_qgroup_extent, |
---|
1542 | 1572 | TP_PROTO(const struct btrfs_fs_info *fs_info, |
---|
1543 | 1573 | const struct btrfs_qgroup_extent_record *rec), |
---|
.. | .. |
---|
1555 | 1585 | ), |
---|
1556 | 1586 | |
---|
1557 | 1587 | TP_printk_btrfs("bytenr=%llu num_bytes=%llu", |
---|
1558 | | - (unsigned long long)__entry->bytenr, |
---|
1559 | | - (unsigned long long)__entry->num_bytes) |
---|
| 1588 | + __entry->bytenr, __entry->num_bytes) |
---|
1560 | 1589 | ); |
---|
1561 | 1590 | |
---|
1562 | 1591 | DEFINE_EVENT(btrfs_qgroup_extent, btrfs_qgroup_account_extents, |
---|
.. | .. |
---|
1573 | 1602 | const struct btrfs_qgroup_extent_record *rec), |
---|
1574 | 1603 | |
---|
1575 | 1604 | TP_ARGS(fs_info, rec) |
---|
| 1605 | +); |
---|
| 1606 | + |
---|
| 1607 | +TRACE_EVENT(qgroup_num_dirty_extents, |
---|
| 1608 | + |
---|
| 1609 | + TP_PROTO(const struct btrfs_fs_info *fs_info, u64 transid, |
---|
| 1610 | + u64 num_dirty_extents), |
---|
| 1611 | + |
---|
| 1612 | + TP_ARGS(fs_info, transid, num_dirty_extents), |
---|
| 1613 | + |
---|
| 1614 | + TP_STRUCT__entry_btrfs( |
---|
| 1615 | + __field( u64, transid ) |
---|
| 1616 | + __field( u64, num_dirty_extents ) |
---|
| 1617 | + ), |
---|
| 1618 | + |
---|
| 1619 | + TP_fast_assign_btrfs(fs_info, |
---|
| 1620 | + __entry->transid = transid; |
---|
| 1621 | + __entry->num_dirty_extents = num_dirty_extents; |
---|
| 1622 | + ), |
---|
| 1623 | + |
---|
| 1624 | + TP_printk_btrfs("transid=%llu num_dirty_extents=%llu", |
---|
| 1625 | + __entry->transid, __entry->num_dirty_extents) |
---|
1576 | 1626 | ); |
---|
1577 | 1627 | |
---|
1578 | 1628 | TRACE_EVENT(btrfs_qgroup_account_extent, |
---|
.. | .. |
---|
1611 | 1661 | TRACE_EVENT(qgroup_update_counters, |
---|
1612 | 1662 | |
---|
1613 | 1663 | TP_PROTO(const struct btrfs_fs_info *fs_info, |
---|
1614 | | - struct btrfs_qgroup *qgroup, |
---|
| 1664 | + const struct btrfs_qgroup *qgroup, |
---|
1615 | 1665 | u64 cur_old_count, u64 cur_new_count), |
---|
1616 | 1666 | |
---|
1617 | 1667 | TP_ARGS(fs_info, qgroup, cur_old_count, cur_new_count), |
---|
.. | .. |
---|
1659 | 1709 | ), |
---|
1660 | 1710 | |
---|
1661 | 1711 | TP_printk_btrfs("qgid=%llu type=%s cur_reserved=%llu diff=%lld", |
---|
1662 | | - __entry->qgid, show_qgroup_rsv_type(__entry->type), |
---|
| 1712 | + __entry->qgid, __print_symbolic(__entry->type, QGROUP_RSV_TYPES), |
---|
1663 | 1713 | __entry->cur_reserved, __entry->diff) |
---|
1664 | 1714 | ); |
---|
1665 | 1715 | |
---|
.. | .. |
---|
1676 | 1726 | ), |
---|
1677 | 1727 | |
---|
1678 | 1728 | TP_fast_assign_btrfs(root->fs_info, |
---|
1679 | | - __entry->refroot = root->objectid; |
---|
| 1729 | + __entry->refroot = root->root_key.objectid; |
---|
1680 | 1730 | __entry->diff = diff; |
---|
1681 | 1731 | __entry->type = type; |
---|
1682 | 1732 | ), |
---|
1683 | 1733 | |
---|
1684 | 1734 | TP_printk_btrfs("refroot=%llu(%s) type=%s diff=%lld", |
---|
1685 | 1735 | show_root_type(__entry->refroot), |
---|
1686 | | - show_qgroup_rsv_type(__entry->type), __entry->diff) |
---|
| 1736 | + __print_symbolic(__entry->type, QGROUP_RSV_TYPES), __entry->diff) |
---|
1687 | 1737 | ); |
---|
1688 | 1738 | |
---|
1689 | 1739 | TRACE_EVENT(qgroup_meta_convert, |
---|
.. | .. |
---|
1698 | 1748 | ), |
---|
1699 | 1749 | |
---|
1700 | 1750 | TP_fast_assign_btrfs(root->fs_info, |
---|
1701 | | - __entry->refroot = root->objectid; |
---|
| 1751 | + __entry->refroot = root->root_key.objectid; |
---|
1702 | 1752 | __entry->diff = diff; |
---|
1703 | 1753 | ), |
---|
1704 | 1754 | |
---|
1705 | 1755 | TP_printk_btrfs("refroot=%llu(%s) type=%s->%s diff=%lld", |
---|
1706 | 1756 | show_root_type(__entry->refroot), |
---|
1707 | | - show_qgroup_rsv_type(BTRFS_QGROUP_RSV_META_PREALLOC), |
---|
1708 | | - show_qgroup_rsv_type(BTRFS_QGROUP_RSV_META_PERTRANS), |
---|
| 1757 | + __print_symbolic(BTRFS_QGROUP_RSV_META_PREALLOC, QGROUP_RSV_TYPES), |
---|
| 1758 | + __print_symbolic(BTRFS_QGROUP_RSV_META_PERTRANS, QGROUP_RSV_TYPES), |
---|
1709 | 1759 | __entry->diff) |
---|
1710 | 1760 | ); |
---|
1711 | 1761 | |
---|
.. | .. |
---|
1722 | 1772 | ), |
---|
1723 | 1773 | |
---|
1724 | 1774 | TP_fast_assign_btrfs(root->fs_info, |
---|
1725 | | - __entry->refroot = root->objectid; |
---|
| 1775 | + __entry->refroot = root->root_key.objectid; |
---|
1726 | 1776 | spin_lock(&root->qgroup_meta_rsv_lock); |
---|
1727 | 1777 | __entry->diff = -(s64)root->qgroup_meta_rsv_pertrans; |
---|
1728 | 1778 | spin_unlock(&root->qgroup_meta_rsv_lock); |
---|
.. | .. |
---|
1731 | 1781 | |
---|
1732 | 1782 | TP_printk_btrfs("refroot=%llu(%s) type=%s diff=%lld", |
---|
1733 | 1783 | show_root_type(__entry->refroot), |
---|
1734 | | - show_qgroup_rsv_type(__entry->type), __entry->diff) |
---|
| 1784 | + __print_symbolic(__entry->type, QGROUP_RSV_TYPES), __entry->diff) |
---|
1735 | 1785 | ); |
---|
1736 | 1786 | |
---|
1737 | 1787 | DECLARE_EVENT_CLASS(btrfs__prelim_ref, |
---|
.. | .. |
---|
1792 | 1842 | ); |
---|
1793 | 1843 | |
---|
1794 | 1844 | TRACE_EVENT(btrfs_inode_mod_outstanding_extents, |
---|
1795 | | - TP_PROTO(struct btrfs_root *root, u64 ino, int mod), |
---|
| 1845 | + TP_PROTO(const struct btrfs_root *root, u64 ino, int mod), |
---|
1796 | 1846 | |
---|
1797 | 1847 | TP_ARGS(root, ino, mod), |
---|
1798 | 1848 | |
---|
.. | .. |
---|
1803 | 1853 | ), |
---|
1804 | 1854 | |
---|
1805 | 1855 | TP_fast_assign_btrfs(root->fs_info, |
---|
1806 | | - __entry->root_objectid = root->objectid; |
---|
| 1856 | + __entry->root_objectid = root->root_key.objectid; |
---|
1807 | 1857 | __entry->ino = ino; |
---|
1808 | 1858 | __entry->mod = mod; |
---|
1809 | 1859 | ), |
---|
.. | .. |
---|
1814 | 1864 | ); |
---|
1815 | 1865 | |
---|
1816 | 1866 | DECLARE_EVENT_CLASS(btrfs__block_group, |
---|
1817 | | - TP_PROTO(const struct btrfs_block_group_cache *bg_cache), |
---|
| 1867 | + TP_PROTO(const struct btrfs_block_group *bg_cache), |
---|
1818 | 1868 | |
---|
1819 | 1869 | TP_ARGS(bg_cache), |
---|
1820 | 1870 | |
---|
.. | .. |
---|
1826 | 1876 | ), |
---|
1827 | 1877 | |
---|
1828 | 1878 | TP_fast_assign_btrfs(bg_cache->fs_info, |
---|
1829 | | - __entry->bytenr = bg_cache->key.objectid, |
---|
1830 | | - __entry->len = bg_cache->key.offset, |
---|
1831 | | - __entry->used = btrfs_block_group_used(&bg_cache->item); |
---|
| 1879 | + __entry->bytenr = bg_cache->start, |
---|
| 1880 | + __entry->len = bg_cache->length, |
---|
| 1881 | + __entry->used = bg_cache->used; |
---|
1832 | 1882 | __entry->flags = bg_cache->flags; |
---|
1833 | 1883 | ), |
---|
1834 | 1884 | |
---|
.. | .. |
---|
1838 | 1888 | ); |
---|
1839 | 1889 | |
---|
1840 | 1890 | DEFINE_EVENT(btrfs__block_group, btrfs_remove_block_group, |
---|
1841 | | - TP_PROTO(const struct btrfs_block_group_cache *bg_cache), |
---|
| 1891 | + TP_PROTO(const struct btrfs_block_group *bg_cache), |
---|
1842 | 1892 | |
---|
1843 | 1893 | TP_ARGS(bg_cache) |
---|
1844 | 1894 | ); |
---|
1845 | 1895 | |
---|
1846 | 1896 | DEFINE_EVENT(btrfs__block_group, btrfs_add_unused_block_group, |
---|
1847 | | - TP_PROTO(const struct btrfs_block_group_cache *bg_cache), |
---|
| 1897 | + TP_PROTO(const struct btrfs_block_group *bg_cache), |
---|
1848 | 1898 | |
---|
1849 | 1899 | TP_ARGS(bg_cache) |
---|
1850 | 1900 | ); |
---|
1851 | 1901 | |
---|
1852 | 1902 | DEFINE_EVENT(btrfs__block_group, btrfs_skip_unused_block_group, |
---|
1853 | | - TP_PROTO(const struct btrfs_block_group_cache *bg_cache), |
---|
| 1903 | + TP_PROTO(const struct btrfs_block_group *bg_cache), |
---|
1854 | 1904 | |
---|
1855 | 1905 | TP_ARGS(bg_cache) |
---|
1856 | 1906 | ); |
---|
1857 | 1907 | |
---|
| 1908 | +TRACE_EVENT(btrfs_set_extent_bit, |
---|
| 1909 | + TP_PROTO(const struct extent_io_tree *tree, |
---|
| 1910 | + u64 start, u64 len, unsigned set_bits), |
---|
| 1911 | + |
---|
| 1912 | + TP_ARGS(tree, start, len, set_bits), |
---|
| 1913 | + |
---|
| 1914 | + TP_STRUCT__entry_btrfs( |
---|
| 1915 | + __field( unsigned, owner ) |
---|
| 1916 | + __field( u64, ino ) |
---|
| 1917 | + __field( u64, rootid ) |
---|
| 1918 | + __field( u64, start ) |
---|
| 1919 | + __field( u64, len ) |
---|
| 1920 | + __field( unsigned, set_bits) |
---|
| 1921 | + ), |
---|
| 1922 | + |
---|
| 1923 | + TP_fast_assign_btrfs(tree->fs_info, |
---|
| 1924 | + __entry->owner = tree->owner; |
---|
| 1925 | + if (tree->private_data) { |
---|
| 1926 | + const struct inode *inode = tree->private_data; |
---|
| 1927 | + |
---|
| 1928 | + __entry->ino = btrfs_ino(BTRFS_I(inode)); |
---|
| 1929 | + __entry->rootid = |
---|
| 1930 | + BTRFS_I(inode)->root->root_key.objectid; |
---|
| 1931 | + } else { |
---|
| 1932 | + __entry->ino = 0; |
---|
| 1933 | + __entry->rootid = 0; |
---|
| 1934 | + } |
---|
| 1935 | + __entry->start = start; |
---|
| 1936 | + __entry->len = len; |
---|
| 1937 | + __entry->set_bits = set_bits; |
---|
| 1938 | + ), |
---|
| 1939 | + |
---|
| 1940 | + TP_printk_btrfs( |
---|
| 1941 | + "io_tree=%s ino=%llu root=%llu start=%llu len=%llu set_bits=%s", |
---|
| 1942 | + __print_symbolic(__entry->owner, IO_TREE_OWNER), __entry->ino, |
---|
| 1943 | + __entry->rootid, __entry->start, __entry->len, |
---|
| 1944 | + __print_flags(__entry->set_bits, "|", EXTENT_FLAGS)) |
---|
| 1945 | +); |
---|
| 1946 | + |
---|
| 1947 | +TRACE_EVENT(btrfs_clear_extent_bit, |
---|
| 1948 | + TP_PROTO(const struct extent_io_tree *tree, |
---|
| 1949 | + u64 start, u64 len, unsigned clear_bits), |
---|
| 1950 | + |
---|
| 1951 | + TP_ARGS(tree, start, len, clear_bits), |
---|
| 1952 | + |
---|
| 1953 | + TP_STRUCT__entry_btrfs( |
---|
| 1954 | + __field( unsigned, owner ) |
---|
| 1955 | + __field( u64, ino ) |
---|
| 1956 | + __field( u64, rootid ) |
---|
| 1957 | + __field( u64, start ) |
---|
| 1958 | + __field( u64, len ) |
---|
| 1959 | + __field( unsigned, clear_bits) |
---|
| 1960 | + ), |
---|
| 1961 | + |
---|
| 1962 | + TP_fast_assign_btrfs(tree->fs_info, |
---|
| 1963 | + __entry->owner = tree->owner; |
---|
| 1964 | + if (tree->private_data) { |
---|
| 1965 | + const struct inode *inode = tree->private_data; |
---|
| 1966 | + |
---|
| 1967 | + __entry->ino = btrfs_ino(BTRFS_I(inode)); |
---|
| 1968 | + __entry->rootid = |
---|
| 1969 | + BTRFS_I(inode)->root->root_key.objectid; |
---|
| 1970 | + } else { |
---|
| 1971 | + __entry->ino = 0; |
---|
| 1972 | + __entry->rootid = 0; |
---|
| 1973 | + } |
---|
| 1974 | + __entry->start = start; |
---|
| 1975 | + __entry->len = len; |
---|
| 1976 | + __entry->clear_bits = clear_bits; |
---|
| 1977 | + ), |
---|
| 1978 | + |
---|
| 1979 | + TP_printk_btrfs( |
---|
| 1980 | + "io_tree=%s ino=%llu root=%llu start=%llu len=%llu clear_bits=%s", |
---|
| 1981 | + __print_symbolic(__entry->owner, IO_TREE_OWNER), __entry->ino, |
---|
| 1982 | + __entry->rootid, __entry->start, __entry->len, |
---|
| 1983 | + __print_flags(__entry->clear_bits, "|", EXTENT_FLAGS)) |
---|
| 1984 | +); |
---|
| 1985 | + |
---|
| 1986 | +TRACE_EVENT(btrfs_convert_extent_bit, |
---|
| 1987 | + TP_PROTO(const struct extent_io_tree *tree, |
---|
| 1988 | + u64 start, u64 len, unsigned set_bits, unsigned clear_bits), |
---|
| 1989 | + |
---|
| 1990 | + TP_ARGS(tree, start, len, set_bits, clear_bits), |
---|
| 1991 | + |
---|
| 1992 | + TP_STRUCT__entry_btrfs( |
---|
| 1993 | + __field( unsigned, owner ) |
---|
| 1994 | + __field( u64, ino ) |
---|
| 1995 | + __field( u64, rootid ) |
---|
| 1996 | + __field( u64, start ) |
---|
| 1997 | + __field( u64, len ) |
---|
| 1998 | + __field( unsigned, set_bits) |
---|
| 1999 | + __field( unsigned, clear_bits) |
---|
| 2000 | + ), |
---|
| 2001 | + |
---|
| 2002 | + TP_fast_assign_btrfs(tree->fs_info, |
---|
| 2003 | + __entry->owner = tree->owner; |
---|
| 2004 | + if (tree->private_data) { |
---|
| 2005 | + const struct inode *inode = tree->private_data; |
---|
| 2006 | + |
---|
| 2007 | + __entry->ino = btrfs_ino(BTRFS_I(inode)); |
---|
| 2008 | + __entry->rootid = |
---|
| 2009 | + BTRFS_I(inode)->root->root_key.objectid; |
---|
| 2010 | + } else { |
---|
| 2011 | + __entry->ino = 0; |
---|
| 2012 | + __entry->rootid = 0; |
---|
| 2013 | + } |
---|
| 2014 | + __entry->start = start; |
---|
| 2015 | + __entry->len = len; |
---|
| 2016 | + __entry->set_bits = set_bits; |
---|
| 2017 | + __entry->clear_bits = clear_bits; |
---|
| 2018 | + ), |
---|
| 2019 | + |
---|
| 2020 | + TP_printk_btrfs( |
---|
| 2021 | +"io_tree=%s ino=%llu root=%llu start=%llu len=%llu set_bits=%s clear_bits=%s", |
---|
| 2022 | + __print_symbolic(__entry->owner, IO_TREE_OWNER), __entry->ino, |
---|
| 2023 | + __entry->rootid, __entry->start, __entry->len, |
---|
| 2024 | + __print_flags(__entry->set_bits , "|", EXTENT_FLAGS), |
---|
| 2025 | + __print_flags(__entry->clear_bits, "|", EXTENT_FLAGS)) |
---|
| 2026 | +); |
---|
| 2027 | + |
---|
| 2028 | +DECLARE_EVENT_CLASS(btrfs_sleep_tree_lock, |
---|
| 2029 | + TP_PROTO(const struct extent_buffer *eb, u64 start_ns), |
---|
| 2030 | + |
---|
| 2031 | + TP_ARGS(eb, start_ns), |
---|
| 2032 | + |
---|
| 2033 | + TP_STRUCT__entry_btrfs( |
---|
| 2034 | + __field( u64, block ) |
---|
| 2035 | + __field( u64, generation ) |
---|
| 2036 | + __field( u64, start_ns ) |
---|
| 2037 | + __field( u64, end_ns ) |
---|
| 2038 | + __field( u64, diff_ns ) |
---|
| 2039 | + __field( u64, owner ) |
---|
| 2040 | + __field( int, is_log_tree ) |
---|
| 2041 | + ), |
---|
| 2042 | + |
---|
| 2043 | + TP_fast_assign_btrfs(eb->fs_info, |
---|
| 2044 | + __entry->block = eb->start; |
---|
| 2045 | + __entry->generation = btrfs_header_generation(eb); |
---|
| 2046 | + __entry->start_ns = start_ns; |
---|
| 2047 | + __entry->end_ns = ktime_get_ns(); |
---|
| 2048 | + __entry->diff_ns = __entry->end_ns - start_ns; |
---|
| 2049 | + __entry->owner = btrfs_header_owner(eb); |
---|
| 2050 | + __entry->is_log_tree = (eb->log_index >= 0); |
---|
| 2051 | + ), |
---|
| 2052 | + |
---|
| 2053 | + TP_printk_btrfs( |
---|
| 2054 | +"block=%llu generation=%llu start_ns=%llu end_ns=%llu diff_ns=%llu owner=%llu is_log_tree=%d", |
---|
| 2055 | + __entry->block, __entry->generation, |
---|
| 2056 | + __entry->start_ns, __entry->end_ns, __entry->diff_ns, |
---|
| 2057 | + __entry->owner, __entry->is_log_tree) |
---|
| 2058 | +); |
---|
| 2059 | + |
---|
| 2060 | +DEFINE_EVENT(btrfs_sleep_tree_lock, btrfs_tree_read_lock, |
---|
| 2061 | + TP_PROTO(const struct extent_buffer *eb, u64 start_ns), |
---|
| 2062 | + |
---|
| 2063 | + TP_ARGS(eb, start_ns) |
---|
| 2064 | +); |
---|
| 2065 | + |
---|
| 2066 | +DEFINE_EVENT(btrfs_sleep_tree_lock, btrfs_tree_lock, |
---|
| 2067 | + TP_PROTO(const struct extent_buffer *eb, u64 start_ns), |
---|
| 2068 | + |
---|
| 2069 | + TP_ARGS(eb, start_ns) |
---|
| 2070 | +); |
---|
| 2071 | + |
---|
| 2072 | +DECLARE_EVENT_CLASS(btrfs_locking_events, |
---|
| 2073 | + TP_PROTO(const struct extent_buffer *eb), |
---|
| 2074 | + |
---|
| 2075 | + TP_ARGS(eb), |
---|
| 2076 | + |
---|
| 2077 | + TP_STRUCT__entry_btrfs( |
---|
| 2078 | + __field( u64, block ) |
---|
| 2079 | + __field( u64, generation ) |
---|
| 2080 | + __field( u64, owner ) |
---|
| 2081 | + __field( int, is_log_tree ) |
---|
| 2082 | + ), |
---|
| 2083 | + |
---|
| 2084 | + TP_fast_assign_btrfs(eb->fs_info, |
---|
| 2085 | + __entry->block = eb->start; |
---|
| 2086 | + __entry->generation = btrfs_header_generation(eb); |
---|
| 2087 | + __entry->owner = btrfs_header_owner(eb); |
---|
| 2088 | + __entry->is_log_tree = (eb->log_index >= 0); |
---|
| 2089 | + ), |
---|
| 2090 | + |
---|
| 2091 | + TP_printk_btrfs("block=%llu generation=%llu owner=%llu is_log_tree=%d", |
---|
| 2092 | + __entry->block, __entry->generation, |
---|
| 2093 | + __entry->owner, __entry->is_log_tree) |
---|
| 2094 | +); |
---|
| 2095 | + |
---|
| 2096 | +#define DEFINE_BTRFS_LOCK_EVENT(name) \ |
---|
| 2097 | +DEFINE_EVENT(btrfs_locking_events, name, \ |
---|
| 2098 | + TP_PROTO(const struct extent_buffer *eb), \ |
---|
| 2099 | + \ |
---|
| 2100 | + TP_ARGS(eb) \ |
---|
| 2101 | +) |
---|
| 2102 | + |
---|
| 2103 | +DEFINE_BTRFS_LOCK_EVENT(btrfs_tree_unlock); |
---|
| 2104 | +DEFINE_BTRFS_LOCK_EVENT(btrfs_tree_read_unlock); |
---|
| 2105 | +DEFINE_BTRFS_LOCK_EVENT(btrfs_tree_read_unlock_blocking); |
---|
| 2106 | +DEFINE_BTRFS_LOCK_EVENT(btrfs_set_lock_blocking_read); |
---|
| 2107 | +DEFINE_BTRFS_LOCK_EVENT(btrfs_set_lock_blocking_write); |
---|
| 2108 | +DEFINE_BTRFS_LOCK_EVENT(btrfs_try_tree_read_lock); |
---|
| 2109 | +DEFINE_BTRFS_LOCK_EVENT(btrfs_try_tree_write_lock); |
---|
| 2110 | +DEFINE_BTRFS_LOCK_EVENT(btrfs_tree_read_lock_atomic); |
---|
| 2111 | + |
---|
| 2112 | +DECLARE_EVENT_CLASS(btrfs__space_info_update, |
---|
| 2113 | + |
---|
| 2114 | + TP_PROTO(const struct btrfs_fs_info *fs_info, |
---|
| 2115 | + const struct btrfs_space_info *sinfo, u64 old, s64 diff), |
---|
| 2116 | + |
---|
| 2117 | + TP_ARGS(fs_info, sinfo, old, diff), |
---|
| 2118 | + |
---|
| 2119 | + TP_STRUCT__entry_btrfs( |
---|
| 2120 | + __field( u64, type ) |
---|
| 2121 | + __field( u64, old ) |
---|
| 2122 | + __field( s64, diff ) |
---|
| 2123 | + ), |
---|
| 2124 | + |
---|
| 2125 | + TP_fast_assign_btrfs(fs_info, |
---|
| 2126 | + __entry->type = sinfo->flags; |
---|
| 2127 | + __entry->old = old; |
---|
| 2128 | + __entry->diff = diff; |
---|
| 2129 | + ), |
---|
| 2130 | + TP_printk_btrfs("type=%s old=%llu diff=%lld", |
---|
| 2131 | + __print_flags(__entry->type, "|", BTRFS_GROUP_FLAGS), |
---|
| 2132 | + __entry->old, __entry->diff) |
---|
| 2133 | +); |
---|
| 2134 | + |
---|
| 2135 | +DEFINE_EVENT(btrfs__space_info_update, update_bytes_may_use, |
---|
| 2136 | + |
---|
| 2137 | + TP_PROTO(const struct btrfs_fs_info *fs_info, |
---|
| 2138 | + const struct btrfs_space_info *sinfo, u64 old, s64 diff), |
---|
| 2139 | + |
---|
| 2140 | + TP_ARGS(fs_info, sinfo, old, diff) |
---|
| 2141 | +); |
---|
| 2142 | + |
---|
| 2143 | +DEFINE_EVENT(btrfs__space_info_update, update_bytes_pinned, |
---|
| 2144 | + |
---|
| 2145 | + TP_PROTO(const struct btrfs_fs_info *fs_info, |
---|
| 2146 | + const struct btrfs_space_info *sinfo, u64 old, s64 diff), |
---|
| 2147 | + |
---|
| 2148 | + TP_ARGS(fs_info, sinfo, old, diff) |
---|
| 2149 | +); |
---|
| 2150 | + |
---|
1858 | 2151 | #endif /* _TRACE_BTRFS_H */ |
---|
1859 | 2152 | |
---|
1860 | 2153 | /* This part must be outside protection */ |
---|