diff options
author | Josef Bacik <josef@redhat.com> | 2011-11-10 08:29:20 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2012-01-16 15:29:42 -0500 |
commit | 3f7de037fb3727b20bc27332cdcf2488b702394c (patch) | |
tree | 7e355b7e60b584ca7aaaf7c8abfa1f2408c15ff2 /include/trace | |
parent | 45a8090e626ab470c91142954431a93846030b0d (diff) |
Btrfs: add allocator tracepoints
I used these tracepoints when figuring out what the cluster stuff was doing, so
add them to mainline in case we need to profile this stuff again. Thanks,
Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/btrfs.h | 173 |
1 files changed, 173 insertions, 0 deletions
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h index b31702ac15be..1750c0e6660c 100644 --- a/include/trace/events/btrfs.h +++ b/include/trace/events/btrfs.h | |||
@@ -16,6 +16,8 @@ struct btrfs_delayed_ref_node; | |||
16 | struct btrfs_delayed_tree_ref; | 16 | struct btrfs_delayed_tree_ref; |
17 | struct btrfs_delayed_data_ref; | 17 | struct btrfs_delayed_data_ref; |
18 | struct btrfs_delayed_ref_head; | 18 | struct btrfs_delayed_ref_head; |
19 | struct btrfs_block_group_cache; | ||
20 | struct btrfs_free_cluster; | ||
19 | struct map_lookup; | 21 | struct map_lookup; |
20 | struct extent_buffer; | 22 | struct extent_buffer; |
21 | 23 | ||
@@ -44,6 +46,15 @@ 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 | |||
47 | TRACE_EVENT(btrfs_transaction_commit, | 58 | TRACE_EVENT(btrfs_transaction_commit, |
48 | 59 | ||
49 | TP_PROTO(struct btrfs_root *root), | 60 | TP_PROTO(struct btrfs_root *root), |
@@ -659,6 +670,168 @@ DEFINE_EVENT(btrfs__reserved_extent, btrfs_reserved_extent_free, | |||
659 | TP_ARGS(root, start, len) | 670 | TP_ARGS(root, start, len) |
660 | ); | 671 | ); |
661 | 672 | ||
673 | TRACE_EVENT(find_free_extent, | ||
674 | |||
675 | TP_PROTO(struct btrfs_root *root, u64 num_bytes, u64 empty_size, | ||
676 | u64 data), | ||
677 | |||
678 | TP_ARGS(root, num_bytes, empty_size, data), | ||
679 | |||
680 | TP_STRUCT__entry( | ||
681 | __field( u64, root_objectid ) | ||
682 | __field( u64, num_bytes ) | ||
683 | __field( u64, empty_size ) | ||
684 | __field( u64, data ) | ||
685 | ), | ||
686 | |||
687 | TP_fast_assign( | ||
688 | __entry->root_objectid = root->root_key.objectid; | ||
689 | __entry->num_bytes = num_bytes; | ||
690 | __entry->empty_size = empty_size; | ||
691 | __entry->data = data; | ||
692 | ), | ||
693 | |||
694 | TP_printk("root = %Lu(%s), len = %Lu, empty_size = %Lu, " | ||
695 | "flags = %Lu(%s)", show_root_type(__entry->root_objectid), | ||
696 | __entry->num_bytes, __entry->empty_size, __entry->data, | ||
697 | __print_flags((unsigned long)__entry->data, "|", | ||
698 | BTRFS_GROUP_FLAGS)) | ||
699 | ); | ||
700 | |||
701 | DECLARE_EVENT_CLASS(btrfs__reserve_extent, | ||
702 | |||
703 | TP_PROTO(struct btrfs_root *root, | ||
704 | struct btrfs_block_group_cache *block_group, u64 start, | ||
705 | u64 len), | ||
706 | |||
707 | TP_ARGS(root, block_group, start, len), | ||
708 | |||
709 | TP_STRUCT__entry( | ||
710 | __field( u64, root_objectid ) | ||
711 | __field( u64, bg_objectid ) | ||
712 | __field( u64, flags ) | ||
713 | __field( u64, start ) | ||
714 | __field( u64, len ) | ||
715 | ), | ||
716 | |||
717 | TP_fast_assign( | ||
718 | __entry->root_objectid = root->root_key.objectid; | ||
719 | __entry->bg_objectid = block_group->key.objectid; | ||
720 | __entry->flags = block_group->flags; | ||
721 | __entry->start = start; | ||
722 | __entry->len = len; | ||
723 | ), | ||
724 | |||
725 | TP_printk("root = %Lu(%s), block_group = %Lu, flags = %Lu(%s), " | ||
726 | "start = %Lu, len = %Lu", | ||
727 | show_root_type(__entry->root_objectid), __entry->bg_objectid, | ||
728 | __entry->flags, __print_flags((unsigned long)__entry->flags, | ||
729 | "|", BTRFS_GROUP_FLAGS), | ||
730 | __entry->start, __entry->len) | ||
731 | ); | ||
732 | |||
733 | DEFINE_EVENT(btrfs__reserve_extent, btrfs_reserve_extent, | ||
734 | |||
735 | TP_PROTO(struct btrfs_root *root, | ||
736 | struct btrfs_block_group_cache *block_group, u64 start, | ||
737 | u64 len), | ||
738 | |||
739 | TP_ARGS(root, block_group, start, len) | ||
740 | ); | ||
741 | |||
742 | DEFINE_EVENT(btrfs__reserve_extent, btrfs_reserve_extent_cluster, | ||
743 | |||
744 | TP_PROTO(struct btrfs_root *root, | ||
745 | struct btrfs_block_group_cache *block_group, u64 start, | ||
746 | u64 len), | ||
747 | |||
748 | TP_ARGS(root, block_group, start, len) | ||
749 | ); | ||
750 | |||
751 | TRACE_EVENT(btrfs_find_cluster, | ||
752 | |||
753 | TP_PROTO(struct btrfs_block_group_cache *block_group, u64 start, | ||
754 | u64 bytes, u64 empty_size, u64 min_bytes), | ||
755 | |||
756 | TP_ARGS(block_group, start, bytes, empty_size, min_bytes), | ||
757 | |||
758 | TP_STRUCT__entry( | ||
759 | __field( u64, bg_objectid ) | ||
760 | __field( u64, flags ) | ||
761 | __field( u64, start ) | ||
762 | __field( u64, bytes ) | ||
763 | __field( u64, empty_size ) | ||
764 | __field( u64, min_bytes ) | ||
765 | ), | ||
766 | |||
767 | TP_fast_assign( | ||
768 | __entry->bg_objectid = block_group->key.objectid; | ||
769 | __entry->flags = block_group->flags; | ||
770 | __entry->start = start; | ||
771 | __entry->bytes = bytes; | ||
772 | __entry->empty_size = empty_size; | ||
773 | __entry->min_bytes = min_bytes; | ||
774 | ), | ||
775 | |||
776 | TP_printk("block_group = %Lu, flags = %Lu(%s), start = %Lu, len = %Lu," | ||
777 | " empty_size = %Lu, min_bytes = %Lu", __entry->bg_objectid, | ||
778 | __entry->flags, | ||
779 | __print_flags((unsigned long)__entry->flags, "|", | ||
780 | BTRFS_GROUP_FLAGS), __entry->start, | ||
781 | __entry->bytes, __entry->empty_size, __entry->min_bytes) | ||
782 | ); | ||
783 | |||
784 | TRACE_EVENT(btrfs_failed_cluster_setup, | ||
785 | |||
786 | TP_PROTO(struct btrfs_block_group_cache *block_group), | ||
787 | |||
788 | TP_ARGS(block_group), | ||
789 | |||
790 | TP_STRUCT__entry( | ||
791 | __field( u64, bg_objectid ) | ||
792 | ), | ||
793 | |||
794 | TP_fast_assign( | ||
795 | __entry->bg_objectid = block_group->key.objectid; | ||
796 | ), | ||
797 | |||
798 | TP_printk("block_group = %Lu", __entry->bg_objectid) | ||
799 | ); | ||
800 | |||
801 | TRACE_EVENT(btrfs_setup_cluster, | ||
802 | |||
803 | TP_PROTO(struct btrfs_block_group_cache *block_group, | ||
804 | struct btrfs_free_cluster *cluster, u64 size, int bitmap), | ||
805 | |||
806 | TP_ARGS(block_group, cluster, size, bitmap), | ||
807 | |||
808 | TP_STRUCT__entry( | ||
809 | __field( u64, bg_objectid ) | ||
810 | __field( u64, flags ) | ||
811 | __field( u64, start ) | ||
812 | __field( u64, max_size ) | ||
813 | __field( u64, size ) | ||
814 | __field( int, bitmap ) | ||
815 | ), | ||
816 | |||
817 | TP_fast_assign( | ||
818 | __entry->bg_objectid = block_group->key.objectid; | ||
819 | __entry->flags = block_group->flags; | ||
820 | __entry->start = cluster->window_start; | ||
821 | __entry->max_size = cluster->max_size; | ||
822 | __entry->size = size; | ||
823 | __entry->bitmap = bitmap; | ||
824 | ), | ||
825 | |||
826 | TP_printk("block_group = %Lu, flags = %Lu(%s), window_start = %Lu, " | ||
827 | "size = %Lu, max_size = %Lu, bitmap = %d", | ||
828 | __entry->bg_objectid, | ||
829 | __entry->flags, | ||
830 | __print_flags((unsigned long)__entry->flags, "|", | ||
831 | BTRFS_GROUP_FLAGS), __entry->start, | ||
832 | __entry->size, __entry->max_size, __entry->bitmap) | ||
833 | ); | ||
834 | |||
662 | #endif /* _TRACE_BTRFS_H */ | 835 | #endif /* _TRACE_BTRFS_H */ |
663 | 836 | ||
664 | /* This part must be outside protection */ | 837 | /* This part must be outside protection */ |