Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 1 | From 8af8245f6f86370d01cc4acaabafb90de45e143f Mon Sep 17 00:00:00 2001 |
| 2 | From: Michael Jeanson <mjeanson@efficios.com> |
| 3 | Date: Thu, 10 Jan 2019 14:56:15 -0500 |
| 4 | Subject: [PATCH 8/9] Fix: btrfs: Remove fsid/metadata_fsid fields from |
| 5 | btrfs_info |
| 6 | |
| 7 | Introduced in v5.0. |
| 8 | |
| 9 | See upstream commit : |
| 10 | |
| 11 | commit de37aa513105f864d3c21105bf5542d498f21ca2 |
| 12 | Author: Nikolay Borisov <nborisov@suse.com> |
| 13 | Date: Tue Oct 30 16:43:24 2018 +0200 |
| 14 | |
| 15 | btrfs: Remove fsid/metadata_fsid fields from btrfs_info |
| 16 | |
| 17 | Currently btrfs_fs_info structure contains a copy of the |
| 18 | fsid/metadata_uuid fields. Same values are also contained in the |
| 19 | btrfs_fs_devices structure which fs_info has a reference to. Let's |
| 20 | reduce duplication by removing the fields from fs_info and always refer |
| 21 | to the ones in fs_devices. No functional changes. |
| 22 | |
| 23 | Signed-off-by: Michael Jeanson <mjeanson@efficios.com> |
| 24 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
| 25 | |
| 26 | Upstream-Status: backport https://github.com/lttng/lttng-modules/commit/8af8245f6f86370d01cc4acaabafb90de45e143f |
| 27 | |
| 28 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> |
| 29 | --- |
| 30 | instrumentation/events/lttng-module/btrfs.h | 100 +++++++++++--------- |
| 31 | 1 file changed, 53 insertions(+), 47 deletions(-) |
| 32 | |
| 33 | diff --git a/instrumentation/events/lttng-module/btrfs.h b/instrumentation/events/lttng-module/btrfs.h |
| 34 | index 4dfbf5b..ec45a1e 100644 |
| 35 | --- a/instrumentation/events/lttng-module/btrfs.h |
| 36 | +++ b/instrumentation/events/lttng-module/btrfs.h |
| 37 | @@ -32,6 +32,12 @@ struct extent_state; |
| 38 | |
| 39 | #define BTRFS_UUID_SIZE 16 |
| 40 | |
| 41 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)) |
| 42 | +#define lttng_fs_info_fsid fs_info->fs_devices->fsid |
| 43 | +#else |
| 44 | +#define lttng_fs_info_fsid fs_info->fsid |
| 45 | +#endif |
| 46 | + |
| 47 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ |
| 48 | LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
| 49 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ |
| 50 | @@ -629,7 +635,7 @@ LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group, |
| 51 | TP_ARGS(fs_info, block_group, create), |
| 52 | |
| 53 | TP_FIELDS( |
| 54 | - ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE) |
| 55 | + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) |
| 56 | ctf_integer(u64, offset, block_group->key.objectid) |
| 57 | ctf_integer(u64, size, block_group->key.offset) |
| 58 | ctf_integer(u64, flags, block_group->flags) |
| 59 | @@ -647,7 +653,7 @@ LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group, |
| 60 | TP_ARGS(fs_info, block_group, create), |
| 61 | |
| 62 | TP_FIELDS( |
| 63 | - ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE) |
| 64 | + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) |
| 65 | ctf_integer(u64, offset, block_group->key.objectid) |
| 66 | ctf_integer(u64, size, block_group->key.offset) |
| 67 | ctf_integer(u64, flags, block_group->flags) |
| 68 | @@ -1015,18 +1021,18 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk, |
| 69 | |
| 70 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc, |
| 71 | |
| 72 | - TP_PROTO(const struct btrfs_fs_info *info, const struct map_lookup *map, |
| 73 | + TP_PROTO(const struct btrfs_fs_info *fs_info, const struct map_lookup *map, |
| 74 | u64 offset, u64 size), |
| 75 | |
| 76 | - TP_ARGS(info, map, offset, size) |
| 77 | + TP_ARGS(fs_info, map, offset, size) |
| 78 | ) |
| 79 | |
| 80 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free, |
| 81 | |
| 82 | - TP_PROTO(const struct btrfs_fs_info *info, const struct map_lookup *map, |
| 83 | + TP_PROTO(const struct btrfs_fs_info *fs_info, const struct map_lookup *map, |
| 84 | u64 offset, u64 size), |
| 85 | |
| 86 | - TP_ARGS(info, map, offset, size) |
| 87 | + TP_ARGS(fs_info, map, offset, size) |
| 88 | ) |
| 89 | |
| 90 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) |
| 91 | @@ -1050,18 +1056,18 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk, |
| 92 | |
| 93 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc, |
| 94 | |
| 95 | - TP_PROTO(struct btrfs_fs_info *info, struct map_lookup *map, |
| 96 | + TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map, |
| 97 | u64 offset, u64 size), |
| 98 | |
| 99 | - TP_ARGS(info, map, offset, size) |
| 100 | + TP_ARGS(fs_info, map, offset, size) |
| 101 | ) |
| 102 | |
| 103 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free, |
| 104 | |
| 105 | - TP_PROTO(struct btrfs_fs_info *info, struct map_lookup *map, |
| 106 | + TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map, |
| 107 | u64 offset, u64 size), |
| 108 | |
| 109 | - TP_ARGS(info, map, offset, size) |
| 110 | + TP_ARGS(fs_info, map, offset, size) |
| 111 | ) |
| 112 | |
| 113 | #elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
| 114 | @@ -1192,7 +1198,7 @@ LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation, |
| 115 | TP_ARGS(fs_info, type, val, bytes, reserve), |
| 116 | |
| 117 | TP_FIELDS( |
| 118 | - ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE) |
| 119 | + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) |
| 120 | ctf_string(type, type) |
| 121 | ctf_integer(u64, val, val) |
| 122 | ctf_integer(u64, bytes, bytes) |
| 123 | @@ -1208,7 +1214,7 @@ LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation, |
| 124 | TP_ARGS(fs_info, type, val, bytes, reserve), |
| 125 | |
| 126 | TP_FIELDS( |
| 127 | - ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE) |
| 128 | + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) |
| 129 | ctf_string(type, type) |
| 130 | ctf_integer(u64, val, val) |
| 131 | ctf_integer(u64, bytes, bytes) |
| 132 | @@ -1221,9 +1227,9 @@ LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation, |
| 133 | |
| 134 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, |
| 135 | |
| 136 | - TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len), |
| 137 | + TP_PROTO(const struct btrfs_fs_info *fs_info, u64 start, u64 len), |
| 138 | |
| 139 | - TP_ARGS(info, start, len), |
| 140 | + TP_ARGS(fs_info, start, len), |
| 141 | |
| 142 | TP_FIELDS( |
| 143 | ctf_integer(u64, start, start) |
| 144 | @@ -1233,25 +1239,25 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, |
| 145 | |
| 146 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc, |
| 147 | |
| 148 | - TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len), |
| 149 | + TP_PROTO(const struct btrfs_fs_info *fs_info, u64 start, u64 len), |
| 150 | |
| 151 | - TP_ARGS(info, start, len) |
| 152 | + TP_ARGS(fs_info, start, len) |
| 153 | ) |
| 154 | |
| 155 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free, |
| 156 | |
| 157 | - TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len), |
| 158 | + TP_PROTO(const struct btrfs_fs_info *fs_info, u64 start, u64 len), |
| 159 | |
| 160 | - TP_ARGS(info, start, len) |
| 161 | + TP_ARGS(fs_info, start, len) |
| 162 | ) |
| 163 | |
| 164 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) |
| 165 | |
| 166 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, |
| 167 | |
| 168 | - TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len), |
| 169 | + TP_PROTO(struct btrfs_fs_info *fs_info, u64 start, u64 len), |
| 170 | |
| 171 | - TP_ARGS(info, start, len), |
| 172 | + TP_ARGS(fs_info, start, len), |
| 173 | |
| 174 | TP_FIELDS( |
| 175 | ctf_integer(u64, start, start) |
| 176 | @@ -1261,16 +1267,16 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, |
| 177 | |
| 178 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc, |
| 179 | |
| 180 | - TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len), |
| 181 | + TP_PROTO(struct btrfs_fs_info *fs_info, u64 start, u64 len), |
| 182 | |
| 183 | - TP_ARGS(info, start, len) |
| 184 | + TP_ARGS(fs_info, start, len) |
| 185 | ) |
| 186 | |
| 187 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free, |
| 188 | |
| 189 | - TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len), |
| 190 | + TP_PROTO(struct btrfs_fs_info *fs_info, u64 start, u64 len), |
| 191 | |
| 192 | - TP_ARGS(info, start, len) |
| 193 | + TP_ARGS(fs_info, start, len) |
| 194 | ) |
| 195 | |
| 196 | #elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
| 197 | @@ -1341,13 +1347,13 @@ LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, |
| 198 | |
| 199 | btrfs_find_free_extent, |
| 200 | |
| 201 | - TP_PROTO(const struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size, |
| 202 | + TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size, |
| 203 | u64 data), |
| 204 | |
| 205 | - TP_ARGS(info, num_bytes, empty_size, data), |
| 206 | + TP_ARGS(fs_info, num_bytes, empty_size, data), |
| 207 | |
| 208 | TP_FIELDS( |
| 209 | - ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE) |
| 210 | + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) |
| 211 | ctf_integer(u64, num_bytes, num_bytes) |
| 212 | ctf_integer(u64, empty_size, empty_size) |
| 213 | ctf_integer(u64, data, data) |
| 214 | @@ -1362,7 +1368,7 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, |
| 215 | TP_ARGS(block_group, start, len), |
| 216 | |
| 217 | TP_FIELDS( |
| 218 | - ctf_array(u8, fsid, block_group->fs_info->fsid, BTRFS_UUID_SIZE) |
| 219 | + ctf_array(u8, fsid, block_group->lttng_fs_info_fsid, BTRFS_UUID_SIZE) |
| 220 | ctf_integer(u64, bg_objectid, block_group->key.objectid) |
| 221 | ctf_integer(u64, flags, block_group->flags) |
| 222 | ctf_integer(u64, start, start) |
| 223 | @@ -1391,13 +1397,13 @@ LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, |
| 224 | |
| 225 | btrfs_find_free_extent, |
| 226 | |
| 227 | - TP_PROTO(const struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size, |
| 228 | + TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size, |
| 229 | u64 data), |
| 230 | |
| 231 | - TP_ARGS(info, num_bytes, empty_size, data), |
| 232 | + TP_ARGS(fs_info, num_bytes, empty_size, data), |
| 233 | |
| 234 | TP_FIELDS( |
| 235 | - ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE) |
| 236 | + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) |
| 237 | ctf_integer(u64, num_bytes, num_bytes) |
| 238 | ctf_integer(u64, empty_size, empty_size) |
| 239 | ctf_integer(u64, data, data) |
| 240 | @@ -1406,14 +1412,14 @@ LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, |
| 241 | |
| 242 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, |
| 243 | |
| 244 | - TP_PROTO(const struct btrfs_fs_info *info, |
| 245 | + TP_PROTO(const struct btrfs_fs_info *fs_info, |
| 246 | const struct btrfs_block_group_cache *block_group, u64 start, |
| 247 | u64 len), |
| 248 | |
| 249 | - TP_ARGS(info, block_group, start, len), |
| 250 | + TP_ARGS(fs_info, block_group, start, len), |
| 251 | |
| 252 | TP_FIELDS( |
| 253 | - ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE) |
| 254 | + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) |
| 255 | ctf_integer(u64, bg_objectid, block_group->key.objectid) |
| 256 | ctf_integer(u64, flags, block_group->flags) |
| 257 | ctf_integer(u64, start, start) |
| 258 | @@ -1423,20 +1429,20 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, |
| 259 | |
| 260 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent, |
| 261 | |
| 262 | - TP_PROTO(const struct btrfs_fs_info *info, |
| 263 | + TP_PROTO(const struct btrfs_fs_info *fs_info, |
| 264 | const struct btrfs_block_group_cache *block_group, u64 start, |
| 265 | u64 len), |
| 266 | |
| 267 | - TP_ARGS(info, block_group, start, len) |
| 268 | + TP_ARGS(fs_info, block_group, start, len) |
| 269 | ) |
| 270 | |
| 271 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster, |
| 272 | |
| 273 | - TP_PROTO(const struct btrfs_fs_info *info, |
| 274 | + TP_PROTO(const struct btrfs_fs_info *fs_info, |
| 275 | const struct btrfs_block_group_cache *block_group, u64 start, |
| 276 | u64 len), |
| 277 | |
| 278 | - TP_ARGS(info, block_group, start, len) |
| 279 | + TP_ARGS(fs_info, block_group, start, len) |
| 280 | ) |
| 281 | |
| 282 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) |
| 283 | @@ -1445,13 +1451,13 @@ LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, |
| 284 | |
| 285 | btrfs_find_free_extent, |
| 286 | |
| 287 | - TP_PROTO(struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size, |
| 288 | + TP_PROTO(struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size, |
| 289 | u64 data), |
| 290 | |
| 291 | - TP_ARGS(info, num_bytes, empty_size, data), |
| 292 | + TP_ARGS(fs_info, num_bytes, empty_size, data), |
| 293 | |
| 294 | TP_FIELDS( |
| 295 | - ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE) |
| 296 | + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) |
| 297 | ctf_integer(u64, num_bytes, num_bytes) |
| 298 | ctf_integer(u64, empty_size, empty_size) |
| 299 | ctf_integer(u64, data, data) |
| 300 | @@ -1460,11 +1466,11 @@ LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, |
| 301 | |
| 302 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, |
| 303 | |
| 304 | - TP_PROTO(struct btrfs_fs_info *info, |
| 305 | + TP_PROTO(struct btrfs_fs_info *fs_info, |
| 306 | struct btrfs_block_group_cache *block_group, u64 start, |
| 307 | u64 len), |
| 308 | |
| 309 | - TP_ARGS(info, block_group, start, len), |
| 310 | + TP_ARGS(fs_info, block_group, start, len), |
| 311 | |
| 312 | TP_FIELDS( |
| 313 | ctf_integer(u64, bg_objectid, block_group->key.objectid) |
| 314 | @@ -1476,20 +1482,20 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, |
| 315 | |
| 316 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent, |
| 317 | |
| 318 | - TP_PROTO(struct btrfs_fs_info *info, |
| 319 | + TP_PROTO(struct btrfs_fs_info *fs_info, |
| 320 | struct btrfs_block_group_cache *block_group, u64 start, |
| 321 | u64 len), |
| 322 | |
| 323 | - TP_ARGS(info, block_group, start, len) |
| 324 | + TP_ARGS(fs_info, block_group, start, len) |
| 325 | ) |
| 326 | |
| 327 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster, |
| 328 | |
| 329 | - TP_PROTO(struct btrfs_fs_info *info, |
| 330 | + TP_PROTO(struct btrfs_fs_info *fs_info, |
| 331 | struct btrfs_block_group_cache *block_group, u64 start, |
| 332 | u64 len), |
| 333 | |
| 334 | - TP_ARGS(info, block_group, start, len) |
| 335 | + TP_ARGS(fs_info, block_group, start, len) |
| 336 | ) |
| 337 | #elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
| 338 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ |
| 339 | -- |
| 340 | 2.19.1 |
| 341 | |