1 From c8f96e7716404549b19b9a774f5d9987325608bc Mon Sep 17 00:00:00 2001
2 From: Michael Jeanson <mjeanson@efficios.com>
3 Date: Wed, 26 Jan 2022 14:37:52 -0500
4 Subject: [PATCH 4/7] fix: btrfs: pass fs_info to
5 trace_btrfs_transaction_commit (v5.17)
9 commit 2e4e97abac4c95f8b87b2912ea013f7836a6f10b
10 Author: Josef Bacik <josef@toxicpanda.com>
11 Date: Fri Nov 5 16:45:29 2021 -0400
13 btrfs: pass fs_info to trace_btrfs_transaction_commit
15 The root on the trans->root can be anything, and generally we're
16 committing from the transaction kthread so it's usually the tree_root.
17 Change this to just take an fs_info, and to maintain compatibility
18 simply put the ROOT_TREE_OBJECTID as the root objectid for the
19 tracepoint. This will allow use to remove trans->root.
22 Upstream-Status: Backport [lttng-modules commit c8f96e7716404549b19b9a774f5d9987325608bc]
24 Change-Id: Ie5a4804330edabffac0714fcb9c25b8c8599e424
25 Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
26 Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
28 include/instrumentation/events/btrfs.h | 44 ++++++++++++++++++--------
29 1 file changed, 31 insertions(+), 13 deletions(-)
31 diff --git a/include/instrumentation/events/btrfs.h b/include/instrumentation/events/btrfs.h
32 index 0a0e085a..785f16ac 100644
33 --- a/include/instrumentation/events/btrfs.h
34 +++ b/include/instrumentation/events/btrfs.h
35 @@ -43,7 +43,19 @@ struct extent_state;
36 #define lttng_fs_info_fsid fs_info->fsid
39 -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0) || \
40 +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0))
41 +LTTNG_TRACEPOINT_EVENT(btrfs_transaction_commit,
43 + TP_PROTO(const struct btrfs_fs_info *fs_info),
48 + ctf_integer(u64, generation, fs_info->generation)
49 + ctf_integer(u64, root_objectid, BTRFS_ROOT_TREE_OBJECTID)
52 +#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0) || \
53 LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
54 LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
55 LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
56 @@ -59,7 +71,25 @@ LTTNG_TRACEPOINT_EVENT(btrfs_transaction_commit,
57 ctf_integer(u64, root_objectid, root->root_key.objectid)
61 +LTTNG_TRACEPOINT_EVENT(btrfs_transaction_commit,
63 + TP_PROTO(struct btrfs_root *root),
68 + ctf_integer(u64, generation, root->fs_info->generation)
69 + ctf_integer(u64, root_objectid, root->root_key.objectid)
74 +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0) || \
75 + LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
76 + LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
77 + LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
78 + LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
79 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__inode,
81 TP_PROTO(const struct inode *inode),
82 @@ -99,18 +129,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_evict,
86 -LTTNG_TRACEPOINT_EVENT(btrfs_transaction_commit,
88 - TP_PROTO(struct btrfs_root *root),
93 - ctf_integer(u64, generation, root->fs_info->generation)
94 - ctf_integer(u64, root_objectid, root->root_key.objectid)
98 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__inode,
100 TP_PROTO(struct inode *inode),