X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=instrumentation%2Fevents%2Flttng-module%2Fbtrfs.h;h=8ed38d9383bb494abbc97a72c99abd49661348d8;hb=517a431174b78d1da2cda8bc6f0e6f125f9d41aa;hp=56cfce5db5c2058d198552fd99b4e2051568694e;hpb=4dbf0908feb928be0092c86cd6f20539c39c6c9d;p=lttng-modules.git diff --git a/instrumentation/events/lttng-module/btrfs.h b/instrumentation/events/lttng-module/btrfs.h index 56cfce5d..8ed38d93 100644 --- a/instrumentation/events/lttng-module/btrfs.h +++ b/instrumentation/events/lttng-module/btrfs.h @@ -39,7 +39,37 @@ struct extent_state; { BTRFS_SHARED_BLOCK_REF_KEY, "SHARED_BLOCK_REF" }, \ { BTRFS_SHARED_DATA_REF_KEY, "SHARED_DATA_REF" }) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,40)) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) +#define __show_root_type(obj) \ + __print_symbolic_u64(obj, \ + { BTRFS_ROOT_TREE_OBJECTID, "ROOT_TREE" }, \ + { BTRFS_EXTENT_TREE_OBJECTID, "EXTENT_TREE" }, \ + { BTRFS_CHUNK_TREE_OBJECTID, "CHUNK_TREE" }, \ + { BTRFS_DEV_TREE_OBJECTID, "DEV_TREE" }, \ + { BTRFS_FS_TREE_OBJECTID, "FS_TREE" }, \ + { BTRFS_ROOT_TREE_DIR_OBJECTID, "ROOT_TREE_DIR" }, \ + { BTRFS_CSUM_TREE_OBJECTID, "CSUM_TREE" }, \ + { BTRFS_TREE_LOG_OBJECTID, "TREE_LOG" }, \ + { BTRFS_QUOTA_TREE_OBJECTID, "QUOTA_TREE" }, \ + { BTRFS_TREE_RELOC_OBJECTID, "TREE_RELOC" }, \ + { BTRFS_UUID_TREE_OBJECTID, "UUID_RELOC" }, \ + { BTRFS_DATA_RELOC_TREE_OBJECTID, "DATA_RELOC_TREE" }) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) +#define __show_root_type(obj) \ + __print_symbolic_u64(obj, \ + { BTRFS_ROOT_TREE_OBJECTID, "ROOT_TREE" }, \ + { BTRFS_EXTENT_TREE_OBJECTID, "EXTENT_TREE" }, \ + { BTRFS_CHUNK_TREE_OBJECTID, "CHUNK_TREE" }, \ + { BTRFS_DEV_TREE_OBJECTID, "DEV_TREE" }, \ + { BTRFS_FS_TREE_OBJECTID, "FS_TREE" }, \ + { BTRFS_ROOT_TREE_DIR_OBJECTID, "ROOT_TREE_DIR" }, \ + { BTRFS_CSUM_TREE_OBJECTID, "CSUM_TREE" }, \ + { BTRFS_TREE_LOG_OBJECTID, "TREE_LOG" }, \ + { BTRFS_QUOTA_TREE_OBJECTID, "QUOTA_TREE" }, \ + { BTRFS_TREE_RELOC_OBJECTID, "TREE_RELOC" }, \ + { BTRFS_DATA_RELOC_TREE_OBJECTID, "DATA_RELOC_TREE" }) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,40)) #define __show_root_type(obj) \ __print_symbolic_u64(obj, \ { BTRFS_ROOT_TREE_OBJECTID, "ROOT_TREE" }, \ @@ -67,7 +97,12 @@ struct extent_state; { BTRFS_DATA_RELOC_TREE_OBJECTID, "DATA_RELOC_TREE" }) #endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) +#define show_root_type(obj) \ + obj, ((obj >= BTRFS_DATA_RELOC_TREE_OBJECTID) || \ + (obj >= BTRFS_ROOT_TREE_OBJECTID && \ + obj <= BTRFS_QUOTA_TREE_OBJECTID)) ? __show_root_type(obj) : "-" +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) #define show_root_type(obj) \ obj, ((obj >= BTRFS_DATA_RELOC_TREE_OBJECTID) || \ (obj >= BTRFS_ROOT_TREE_OBJECTID && \ @@ -78,7 +113,20 @@ struct extent_state; (obj <= BTRFS_CSUM_TREE_OBJECTID )) ? __show_root_type(obj) : "-" #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) + +#define BTRFS_GROUP_FLAGS \ + { BTRFS_BLOCK_GROUP_DATA, "DATA"}, \ + { BTRFS_BLOCK_GROUP_SYSTEM, "SYSTEM"}, \ + { BTRFS_BLOCK_GROUP_METADATA, "METADATA"}, \ + { BTRFS_BLOCK_GROUP_RAID0, "RAID0"}, \ + { BTRFS_BLOCK_GROUP_RAID1, "RAID1"}, \ + { BTRFS_BLOCK_GROUP_DUP, "DUP"}, \ + { BTRFS_BLOCK_GROUP_RAID10, "RAID10"}, \ + { BTRFS_BLOCK_GROUP_RAID5, "RAID5"}, \ + { BTRFS_BLOCK_GROUP_RAID6, "RAID6"} + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) #define BTRFS_GROUP_FLAGS \ { BTRFS_BLOCK_GROUP_DATA, "DATA"}, \ @@ -192,6 +240,19 @@ DEFINE_EVENT(btrfs__inode, btrfs_inode_evict, #define show_map_type(type) \ type, (type >= EXTENT_MAP_LAST_BYTE) ? "-" : __show_map_type(type) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) + +#define show_map_flags(flag) \ + __print_flags(flag, "|", \ + { EXTENT_FLAG_PINNED, "PINNED" }, \ + { EXTENT_FLAG_COMPRESSED, "COMPRESSED" }, \ + { EXTENT_FLAG_VACANCY, "VACANCY" }, \ + { EXTENT_FLAG_PREALLOC, "PREALLOC" }, \ + { EXTENT_FLAG_LOGGING, "LOGGING" }, \ + { EXTENT_FLAG_FILLING, "FILLING" }) + +#else + #define show_map_flags(flag) \ __print_flags(flag, "|", \ { EXTENT_FLAG_PINNED, "PINNED" }, \ @@ -199,6 +260,8 @@ DEFINE_EVENT(btrfs__inode, btrfs_inode_evict, { EXTENT_FLAG_VACANCY, "VACANCY" }, \ { EXTENT_FLAG_PREALLOC, "PREALLOC" }) +#endif + TRACE_EVENT(btrfs_get_extent, TP_PROTO(struct btrfs_root *root, struct extent_map *map), @@ -243,6 +306,37 @@ TRACE_EVENT(btrfs_get_extent, __entry->refs, __entry->compress_type) ) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + +#define show_ordered_flags(flags) \ + __print_flags(flags, "|", \ + { (1 << BTRFS_ORDERED_IO_DONE), "IO_DONE" }, \ + { (1 << BTRFS_ORDERED_COMPLETE), "COMPLETE" }, \ + { (1 << BTRFS_ORDERED_NOCOW), "NOCOW" }, \ + { (1 << BTRFS_ORDERED_COMPRESSED), "COMPRESSED" }, \ + { (1 << BTRFS_ORDERED_PREALLOC), "PREALLOC" }, \ + { (1 << BTRFS_ORDERED_DIRECT), "DIRECT" }, \ + { (1 << BTRFS_ORDERED_IOERR), "IOERR" }, \ + { (1 << BTRFS_ORDERED_UPDATED_ISIZE), "UPDATED_ISIZE" }, \ + { (1 << BTRFS_ORDERED_LOGGED_CSUM), "LOGGED_CSUM" }, \ + { (1 << BTRFS_ORDERED_TRUNCATED), "TRUNCATED" }) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) + +#define show_ordered_flags(flags) \ + __print_symbolic(flags, \ + { BTRFS_ORDERED_IO_DONE, "IO_DONE" }, \ + { BTRFS_ORDERED_COMPLETE, "COMPLETE" }, \ + { BTRFS_ORDERED_NOCOW, "NOCOW" }, \ + { BTRFS_ORDERED_COMPRESSED, "COMPRESSED" }, \ + { BTRFS_ORDERED_PREALLOC, "PREALLOC" }, \ + { BTRFS_ORDERED_DIRECT, "DIRECT" }, \ + { BTRFS_ORDERED_IOERR, "IOERR" }, \ + { BTRFS_ORDERED_UPDATED_ISIZE, "UPDATED_ISIZE" }, \ + { BTRFS_ORDERED_LOGGED_CSUM, "LOGGED_CSUM" }) + +#else + #define show_ordered_flags(flags) \ __print_symbolic(flags, \ { BTRFS_ORDERED_IO_DONE, "IO_DONE" }, \ @@ -252,6 +346,8 @@ TRACE_EVENT(btrfs_get_extent, { BTRFS_ORDERED_PREALLOC, "PREALLOC" }, \ { BTRFS_ORDERED_DIRECT, "DIRECT" }) +#endif + DECLARE_EVENT_CLASS(btrfs__ordered_extent, TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), @@ -635,6 +731,22 @@ TRACE_EVENT(btrfs_delayed_ref_head, __entry->is_data) ) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) + +#define show_chunk_type(type) \ + __print_flags(type, "|", \ + { BTRFS_BLOCK_GROUP_DATA, "DATA" }, \ + { BTRFS_BLOCK_GROUP_SYSTEM, "SYSTEM"}, \ + { BTRFS_BLOCK_GROUP_METADATA, "METADATA"}, \ + { BTRFS_BLOCK_GROUP_RAID0, "RAID0" }, \ + { BTRFS_BLOCK_GROUP_RAID1, "RAID1" }, \ + { BTRFS_BLOCK_GROUP_DUP, "DUP" }, \ + { BTRFS_BLOCK_GROUP_RAID10, "RAID10"}, \ + { BTRFS_BLOCK_GROUP_RAID5, "RAID5" }, \ + { BTRFS_BLOCK_GROUP_RAID6, "RAID6" }) + +#else + #define show_chunk_type(type) \ __print_flags(type, "|", \ { BTRFS_BLOCK_GROUP_DATA, "DATA" }, \ @@ -645,6 +757,8 @@ TRACE_EVENT(btrfs_delayed_ref_head, { BTRFS_BLOCK_GROUP_DUP, "DUP" }, \ { BTRFS_BLOCK_GROUP_RAID10, "RAID10"}) +#endif + DECLARE_EVENT_CLASS(btrfs__chunk, TP_PROTO(struct btrfs_root *root, struct map_lookup *map, @@ -799,7 +913,9 @@ DEFINE_EVENT(btrfs__reserved_extent, btrfs_reserved_extent_free, ) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) -TRACE_EVENT(find_free_extent, +TRACE_EVENT_MAP(find_free_extent, + + btrfs_find_free_extent, TP_PROTO(struct btrfs_root *root, u64 num_bytes, u64 empty_size, u64 data), @@ -963,7 +1079,9 @@ TRACE_EVENT(btrfs_setup_cluster, #endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) -TRACE_EVENT(alloc_extent_state, +TRACE_EVENT_MAP(alloc_extent_state, + + btrfs_alloc_extent_state, TP_PROTO(struct extent_state *state, gfp_t mask, unsigned long IP), @@ -985,7 +1103,9 @@ TRACE_EVENT(alloc_extent_state, show_gfp_flags(__entry->mask), (void *)__entry->ip) ) -TRACE_EVENT(free_extent_state, +TRACE_EVENT_MAP(free_extent_state, + + btrfs_free_extent_state, TP_PROTO(struct extent_state *state, unsigned long IP),