aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-17 18:49:54 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-17 18:49:54 -0500
commitf9156c7288e2d11501ded4d7fe6d9a3a41ee4057 (patch)
tree7bd26fc9a111c6af1601ecd2d1b0ab60da32f3f0 /include/trace
parent67175b855bfd6ed95ffeff95532173c07de6432d (diff)
parent96bdc7dc61fb1b1e8e858dafb13abee8482ba064 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (62 commits) Btrfs: use larger system chunks Btrfs: add a delalloc mutex to inodes for delalloc reservations Btrfs: space leak tracepoints Btrfs: protect orphan block rsv with spin_lock Btrfs: add allocator tracepoints Btrfs: don't call btrfs_throttle in file write Btrfs: release space on error in page_mkwrite Btrfs: fix btrfsck error 400 when truncating a compressed Btrfs: do not use btrfs_end_transaction_throttle everywhere Btrfs: add balance progress reporting Btrfs: allow for resuming restriper after it was paused Btrfs: allow for canceling restriper Btrfs: allow for pausing restriper Btrfs: add skip_balance mount option Btrfs: recover balance on mount Btrfs: save balance parameters to disk Btrfs: soft profile changing mode (aka soft convert) Btrfs: implement online profile changing Btrfs: do not reduce profile in do_chunk_alloc() Btrfs: virtual address space subset filter ... Fix up trivial conflict in fs/btrfs/ioctl.c due to the use of the new mnt_drop_write_file() helper.
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/btrfs.h203
1 files changed, 203 insertions, 0 deletions
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h
index b31702ac15be..84f3001a568d 100644
--- a/include/trace/events/btrfs.h
+++ b/include/trace/events/btrfs.h
@@ -16,6 +16,8 @@ struct btrfs_delayed_ref_node;
16struct btrfs_delayed_tree_ref; 16struct btrfs_delayed_tree_ref;
17struct btrfs_delayed_data_ref; 17struct btrfs_delayed_data_ref;
18struct btrfs_delayed_ref_head; 18struct btrfs_delayed_ref_head;
19struct btrfs_block_group_cache;
20struct btrfs_free_cluster;
19struct map_lookup; 21struct map_lookup;
20struct extent_buffer; 22struct extent_buffer;
21 23
@@ -44,6 +46,17 @@ struct extent_buffer;
44 obj, ((obj >= BTRFS_DATA_RELOC_TREE_OBJECTID) || \ 46 obj, ((obj >= BTRFS_DATA_RELOC_TREE_OBJECTID) || \
45 (obj <= BTRFS_CSUM_TREE_OBJECTID )) ? __show_root_type(obj) : "-" 47 (obj <= BTRFS_CSUM_TREE_OBJECTID )) ? __show_root_type(obj) : "-"
46 48
49#define BTRFS_GROUP_FLAGS \
50 { BTRFS_BLOCK_GROUP_DATA, "DATA"}, \
51 { BTRFS_BLOCK_GROUP_SYSTEM, "SYSTEM"}, \
52 { BTRFS_BLOCK_GROUP_METADATA, "METADATA"}, \
53 { BTRFS_BLOCK_GROUP_RAID0, "RAID0"}, \
54 { BTRFS_BLOCK_GROUP_RAID1, "RAID1"}, \
55 { BTRFS_BLOCK_GROUP_DUP, "DUP"}, \
56 { BTRFS_BLOCK_GROUP_RAID10, "RAID10"}
57
58#define BTRFS_UUID_SIZE 16
59
47TRACE_EVENT(btrfs_transaction_commit, 60TRACE_EVENT(btrfs_transaction_commit,
48 61
49 TP_PROTO(struct btrfs_root *root), 62 TP_PROTO(struct btrfs_root *root),
@@ -621,6 +634,34 @@ TRACE_EVENT(btrfs_cow_block,
621 __entry->cow_level) 634 __entry->cow_level)
622); 635);
623 636
637TRACE_EVENT(btrfs_space_reservation,
638
639 TP_PROTO(struct btrfs_fs_info *fs_info, char *type, u64 val,
640 u64 bytes, int reserve),
641
642 TP_ARGS(fs_info, type, val, bytes, reserve),
643
644 TP_STRUCT__entry(
645 __array( u8, fsid, BTRFS_UUID_SIZE )
646 __string( type, type )
647 __field( u64, val )
648 __field( u64, bytes )
649 __field( int, reserve )
650 ),
651
652 TP_fast_assign(
653 memcpy(__entry->fsid, fs_info->fsid, BTRFS_UUID_SIZE);
654 __assign_str(type, type);
655 __entry->val = val;
656 __entry->bytes = bytes;
657 __entry->reserve = reserve;
658 ),
659
660 TP_printk("%pU: %s: %Lu %s %Lu", __entry->fsid, __get_str(type),
661 __entry->val, __entry->reserve ? "reserve" : "release",
662 __entry->bytes)
663);
664
624DECLARE_EVENT_CLASS(btrfs__reserved_extent, 665DECLARE_EVENT_CLASS(btrfs__reserved_extent,
625 666
626 TP_PROTO(struct btrfs_root *root, u64 start, u64 len), 667 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
@@ -659,6 +700,168 @@ DEFINE_EVENT(btrfs__reserved_extent, btrfs_reserved_extent_free,
659 TP_ARGS(root, start, len) 700 TP_ARGS(root, start, len)
660); 701);
661 702
703TRACE_EVENT(find_free_extent,
704
705 TP_PROTO(struct btrfs_root *root, u64 num_bytes, u64 empty_size,
706 u64 data),
707
708 TP_ARGS(root, num_bytes, empty_size, data),
709
710 TP_STRUCT__entry(
711 __field( u64, root_objectid )
712 __field( u64, num_bytes )
713 __field( u64, empty_size )
714 __field( u64, data )
715 ),
716
717 TP_fast_assign(
718 __entry->root_objectid = root->root_key.objectid;
719 __entry->num_bytes = num_bytes;
720 __entry->empty_size = empty_size;
721 __entry->data = data;
722 ),
723
724 TP_printk("root = %Lu(%s), len = %Lu, empty_size = %Lu, "
725 "flags = %Lu(%s)", show_root_type(__entry->root_objectid),
726 __entry->num_bytes, __entry->empty_size, __entry->data,
727 __print_flags((unsigned long)__entry->data, "|",
728 BTRFS_GROUP_FLAGS))
729);
730
731DECLARE_EVENT_CLASS(btrfs__reserve_extent,
732
733 TP_PROTO(struct btrfs_root *root,
734 struct btrfs_block_group_cache *block_group, u64 start,
735 u64 len),
736
737 TP_ARGS(root, block_group, start, len),
738
739 TP_STRUCT__entry(
740 __field( u64, root_objectid )
741 __field( u64, bg_objectid )
742 __field( u64, flags )
743 __field( u64, start )
744 __field( u64, len )
745 ),
746
747 TP_fast_assign(
748 __entry->root_objectid = root->root_key.objectid;
749 __entry->bg_objectid = block_group->key.objectid;
750 __entry->flags = block_group->flags;
751 __entry->start = start;
752 __entry->len = len;
753 ),
754
755 TP_printk("root = %Lu(%s), block_group = %Lu, flags = %Lu(%s), "
756 "start = %Lu, len = %Lu",
757 show_root_type(__entry->root_objectid), __entry->bg_objectid,
758 __entry->flags, __print_flags((unsigned long)__entry->flags,
759 "|", BTRFS_GROUP_FLAGS),
760 __entry->start, __entry->len)
761);
762
763DEFINE_EVENT(btrfs__reserve_extent, btrfs_reserve_extent,
764
765 TP_PROTO(struct btrfs_root *root,
766 struct btrfs_block_group_cache *block_group, u64 start,
767 u64 len),
768
769 TP_ARGS(root, block_group, start, len)
770);
771
772DEFINE_EVENT(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
773
774 TP_PROTO(struct btrfs_root *root,
775 struct btrfs_block_group_cache *block_group, u64 start,
776 u64 len),
777
778 TP_ARGS(root, block_group, start, len)
779);
780
781TRACE_EVENT(btrfs_find_cluster,
782
783 TP_PROTO(struct btrfs_block_group_cache *block_group, u64 start,
784 u64 bytes, u64 empty_size, u64 min_bytes),
785
786 TP_ARGS(block_group, start, bytes, empty_size, min_bytes),
787
788 TP_STRUCT__entry(
789 __field( u64, bg_objectid )
790 __field( u64, flags )
791 __field( u64, start )
792 __field( u64, bytes )
793 __field( u64, empty_size )
794 __field( u64, min_bytes )
795 ),
796
797 TP_fast_assign(
798 __entry->bg_objectid = block_group->key.objectid;
799 __entry->flags = block_group->flags;
800 __entry->start = start;
801 __entry->bytes = bytes;
802 __entry->empty_size = empty_size;
803 __entry->min_bytes = min_bytes;
804 ),
805
806 TP_printk("block_group = %Lu, flags = %Lu(%s), start = %Lu, len = %Lu,"
807 " empty_size = %Lu, min_bytes = %Lu", __entry->bg_objectid,
808 __entry->flags,
809 __print_flags((unsigned long)__entry->flags, "|",
810 BTRFS_GROUP_FLAGS), __entry->start,
811 __entry->bytes, __entry->empty_size, __entry->min_bytes)
812);
813
814TRACE_EVENT(btrfs_failed_cluster_setup,
815
816 TP_PROTO(struct btrfs_block_group_cache *block_group),
817
818 TP_ARGS(block_group),
819
820 TP_STRUCT__entry(
821 __field( u64, bg_objectid )
822 ),
823
824 TP_fast_assign(
825 __entry->bg_objectid = block_group->key.objectid;
826 ),
827
828 TP_printk("block_group = %Lu", __entry->bg_objectid)
829);
830
831TRACE_EVENT(btrfs_setup_cluster,
832
833 TP_PROTO(struct btrfs_block_group_cache *block_group,
834 struct btrfs_free_cluster *cluster, u64 size, int bitmap),
835
836 TP_ARGS(block_group, cluster, size, bitmap),
837
838 TP_STRUCT__entry(
839 __field( u64, bg_objectid )
840 __field( u64, flags )
841 __field( u64, start )
842 __field( u64, max_size )
843 __field( u64, size )
844 __field( int, bitmap )
845 ),
846
847 TP_fast_assign(
848 __entry->bg_objectid = block_group->key.objectid;
849 __entry->flags = block_group->flags;
850 __entry->start = cluster->window_start;
851 __entry->max_size = cluster->max_size;
852 __entry->size = size;
853 __entry->bitmap = bitmap;
854 ),
855
856 TP_printk("block_group = %Lu, flags = %Lu(%s), window_start = %Lu, "
857 "size = %Lu, max_size = %Lu, bitmap = %d",
858 __entry->bg_objectid,
859 __entry->flags,
860 __print_flags((unsigned long)__entry->flags, "|",
861 BTRFS_GROUP_FLAGS), __entry->start,
862 __entry->size, __entry->max_size, __entry->bitmap)
863);
864
662#endif /* _TRACE_BTRFS_H */ 865#endif /* _TRACE_BTRFS_H */
663 866
664/* This part must be outside protection */ 867/* This part must be outside protection */