diff options
-rw-r--r-- | fs/ext4/extents_status.c | 8 | ||||
-rw-r--r-- | include/trace/events/ext4.h | 101 |
2 files changed, 109 insertions, 0 deletions
diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c index 02c09be3d773..564d981a2fcc 100644 --- a/fs/ext4/extents_status.c +++ b/fs/ext4/extents_status.c | |||
@@ -14,6 +14,8 @@ | |||
14 | #include "extents_status.h" | 14 | #include "extents_status.h" |
15 | #include "ext4_extents.h" | 15 | #include "ext4_extents.h" |
16 | 16 | ||
17 | #include <trace/events/ext4.h> | ||
18 | |||
17 | /* | 19 | /* |
18 | * According to previous discussion in Ext4 Developer Workshop, we | 20 | * According to previous discussion in Ext4 Developer Workshop, we |
19 | * will introduce a new structure called io tree to track all extent | 21 | * will introduce a new structure called io tree to track all extent |
@@ -224,6 +226,8 @@ ext4_lblk_t ext4_es_find_extent(struct inode *inode, struct extent_status *es) | |||
224 | struct rb_node *node; | 226 | struct rb_node *node; |
225 | ext4_lblk_t ret = EXT_MAX_BLOCKS; | 227 | ext4_lblk_t ret = EXT_MAX_BLOCKS; |
226 | 228 | ||
229 | trace_ext4_es_find_extent_enter(inode, es->start); | ||
230 | |||
227 | read_lock(&EXT4_I(inode)->i_es_lock); | 231 | read_lock(&EXT4_I(inode)->i_es_lock); |
228 | tree = &EXT4_I(inode)->i_es_tree; | 232 | tree = &EXT4_I(inode)->i_es_tree; |
229 | 233 | ||
@@ -253,6 +257,8 @@ out: | |||
253 | } | 257 | } |
254 | 258 | ||
255 | read_unlock(&EXT4_I(inode)->i_es_lock); | 259 | read_unlock(&EXT4_I(inode)->i_es_lock); |
260 | |||
261 | trace_ext4_es_find_extent_exit(inode, es, ret); | ||
256 | return ret; | 262 | return ret; |
257 | } | 263 | } |
258 | 264 | ||
@@ -393,6 +399,7 @@ int ext4_es_insert_extent(struct inode *inode, ext4_lblk_t offset, | |||
393 | struct ext4_es_tree *tree; | 399 | struct ext4_es_tree *tree; |
394 | int err = 0; | 400 | int err = 0; |
395 | 401 | ||
402 | trace_ext4_es_insert_extent(inode, offset, len); | ||
396 | es_debug("add [%u/%u) to extent status tree of inode %lu\n", | 403 | es_debug("add [%u/%u) to extent status tree of inode %lu\n", |
397 | offset, len, inode->i_ino); | 404 | offset, len, inode->i_ino); |
398 | 405 | ||
@@ -422,6 +429,7 @@ int ext4_es_remove_extent(struct inode *inode, ext4_lblk_t offset, | |||
422 | ext4_lblk_t len1, len2, end; | 429 | ext4_lblk_t len1, len2, end; |
423 | int err = 0; | 430 | int err = 0; |
424 | 431 | ||
432 | trace_ext4_es_remove_extent(inode, offset, len); | ||
425 | es_debug("remove [%u/%u) from extent status tree of inode %lu\n", | 433 | es_debug("remove [%u/%u) from extent status tree of inode %lu\n", |
426 | offset, len, inode->i_ino); | 434 | offset, len, inode->i_ino); |
427 | 435 | ||
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h index d2a125a6db8b..f6372b011366 100644 --- a/include/trace/events/ext4.h +++ b/include/trace/events/ext4.h | |||
@@ -15,6 +15,7 @@ struct ext4_inode_info; | |||
15 | struct mpage_da_data; | 15 | struct mpage_da_data; |
16 | struct ext4_map_blocks; | 16 | struct ext4_map_blocks; |
17 | struct ext4_extent; | 17 | struct ext4_extent; |
18 | struct extent_status; | ||
18 | 19 | ||
19 | #define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode)) | 20 | #define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode)) |
20 | 21 | ||
@@ -2054,6 +2055,106 @@ TRACE_EVENT(ext4_ext_remove_space_done, | |||
2054 | (unsigned short) __entry->eh_entries) | 2055 | (unsigned short) __entry->eh_entries) |
2055 | ); | 2056 | ); |
2056 | 2057 | ||
2058 | TRACE_EVENT(ext4_es_insert_extent, | ||
2059 | TP_PROTO(struct inode *inode, ext4_lblk_t start, ext4_lblk_t len), | ||
2060 | |||
2061 | TP_ARGS(inode, start, len), | ||
2062 | |||
2063 | TP_STRUCT__entry( | ||
2064 | __field( dev_t, dev ) | ||
2065 | __field( ino_t, ino ) | ||
2066 | __field( loff_t, start ) | ||
2067 | __field( loff_t, len ) | ||
2068 | ), | ||
2069 | |||
2070 | TP_fast_assign( | ||
2071 | __entry->dev = inode->i_sb->s_dev; | ||
2072 | __entry->ino = inode->i_ino; | ||
2073 | __entry->start = start; | ||
2074 | __entry->len = len; | ||
2075 | ), | ||
2076 | |||
2077 | TP_printk("dev %d,%d ino %lu es [%lld/%lld)", | ||
2078 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
2079 | (unsigned long) __entry->ino, | ||
2080 | __entry->start, __entry->len) | ||
2081 | ); | ||
2082 | |||
2083 | TRACE_EVENT(ext4_es_remove_extent, | ||
2084 | TP_PROTO(struct inode *inode, ext4_lblk_t start, ext4_lblk_t len), | ||
2085 | |||
2086 | TP_ARGS(inode, start, len), | ||
2087 | |||
2088 | TP_STRUCT__entry( | ||
2089 | __field( dev_t, dev ) | ||
2090 | __field( ino_t, ino ) | ||
2091 | __field( loff_t, start ) | ||
2092 | __field( loff_t, len ) | ||
2093 | ), | ||
2094 | |||
2095 | TP_fast_assign( | ||
2096 | __entry->dev = inode->i_sb->s_dev; | ||
2097 | __entry->ino = inode->i_ino; | ||
2098 | __entry->start = start; | ||
2099 | __entry->len = len; | ||
2100 | ), | ||
2101 | |||
2102 | TP_printk("dev %d,%d ino %lu es [%lld/%lld)", | ||
2103 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
2104 | (unsigned long) __entry->ino, | ||
2105 | __entry->start, __entry->len) | ||
2106 | ); | ||
2107 | |||
2108 | TRACE_EVENT(ext4_es_find_extent_enter, | ||
2109 | TP_PROTO(struct inode *inode, ext4_lblk_t start), | ||
2110 | |||
2111 | TP_ARGS(inode, start), | ||
2112 | |||
2113 | TP_STRUCT__entry( | ||
2114 | __field( dev_t, dev ) | ||
2115 | __field( ino_t, ino ) | ||
2116 | __field( ext4_lblk_t, start ) | ||
2117 | ), | ||
2118 | |||
2119 | TP_fast_assign( | ||
2120 | __entry->dev = inode->i_sb->s_dev; | ||
2121 | __entry->ino = inode->i_ino; | ||
2122 | __entry->start = start; | ||
2123 | ), | ||
2124 | |||
2125 | TP_printk("dev %d,%d ino %lu start %u", | ||
2126 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
2127 | (unsigned long) __entry->ino, __entry->start) | ||
2128 | ); | ||
2129 | |||
2130 | TRACE_EVENT(ext4_es_find_extent_exit, | ||
2131 | TP_PROTO(struct inode *inode, struct extent_status *es, | ||
2132 | ext4_lblk_t ret), | ||
2133 | |||
2134 | TP_ARGS(inode, es, ret), | ||
2135 | |||
2136 | TP_STRUCT__entry( | ||
2137 | __field( dev_t, dev ) | ||
2138 | __field( ino_t, ino ) | ||
2139 | __field( ext4_lblk_t, start ) | ||
2140 | __field( ext4_lblk_t, len ) | ||
2141 | __field( ext4_lblk_t, ret ) | ||
2142 | ), | ||
2143 | |||
2144 | TP_fast_assign( | ||
2145 | __entry->dev = inode->i_sb->s_dev; | ||
2146 | __entry->ino = inode->i_ino; | ||
2147 | __entry->start = es->start; | ||
2148 | __entry->len = es->len; | ||
2149 | __entry->ret = ret; | ||
2150 | ), | ||
2151 | |||
2152 | TP_printk("dev %d,%d ino %lu es [%u/%u) ret %u", | ||
2153 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
2154 | (unsigned long) __entry->ino, | ||
2155 | __entry->start, __entry->len, __entry->ret) | ||
2156 | ); | ||
2157 | |||
2057 | #endif /* _TRACE_EXT4_H */ | 2158 | #endif /* _TRACE_EXT4_H */ |
2058 | 2159 | ||
2059 | /* This part must be outside protection */ | 2160 | /* This part must be outside protection */ |