fix: btrfs: tracepoints: output proper root owner for trace_find_free_extent() (v5.10)
[lttng-modules.git] / instrumentation / events / lttng-module / btrfs.h
index 1ad5fd274bd971c9b6469c3a20fd9f1e56c2b3d9..52fcfd0d5d27636be9af03cf4eb45e5d0a7c72be 100644 (file)
@@ -290,7 +290,26 @@ LTTNG_TRACEPOINT_EVENT(btrfs_get_extent,
 
 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0))
+LTTNG_TRACEPOINT_EVENT(btrfs_handle_em_exist,
+
+       TP_PROTO(const struct btrfs_fs_info *fs_info,
+               const struct extent_map *existing, const struct extent_map *map,
+               u64 start, u64 len),
+
+       TP_ARGS(fs_info, existing, map, start, len),
+
+       TP_FIELDS(
+               ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
+               ctf_integer(u64, e_start, existing->start)
+               ctf_integer(u64, e_len, existing->len)
+               ctf_integer(u64, map_start, map->start)
+               ctf_integer(u64, map_len, map->len)
+               ctf_integer(u64, start, start)
+               ctf_integer(u64, len, len)
+       )
+)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0))
 LTTNG_TRACEPOINT_EVENT(btrfs_handle_em_exist,
 
        TP_PROTO(struct btrfs_fs_info *fs_info,
@@ -327,7 +346,29 @@ LTTNG_TRACEPOINT_EVENT(btrfs_handle_em_exist,
 )
 #endif
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
+LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
+
+       TP_PROTO(const struct inode *inode,
+                const struct btrfs_ordered_extent *ordered),
+
+       TP_ARGS(inode, ordered),
+
+       TP_FIELDS(
+               ctf_integer(ino_t, ino, inode->i_ino)
+               ctf_integer(u64, file_offset, ordered->file_offset)
+               ctf_integer(u64, start, ordered->disk_bytenr)
+               ctf_integer(u64, len, ordered->num_bytes)
+               ctf_integer(u64, disk_len, ordered->disk_num_bytes)
+               ctf_integer(u64, bytes_left, ordered->bytes_left)
+               ctf_integer(unsigned long, flags, ordered->flags)
+               ctf_integer(int, compress_type, ordered->compress_type)
+               ctf_integer(int, refs, refcount_read(&ordered->refs))
+               ctf_integer(u64, root_objectid,
+                               BTRFS_I(inode)->root->root_key.objectid)
+       )
+)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
 
        TP_PROTO(const struct inode *inode,
@@ -1642,7 +1683,23 @@ LTTNG_TRACEPOINT_EVENT(btrfs_cow_block,
 )
 #endif
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0))
+LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation,
+
+       TP_PROTO(const struct btrfs_fs_info *fs_info, const char *type, u64 val,
+                u64 bytes, int reserve),
+
+       TP_ARGS(fs_info, type, val, bytes, reserve),
+
+       TP_FIELDS(
+               ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
+               ctf_string(type, type)
+               ctf_integer(u64, val, val)
+               ctf_integer(u64, bytes, bytes)
+               ctf_integer(int, reserve, reserve)
+       )
+)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
        LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
        LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
        LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
@@ -1799,7 +1856,67 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent,  btrfs_reserved_extent_f
 
 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0) || \
+       LTTNG_KERNEL_RANGE(5,9,6, 5,10,0) || \
+       LTTNG_KERNEL_RANGE(5,4,78, 5,5,0))
+LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
+
+       btrfs_find_free_extent,
+
+       TP_PROTO(const struct btrfs_root *root, u64 num_bytes, u64 empty_size,
+                u64 data),
+
+       TP_ARGS(root, num_bytes, empty_size, data),
+
+       TP_FIELDS(
+               ctf_array(u8, fsid, root->lttng_fs_info_fsid, BTRFS_UUID_SIZE)
+               ctf_integer(u64, root_objectid, root->root_key.objectid)
+               ctf_integer(u64, num_bytes, num_bytes)
+               ctf_integer(u64, empty_size, empty_size)
+               ctf_integer(u64, data, data)
+       )
+)
+
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0))
+
+LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
+
+       btrfs_find_free_extent,
+
+       TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size,
+                u64 data),
+
+       TP_ARGS(fs_info, num_bytes, empty_size, data),
+
+       TP_FIELDS(
+               ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
+               ctf_integer(u64, num_bytes, num_bytes)
+               ctf_integer(u64, empty_size, empty_size)
+               ctf_integer(u64, data, data)
+       )
+)
+
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0))
+
+LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
+
+       btrfs_find_free_extent,
+
+       TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size,
+                u64 data),
+
+       TP_ARGS(fs_info, num_bytes, empty_size, data),
+
+       TP_FIELDS(
+               ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
+               ctf_integer(u64, num_bytes, num_bytes)
+               ctf_integer(u64, empty_size, empty_size)
+               ctf_integer(u64, data, data)
+       )
+)
+
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
+
 LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
 
        btrfs_find_free_extent,
@@ -1817,6 +1934,67 @@ LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
        )
 )
 
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
+
+LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
+
+       btrfs_find_free_extent,
+
+       TP_PROTO(struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size,
+                u64 data),
+
+       TP_ARGS(fs_info, num_bytes, empty_size, data),
+
+       TP_FIELDS(
+               ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
+               ctf_integer(u64, num_bytes, num_bytes)
+               ctf_integer(u64, empty_size, empty_size)
+               ctf_integer(u64, data, data)
+       )
+)
+
+#elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
+       LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
+       LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
+       LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
+
+LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
+
+       btrfs_find_free_extent,
+
+       TP_PROTO(const struct btrfs_root *root, u64 num_bytes, u64 empty_size,
+                u64 data),
+
+       TP_ARGS(root, num_bytes, empty_size, data),
+
+       TP_FIELDS(
+               ctf_integer(u64, root_objectid, root->root_key.objectid)
+               ctf_integer(u64, num_bytes, num_bytes)
+               ctf_integer(u64, empty_size, empty_size)
+               ctf_integer(u64, data, data)
+       )
+)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
+
+LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
+
+       btrfs_find_free_extent,
+
+       TP_PROTO(struct btrfs_root *root, u64 num_bytes, u64 empty_size,
+                u64 data),
+
+       TP_ARGS(root, num_bytes, empty_size, data),
+
+       TP_FIELDS(
+               ctf_integer(u64, root_objectid, root->root_key.objectid)
+               ctf_integer(u64, num_bytes, num_bytes)
+               ctf_integer(u64, empty_size, empty_size)
+               ctf_integer(u64, data, data)
+       )
+)
+#endif
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0))
 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
 
        TP_PROTO(const struct btrfs_block_group *block_group, u64 start,
@@ -1850,22 +2028,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_clus
 )
 
 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0))
-LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
-
-       btrfs_find_free_extent,
-
-       TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size,
-                u64 data),
-
-       TP_ARGS(fs_info, num_bytes, empty_size, data),
-
-       TP_FIELDS(
-               ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
-               ctf_integer(u64, num_bytes, num_bytes)
-               ctf_integer(u64, empty_size, empty_size)
-               ctf_integer(u64, data, data)
-       )
-)
 
 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
 
@@ -1900,22 +2062,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_clus
 )
 
 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
-LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
-
-       btrfs_find_free_extent,
-
-       TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size,
-                u64 data),
-
-       TP_ARGS(fs_info, num_bytes, empty_size, data),
-
-       TP_FIELDS(
-               ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
-               ctf_integer(u64, num_bytes, num_bytes)
-               ctf_integer(u64, empty_size, empty_size)
-               ctf_integer(u64, data, data)
-       )
-)
 
 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
 
@@ -1954,23 +2100,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_clus
 
 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
 
-LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
-
-       btrfs_find_free_extent,
-
-       TP_PROTO(struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size,
-                u64 data),
-
-       TP_ARGS(fs_info, num_bytes, empty_size, data),
-
-       TP_FIELDS(
-               ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
-               ctf_integer(u64, num_bytes, num_bytes)
-               ctf_integer(u64, empty_size, empty_size)
-               ctf_integer(u64, data, data)
-       )
-)
-
 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
 
        TP_PROTO(struct btrfs_fs_info *fs_info,
@@ -2009,23 +2138,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_clus
        LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
        LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
 
-LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
-
-       btrfs_find_free_extent,
-
-       TP_PROTO(const struct btrfs_root *root, u64 num_bytes, u64 empty_size,
-                u64 data),
-
-       TP_ARGS(root, num_bytes, empty_size, data),
-
-       TP_FIELDS(
-               ctf_integer(u64, root_objectid, root->root_key.objectid)
-               ctf_integer(u64, num_bytes, num_bytes)
-               ctf_integer(u64, empty_size, empty_size)
-               ctf_integer(u64, data, data)
-       )
-)
-
 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
 
        TP_PROTO(const struct btrfs_root *root,
@@ -2063,23 +2175,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_clus
 
 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
 
-LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
-
-       btrfs_find_free_extent,
-
-       TP_PROTO(struct btrfs_root *root, u64 num_bytes, u64 empty_size,
-                u64 data),
-
-       TP_ARGS(root, num_bytes, empty_size, data),
-
-       TP_FIELDS(
-               ctf_integer(u64, root_objectid, root->root_key.objectid)
-               ctf_integer(u64, num_bytes, num_bytes)
-               ctf_integer(u64, empty_size, empty_size)
-               ctf_integer(u64, data, data)
-       )
-)
-
 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
 
        TP_PROTO(struct btrfs_root *root,
This page took 0.027369 seconds and 4 git commands to generate.