summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/lttng/lttng-modules
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2023-03-18 11:32:02 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-03-22 23:17:27 +0000
commitf5c671e201e98f071a7e5e4cbd83af9751c34201 (patch)
treee18822e9c152fc4e19ac489531a4916b2f5b17e7 /meta/recipes-kernel/lttng/lttng-modules
parentfc363acc5be39897a130893d220cc3e93974b162 (diff)
downloadpoky-f5c671e201e98f071a7e5e4cbd83af9751c34201.tar.gz
lttng-modules: fix for v6.3+ kernels
As part of updating linux-yocto-dev to v6.3, lttng-modules needs to have four backported patches to adjust for the new kernel version. These are safe for inclusion in the upcoming release, as they are version protected and provide some future proofing for folks trying to use newer kernels than our released 6.1. (From OE-Core rev: e9f0070631b032a143b765874a228674c19d0304) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel/lttng/lttng-modules')
-rw-r--r--meta/recipes-kernel/lttng/lttng-modules/0001-fix-mm-introduce-vma-vm_flags-wrapper-functions-v6.3.patch82
-rw-r--r--meta/recipes-kernel/lttng/lttng-modules/0002-fix-uuid-Decouple-guid_t-and-uuid_le-types-and-respe.patch60
-rw-r--r--meta/recipes-kernel/lttng/lttng-modules/0003-fix-btrfs-pass-find_free_extent_ctl-to-allocator-tra.patch116
-rw-r--r--meta/recipes-kernel/lttng/lttng-modules/0004-fix-net-add-location-to-trace_consume_skb-v6.3.patch62
4 files changed, 320 insertions, 0 deletions
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0001-fix-mm-introduce-vma-vm_flags-wrapper-functions-v6.3.patch b/meta/recipes-kernel/lttng/lttng-modules/0001-fix-mm-introduce-vma-vm_flags-wrapper-functions-v6.3.patch
new file mode 100644
index 0000000000..976eecc3ab
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-modules/0001-fix-mm-introduce-vma-vm_flags-wrapper-functions-v6.3.patch
@@ -0,0 +1,82 @@
1From 939200ef160c95c8a9d71fd80c99f42a1de0a9f0 Mon Sep 17 00:00:00 2001
2From: Michael Jeanson <mjeanson@efficios.com>
3Date: Tue, 7 Mar 2023 11:41:14 -0500
4Subject: [PATCH 1/4] fix: mm: introduce vma->vm_flags wrapper functions (v6.3)
5
6See upstream commit :
7
8 commit bc292ab00f6c7a661a8a605c714e8a148f629ef6
9 Author: Suren Baghdasaryan <surenb@google.com>
10 Date: Thu Jan 26 11:37:47 2023 -0800
11
12 mm: introduce vma->vm_flags wrapper functions
13
14 vm_flags are among VMA attributes which affect decisions like VMA merging
15 and splitting. Therefore all vm_flags modifications are performed after
16 taking exclusive mmap_lock to prevent vm_flags updates racing with such
17 operations. Introduce modifier functions for vm_flags to be used whenever
18 flags are updated. This way we can better check and control correct
19 locking behavior during these updates.
20
21Upstream-Status: Backport
22
23Change-Id: I2cf662420d9d7748e5e310d3ea4bac98ba7d7f94
24Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
25Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
26---
27 include/wrapper/mm.h | 16 ++++++++++++++++
28 src/lib/ringbuffer/ring_buffer_mmap.c | 4 +++-
29 2 files changed, 19 insertions(+), 1 deletion(-)
30
31diff --git a/include/wrapper/mm.h b/include/wrapper/mm.h
32index d3bdda66..61ac8127 100644
33--- a/include/wrapper/mm.h
34+++ b/include/wrapper/mm.h
35@@ -13,6 +13,22 @@
36
37 #include <lttng/kernel-version.h>
38
39+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,3,0))
40+static inline
41+void wrapper_vm_flags_set(struct vm_area_struct *vma,
42+ vm_flags_t flags)
43+{
44+ vm_flags_set(vma, flags);
45+}
46+#else
47+static inline
48+void wrapper_vm_flags_set(struct vm_area_struct *vma,
49+ vm_flags_t flags)
50+{
51+ vma->vm_flags |= flags;
52+}
53+#endif
54+
55 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,6,0) \
56 || LTTNG_UBUNTU_KERNEL_RANGE(4,4,25,44, 4,5,0,0))
57
58diff --git a/src/lib/ringbuffer/ring_buffer_mmap.c b/src/lib/ringbuffer/ring_buffer_mmap.c
59index 25e2d8d5..d24b76a3 100644
60--- a/src/lib/ringbuffer/ring_buffer_mmap.c
61+++ b/src/lib/ringbuffer/ring_buffer_mmap.c
62@@ -17,6 +17,8 @@
63 #include <ringbuffer/frontend.h>
64 #include <ringbuffer/vfs.h>
65
66+#include <wrapper/mm.h>
67+
68 /*
69 * fault() vm_op implementation for ring buffer file mapping.
70 */
71@@ -113,7 +115,7 @@ static int lib_ring_buffer_mmap_buf(struct lttng_kernel_ring_buffer *buf,
72 return -EINVAL;
73
74 vma->vm_ops = &lib_ring_buffer_mmap_ops;
75- vma->vm_flags |= VM_DONTEXPAND;
76+ wrapper_vm_flags_set(vma, VM_DONTEXPAND);
77 vma->vm_private_data = buf;
78
79 return 0;
80--
812.34.1
82
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0002-fix-uuid-Decouple-guid_t-and-uuid_le-types-and-respe.patch b/meta/recipes-kernel/lttng/lttng-modules/0002-fix-uuid-Decouple-guid_t-and-uuid_le-types-and-respe.patch
new file mode 100644
index 0000000000..00aa34ed9f
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-modules/0002-fix-uuid-Decouple-guid_t-and-uuid_le-types-and-respe.patch
@@ -0,0 +1,60 @@
1From b3756eaa49a3de2f388bc269b2928a0233358fea Mon Sep 17 00:00:00 2001
2From: Michael Jeanson <mjeanson@efficios.com>
3Date: Tue, 7 Mar 2023 12:05:00 -0500
4Subject: [PATCH 2/4] fix: uuid: Decouple guid_t and uuid_le types and
5 respective macros (v6.3)
6
7See upstream commit :
8
9 commit 5e6a51787fef20b849682d8c49ec9c2beed5c373
10 Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
11 Date: Tue Jan 24 15:38:38 2023 +0200
12
13 uuid: Decouple guid_t and uuid_le types and respective macros
14
15 The guid_t type and respective macros are being used internally only.
16 The uuid_le has its user outside the kernel. Decouple these types and
17 macros, and make guid_t completely internal type to the kernel.
18
19Upstream-Status: Backport
20
21Change-Id: I8644fd139b0630e9cf18886b84e33bffab1e5abd
22Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
23Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
24---
25 include/lttng/events-internal.h | 5 +++--
26 1 file changed, 3 insertions(+), 2 deletions(-)
27
28diff --git a/include/lttng/events-internal.h b/include/lttng/events-internal.h
29index e31e6abb..a91a659e 100644
30--- a/include/lttng/events-internal.h
31+++ b/include/lttng/events-internal.h
32@@ -9,6 +9,7 @@
33 #define _LTTNG_EVENTS_INTERNAL_H
34
35 #include <wrapper/compiler_attributes.h>
36+#include <wrapper/uuid.h>
37
38 #include <lttng/events.h>
39
40@@ -289,7 +290,7 @@ struct lttng_metadata_cache {
41 atomic_t producing; /* Metadata being produced (incomplete) */
42 struct kref refcount; /* Metadata cache usage */
43 struct list_head metadata_stream; /* Metadata stream list */
44- uuid_le uuid; /* Trace session unique ID (copy) */
45+ guid_t uuid; /* Trace session unique ID (copy) */
46 struct mutex lock; /* Produce/consume lock */
47 uint64_t version; /* Current version of the metadata */
48 };
49@@ -463,7 +464,7 @@ struct lttng_kernel_session_private {
50 struct list_head events; /* Event list head */
51 struct list_head list; /* Session list */
52 unsigned int free_chan_id; /* Next chan ID to allocate */
53- uuid_le uuid; /* Trace session unique ID */
54+ guid_t uuid; /* Trace session unique ID */
55 struct lttng_metadata_cache *metadata_cache;
56 unsigned int metadata_dumped:1,
57 tstate:1; /* Transient enable state */
58--
592.34.1
60
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0003-fix-btrfs-pass-find_free_extent_ctl-to-allocator-tra.patch b/meta/recipes-kernel/lttng/lttng-modules/0003-fix-btrfs-pass-find_free_extent_ctl-to-allocator-tra.patch
new file mode 100644
index 0000000000..8ecdccf609
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-modules/0003-fix-btrfs-pass-find_free_extent_ctl-to-allocator-tra.patch
@@ -0,0 +1,116 @@
1From d0eeda3f84ba1643831561a2488ca2e99e9472b1 Mon Sep 17 00:00:00 2001
2From: Michael Jeanson <mjeanson@efficios.com>
3Date: Tue, 7 Mar 2023 11:26:25 -0500
4Subject: [PATCH 3/4] fix: btrfs: pass find_free_extent_ctl to allocator
5 tracepoints (v6.3)
6
7See upstream commit :
8
9 commit cfc2de0fce015d4249c674ef9f5e0b4817ba5c53
10 Author: Boris Burkov <boris@bur.io>
11 Date: Thu Dec 15 16:06:31 2022 -0800
12
13 btrfs: pass find_free_extent_ctl to allocator tracepoints
14
15 The allocator tracepoints currently have a pile of values from ffe_ctl.
16 In modifying the allocator and adding more tracepoints, I found myself
17 adding to the already long argument list of the tracepoints. It makes it
18 a lot simpler to just send in the ffe_ctl itself.
19
20Upstream-Status: Backport
21
22Change-Id: Iab4132a9d3df3a6369591a50fb75374b1e399fa4
23Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
24Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
25---
26 include/instrumentation/events/btrfs.h | 60 +++++++++++++++++++++++++-
27 1 file changed, 58 insertions(+), 2 deletions(-)
28
29diff --git a/include/instrumentation/events/btrfs.h b/include/instrumentation/events/btrfs.h
30index 01157107..7c7b9b0c 100644
31--- a/include/instrumentation/events/btrfs.h
32+++ b/include/instrumentation/events/btrfs.h
33@@ -13,6 +13,10 @@
34 #include <../fs/btrfs/accessors.h>
35 #endif
36
37+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,3,0))
38+#include <../fs/btrfs/extent-tree.h>
39+#endif
40+
41 #ifndef _TRACE_BTRFS_DEF_
42 #define _TRACE_BTRFS_DEF_
43 struct btrfs_root;
44@@ -1963,7 +1967,26 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_f
45
46 #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */
47
48-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,10,0) || \
49+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,3,0))
50+LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
51+
52+ btrfs_find_free_extent,
53+
54+ TP_PROTO(const struct btrfs_root *root,
55+ const struct find_free_extent_ctl *ffe_ctl),
56+
57+ TP_ARGS(root, ffe_ctl),
58+
59+ TP_FIELDS(
60+ ctf_array(u8, fsid, root->lttng_fs_info_fsid, BTRFS_UUID_SIZE)
61+ ctf_integer(u64, root_objectid, root->root_key.objectid)
62+ ctf_integer(u64, num_bytes, ffe_ctl->num_bytes)
63+ ctf_integer(u64, empty_size, ffe_ctl->empty_size)
64+ ctf_integer(u64, flags, ffe_ctl->flags)
65+ )
66+)
67+
68+#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,10,0) || \
69 LTTNG_KERNEL_RANGE(5,9,5, 5,10,0) || \
70 LTTNG_KERNEL_RANGE(5,4,78, 5,5,0) || \
71 LTTNG_UBUNTU_KERNEL_RANGE(5,8,18,44, 5,9,0,0))
72@@ -2102,7 +2125,40 @@ LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
73 )
74 #endif
75
76-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,5,0))
77+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,3,0))
78+LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
79+
80+ TP_PROTO(const struct btrfs_block_group *block_group,
81+ const struct find_free_extent_ctl *ffe_ctl),
82+
83+ TP_ARGS(block_group, ffe_ctl),
84+
85+ TP_FIELDS(
86+ ctf_array(u8, fsid, block_group->lttng_fs_info_fsid, BTRFS_UUID_SIZE)
87+ ctf_integer(u64, bg_objectid, block_group->start)
88+ ctf_integer(u64, flags, block_group->flags)
89+ ctf_integer(u64, start, ffe_ctl->search_start)
90+ ctf_integer(u64, len, ffe_ctl->num_bytes)
91+ )
92+)
93+
94+LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent,
95+
96+ TP_PROTO(const struct btrfs_block_group *block_group,
97+ const struct find_free_extent_ctl *ffe_ctl),
98+
99+ TP_ARGS(block_group, ffe_ctl)
100+)
101+
102+LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
103+
104+ TP_PROTO(const struct btrfs_block_group *block_group,
105+ const struct find_free_extent_ctl *ffe_ctl),
106+
107+ TP_ARGS(block_group, ffe_ctl)
108+)
109+
110+#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,5,0))
111 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
112
113 TP_PROTO(const struct btrfs_block_group *block_group, u64 start,
114--
1152.34.1
116
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0004-fix-net-add-location-to-trace_consume_skb-v6.3.patch b/meta/recipes-kernel/lttng/lttng-modules/0004-fix-net-add-location-to-trace_consume_skb-v6.3.patch
new file mode 100644
index 0000000000..59d96dc22d
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-modules/0004-fix-net-add-location-to-trace_consume_skb-v6.3.patch
@@ -0,0 +1,62 @@
1From 12f43cab7daceff0c73c78276b5a5b9cc1d5056f Mon Sep 17 00:00:00 2001
2From: Michael Jeanson <mjeanson@efficios.com>
3Date: Tue, 7 Mar 2023 11:10:26 -0500
4Subject: [PATCH 4/4] fix: net: add location to trace_consume_skb() (v6.3)
5
6See upstream commit :
7
8 commit dd1b527831a3ed659afa01b672d8e1f7e6ca95a5
9 Author: Eric Dumazet <edumazet@google.com>
10 Date: Thu Feb 16 15:47:18 2023 +0000
11
12 net: add location to trace_consume_skb()
13
14 kfree_skb() includes the location, it makes sense
15 to add it to consume_skb() as well.
16
17Upstream-Status: Backport
18
19Change-Id: I8d871187d90e7fe113a63e209b00aebe0df475f3
20Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
21Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
22---
23 include/instrumentation/events/skb.h | 16 ++++++++++++++++
24 1 file changed, 16 insertions(+)
25
26diff --git a/include/instrumentation/events/skb.h b/include/instrumentation/events/skb.h
27index 186732ea..3c43f32d 100644
28--- a/include/instrumentation/events/skb.h
29+++ b/include/instrumentation/events/skb.h
30@@ -61,6 +61,21 @@ LTTNG_TRACEPOINT_EVENT_MAP(kfree_skb,
31 )
32 #endif
33
34+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,3,0))
35+LTTNG_TRACEPOINT_EVENT_MAP(consume_skb,
36+
37+ skb_consume,
38+
39+ TP_PROTO(struct sk_buff *skb, void *location),
40+
41+ TP_ARGS(skb, location),
42+
43+ TP_FIELDS(
44+ ctf_integer_hex(void *, skbaddr, skb)
45+ ctf_integer_hex(void *, location, location)
46+ )
47+)
48+#else
49 LTTNG_TRACEPOINT_EVENT_MAP(consume_skb,
50
51 skb_consume,
52@@ -73,6 +88,7 @@ LTTNG_TRACEPOINT_EVENT_MAP(consume_skb,
53 ctf_integer_hex(void *, skbaddr, skb)
54 )
55 )
56+#endif
57
58 LTTNG_TRACEPOINT_EVENT(skb_copy_datagram_iovec,
59
60--
612.34.1
62