- TP_STRUCT__entry(
- __field( u64, bytenr )
- __field( u64, num_bytes )
- __field( int, action )
- __field( int, is_data )
- ),
-
- TP_fast_assign(
- tp_assign(bytenr, ref->bytenr)
- tp_assign(num_bytes, ref->num_bytes)
- tp_assign(action, action)
- tp_assign(is_data, head_ref->is_data)
- ),
-
- TP_printk("bytenr = %llu, num_bytes = %llu, action = %s, is_data = %d",
- (unsigned long long)__entry->bytenr,
- (unsigned long long)__entry->num_bytes,
- show_ref_action(__entry->action),
- __entry->is_data)
-)
-
-#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"})
-
-DECLARE_EVENT_CLASS(btrfs__chunk,
+ TP_FIELDS(
+ ctf_integer(u64, bytenr, ref->bytenr)
+ ctf_integer(u64, num_bytes, ref->num_bytes)
+ ctf_integer(int, action, action)
+ ctf_integer(int, is_data, head_ref->is_data)
+ )
+)
+
+LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, add_delayed_ref_head,
+
+ TP_PROTO(struct btrfs_delayed_ref_node *ref,
+ struct btrfs_delayed_ref_head *head_ref,
+ int action),
+
+ TP_ARGS(ref, head_ref, action)
+)
+
+LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, run_delayed_ref_head,
+
+ TP_PROTO(struct btrfs_delayed_ref_node *ref,
+ struct btrfs_delayed_ref_head *head_ref,
+ int action),
+
+ TP_ARGS(ref, head_ref, action)
+)
+
+#else
+LTTNG_TRACEPOINT_EVENT(btrfs_delayed_ref_head,
+
+ TP_PROTO(struct btrfs_delayed_ref_node *ref,
+ struct btrfs_delayed_ref_head *head_ref,
+ int action),
+
+ TP_ARGS(ref, head_ref, action),
+
+ TP_FIELDS(
+ ctf_integer(u64, bytenr, ref->bytenr)
+ ctf_integer(u64, num_bytes, ref->num_bytes)
+ ctf_integer(int, action, action)
+ ctf_integer(int, is_data, head_ref->is_data)
+ )
+)
+#endif
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
+
+LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk,
+
+ TP_PROTO(const struct btrfs_fs_info *fs_info, const struct map_lookup *map,
+ u64 offset, u64 size),
+
+ TP_ARGS(fs_info, map, offset, size),
+
+ TP_FIELDS(
+ ctf_integer(int, num_stripes, map->num_stripes)
+ ctf_integer(u64, type, map->type)
+ ctf_integer(int, sub_stripes, map->sub_stripes)
+ ctf_integer(u64, offset, offset)
+ ctf_integer(u64, size, size)
+ ctf_integer(u64, root_objectid, fs_info->chunk_root->root_key.objectid)
+ )
+)
+
+LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc,
+
+ TP_PROTO(const struct btrfs_fs_info *info, const struct map_lookup *map,
+ u64 offset, u64 size),
+
+ TP_ARGS(info, map, offset, size)
+)
+
+LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free,
+
+ TP_PROTO(const struct btrfs_fs_info *info, const struct map_lookup *map,
+ u64 offset, u64 size),
+
+ TP_ARGS(info, map, offset, size)
+)
+
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
+
+LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk,
+
+ TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map,
+ u64 offset, u64 size),
+
+ TP_ARGS(fs_info, map, offset, size),
+
+ TP_FIELDS(
+ ctf_integer(int, num_stripes, map->num_stripes)
+ ctf_integer(u64, type, map->type)
+ ctf_integer(int, sub_stripes, map->sub_stripes)
+ ctf_integer(u64, offset, offset)
+ ctf_integer(u64, size, size)
+ ctf_integer(u64, root_objectid, fs_info->chunk_root->root_key.objectid)
+ )
+)
+
+LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc,
+
+ TP_PROTO(struct btrfs_fs_info *info, struct map_lookup *map,
+ u64 offset, u64 size),
+
+ TP_ARGS(info, map, offset, size)
+)
+
+LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free,
+
+ TP_PROTO(struct btrfs_fs_info *info, struct map_lookup *map,
+ u64 offset, u64 size),
+
+ TP_ARGS(info, map, offset, size)
+)
+
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
+
+LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk,