diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-12-16 13:51:06 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-12-17 11:41:53 +0000 |
commit | 1ceff800a5aac5493413c9d21c113219c38807a8 (patch) | |
tree | 2c84af1d63f19cc0ccfec6ed44a59a3cbe6e8101 | |
parent | 4a2924a8d62d4225787388c6d4cabb4b03e142a7 (diff) | |
download | poky-1ceff800a5aac5493413c9d21c113219c38807a8.tar.gz |
lttng-modules: Upgrade 2.13.15 -> 2.13.16
Drop two patches merged upstream.
(From OE-Core rev: 1bc656bac3bccbedde407a52969dfdca7f5a3c2b)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-kernel/lttng/lttng-modules/0001-Fix-uprobes-make-uprobe_register-return-struct-uprob.patch | 160 | ||||
-rw-r--r-- | meta/recipes-kernel/lttng/lttng-modules/0001-fix-writeback-Refine-the-show_inode_state-macro-defi.patch | 68 | ||||
-rw-r--r-- | meta/recipes-kernel/lttng/lttng-modules_2.13.16.bb (renamed from meta/recipes-kernel/lttng/lttng-modules_2.13.15.bb) | 4 |
3 files changed, 1 insertions, 231 deletions
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0001-Fix-uprobes-make-uprobe_register-return-struct-uprob.patch b/meta/recipes-kernel/lttng/lttng-modules/0001-Fix-uprobes-make-uprobe_register-return-struct-uprob.patch deleted file mode 100644 index 052220e7ff..0000000000 --- a/meta/recipes-kernel/lttng/lttng-modules/0001-Fix-uprobes-make-uprobe_register-return-struct-uprob.patch +++ /dev/null | |||
@@ -1,160 +0,0 @@ | |||
1 | From 9b96303d2382c767eb1f507d934bcc3fe225d74c Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Jeanson <mjeanson@efficios.com> | ||
3 | Date: Thu, 17 Oct 2024 11:56:02 -0400 | ||
4 | Subject: [PATCH] Fix: uprobes: make uprobe_register() return struct uprobe * | ||
5 | (v6.12) | ||
6 | |||
7 | See upstream commits : | ||
8 | |||
9 | commit 3c83a9ad0295eb63bdeb81d821b8c3b9417fbcac | ||
10 | Author: Oleg Nesterov <oleg@redhat.com> | ||
11 | Date: Thu Aug 1 15:27:34 2024 +0200 | ||
12 | |||
13 | uprobes: make uprobe_register() return struct uprobe * | ||
14 | |||
15 | This way uprobe_unregister() and uprobe_apply() can use "struct uprobe *" | ||
16 | rather than inode + offset. This simplifies the code and allows to avoid | ||
17 | the unnecessary find_uprobe() + put_uprobe() in these functions. | ||
18 | |||
19 | TODO: uprobe_unregister() still needs get_uprobe/put_uprobe to ensure that | ||
20 | this uprobe can't be freed before up_write(&uprobe->register_rwsem). | ||
21 | |||
22 | commit 04b01625da130c7521b768996cd5e48052198b97 | ||
23 | Author: Peter Zijlstra <peterz@infradead.org> | ||
24 | Date: Tue Sep 3 10:46:00 2024 -0700 | ||
25 | |||
26 | perf/uprobe: split uprobe_unregister() | ||
27 | |||
28 | With uprobe_unregister() having grown a synchronize_srcu(), it becomes | ||
29 | fairly slow to call. Esp. since both users of this API call it in a | ||
30 | loop. | ||
31 | |||
32 | Peel off the sync_srcu() and do it once, after the loop. | ||
33 | |||
34 | We also need to add uprobe_unregister_sync() into uprobe_register()'s | ||
35 | error handling path, as we need to be careful about returning to the | ||
36 | caller before we have a guarantee that partially attached consumer won't | ||
37 | be called anymore. This is an unlikely slow path and this should be | ||
38 | totally fine to be slow in the case of a failed attach. | ||
39 | |||
40 | commit e04332ebc8ac128fa551e83f1161ab1c094d13a9 | ||
41 | Author: Oleg Nesterov <oleg@redhat.com> | ||
42 | Date: Thu Aug 1 15:27:28 2024 +0200 | ||
43 | |||
44 | uprobes: kill uprobe_register_refctr() | ||
45 | |||
46 | It doesn't make any sense to have 2 versions of _register(). Note that | ||
47 | trace_uprobe_enable(), the only user of uprobe_register(), doesn't need | ||
48 | to check tu->ref_ctr_offset to decide which one should be used, it could | ||
49 | safely pass ref_ctr_offset == 0 to uprobe_register_refctr(). | ||
50 | |||
51 | Add this argument to uprobe_register(), update the callers, and kill | ||
52 | uprobe_register_refctr(). | ||
53 | |||
54 | Upstream-Status: Backport [commit 9b96303d] | ||
55 | |||
56 | Change-Id: I8d1f9a5db1f19c2bc2029709ae36f82e86f6fe58 | ||
57 | Signed-off-by: Michael Jeanson <mjeanson@efficios.com> | ||
58 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
59 | --- | ||
60 | include/lttng/events-internal.h | 1 + | ||
61 | include/wrapper/uprobes.h | 7 ++++++- | ||
62 | src/probes/lttng-uprobes.c | 32 ++++++++++++++++++++++++++++++++ | ||
63 | 3 files changed, 39 insertions(+), 1 deletion(-) | ||
64 | |||
65 | diff --git a/include/lttng/events-internal.h b/include/lttng/events-internal.h | ||
66 | index a91a659e..8633608d 100644 | ||
67 | --- a/include/lttng/events-internal.h | ||
68 | +++ b/include/lttng/events-internal.h | ||
69 | @@ -42,6 +42,7 @@ struct lttng_krp; /* Kretprobe handling */ | ||
70 | struct lttng_uprobe_handler { | ||
71 | struct lttng_kernel_event_common *event; | ||
72 | loff_t offset; | ||
73 | + struct uprobe *uprobe; | ||
74 | struct uprobe_consumer up_consumer; | ||
75 | struct list_head node; | ||
76 | }; | ||
77 | diff --git a/include/wrapper/uprobes.h b/include/wrapper/uprobes.h | ||
78 | index 9cbbe3b2..52b72d53 100644 | ||
79 | --- a/include/wrapper/uprobes.h | ||
80 | +++ b/include/wrapper/uprobes.h | ||
81 | @@ -18,9 +18,14 @@ | ||
82 | |||
83 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,5,0)) | ||
84 | #include <linux/uprobes.h> | ||
85 | +/* | ||
86 | + * No wrappers for >= 6.12, the API has changed too much, the version checks | ||
87 | + * are inlined in 'src/probes/lttng-uprobes.c'. | ||
88 | + */ | ||
89 | +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,12,0)) | ||
90 | |||
91 | /* Use kallsym lookup for version before 3.9. */ | ||
92 | -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0)) | ||
93 | +#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0)) | ||
94 | |||
95 | static inline | ||
96 | int wrapper_uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc) | ||
97 | diff --git a/src/probes/lttng-uprobes.c b/src/probes/lttng-uprobes.c | ||
98 | index f70218be..5be83cdb 100644 | ||
99 | --- a/src/probes/lttng-uprobes.c | ||
100 | +++ b/src/probes/lttng-uprobes.c | ||
101 | @@ -233,8 +233,16 @@ int lttng_uprobes_add_callsite(struct lttng_uprobe *uprobe, | ||
102 | goto register_error; | ||
103 | } | ||
104 | |||
105 | +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,12,0)) | ||
106 | + ret = 0; | ||
107 | + uprobe_handler->uprobe = uprobe_register(uprobe->inode, | ||
108 | + uprobe_handler->offset, 0, &uprobe_handler->up_consumer); | ||
109 | + if (IS_ERR(uprobe_handler->uprobe)) | ||
110 | + ret = -1; | ||
111 | +#else | ||
112 | ret = wrapper_uprobe_register(uprobe->inode, | ||
113 | uprobe_handler->offset, &uprobe_handler->up_consumer); | ||
114 | +#endif | ||
115 | if (ret) { | ||
116 | printk(KERN_WARNING "LTTng: Error registering probe on inode %lu " | ||
117 | "and offset 0x%llx\n", uprobe->inode->i_ino, | ||
118 | @@ -330,15 +338,39 @@ void lttng_uprobes_unregister(struct inode *inode, struct list_head *head) | ||
119 | { | ||
120 | struct lttng_uprobe_handler *iter, *tmp; | ||
121 | |||
122 | +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,12,0)) | ||
123 | + /* | ||
124 | + * Iterate over the list of handler, unregister each uprobe. | ||
125 | + */ | ||
126 | + list_for_each_entry(iter, head, node) { | ||
127 | + uprobe_unregister_nosync(iter->uprobe, &iter->up_consumer); | ||
128 | + iter->uprobe = NULL; | ||
129 | + } | ||
130 | + | ||
131 | + /* | ||
132 | + * Call synchronize_srcu() on uprobes_srcu. | ||
133 | + */ | ||
134 | + uprobe_unregister_sync(); | ||
135 | + | ||
136 | /* | ||
137 | * Iterate over the list of handler, remove each handler from the list | ||
138 | * and free the struct. | ||
139 | */ | ||
140 | + list_for_each_entry_safe(iter, tmp, head, node) { | ||
141 | + list_del(&iter->node); | ||
142 | + kfree(iter); | ||
143 | + } | ||
144 | +#else | ||
145 | + /* | ||
146 | + * Iterate over the list of handler, unregister each uprobe, remove | ||
147 | + * each handler from the list and free the struct. | ||
148 | + */ | ||
149 | list_for_each_entry_safe(iter, tmp, head, node) { | ||
150 | wrapper_uprobe_unregister(inode, iter->offset, &iter->up_consumer); | ||
151 | list_del(&iter->node); | ||
152 | kfree(iter); | ||
153 | } | ||
154 | +#endif | ||
155 | } | ||
156 | |||
157 | void lttng_uprobes_unregister_event(struct lttng_kernel_event_recorder *event_recorder) | ||
158 | -- | ||
159 | 2.39.2 | ||
160 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0001-fix-writeback-Refine-the-show_inode_state-macro-defi.patch b/meta/recipes-kernel/lttng/lttng-modules/0001-fix-writeback-Refine-the-show_inode_state-macro-defi.patch deleted file mode 100644 index 39b68eeeb2..0000000000 --- a/meta/recipes-kernel/lttng/lttng-modules/0001-fix-writeback-Refine-the-show_inode_state-macro-defi.patch +++ /dev/null | |||
@@ -1,68 +0,0 @@ | |||
1 | From 4610de285daf887262a58683d8597668de62e676 Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Jeanson <mjeanson@efficios.com> | ||
3 | Date: Thu, 17 Oct 2024 16:59:07 -0400 | ||
4 | Subject: [PATCH] fix: writeback: Refine the show_inode_state() macro | ||
5 | definition (v6.12) | ||
6 | MIME-Version: 1.0 | ||
7 | Content-Type: text/plain; charset=UTF-8 | ||
8 | Content-Transfer-Encoding: 8bit | ||
9 | |||
10 | See upstream commit : | ||
11 | |||
12 | commit 459ca85ae1feff78d1518344df88bb79a092780c | ||
13 | Author: Julian Sun <sunjunchao2870@gmail.com> | ||
14 | Date: Wed Aug 28 16:13:59 2024 +0800 | ||
15 | |||
16 | writeback: Refine the show_inode_state() macro definition | ||
17 | |||
18 | Currently, the show_inode_state() macro only prints | ||
19 | part of the state of inode->i_state. Let’s improve it | ||
20 | to display more of its state. | ||
21 | |||
22 | Upstream-Status: Backport [commit 4610de285daf887262a58] | ||
23 | |||
24 | Change-Id: Idaebd56f5775205f8a5c76e117c5ab65f7f1754b | ||
25 | Signed-off-by: Michael Jeanson <mjeanson@efficios.com> | ||
26 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
27 | --- | ||
28 | include/instrumentation/events/writeback.h | 24 +++++++++++++++++++++- | ||
29 | 1 file changed, 23 insertions(+), 1 deletion(-) | ||
30 | |||
31 | diff --git a/include/instrumentation/events/writeback.h b/include/instrumentation/events/writeback.h | ||
32 | index c4510b44..cad01994 100644 | ||
33 | --- a/include/instrumentation/events/writeback.h | ||
34 | +++ b/include/instrumentation/events/writeback.h | ||
35 | @@ -71,7 +71,29 @@ static inline struct backing_dev_info *lttng_inode_to_bdi(struct inode *inode) | ||
36 | * changed by an upstream kernel, the fact that we have a redefinition here | ||
37 | * will generate a compiler warning. | ||
38 | */ | ||
39 | -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,9,0) || \ | ||
40 | +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,12,0)) | ||
41 | +#define show_inode_state(state) \ | ||
42 | + __print_flags(state, "|", \ | ||
43 | + {I_DIRTY_SYNC, "I_DIRTY_SYNC"}, \ | ||
44 | + {I_DIRTY_DATASYNC, "I_DIRTY_DATASYNC"}, \ | ||
45 | + {I_DIRTY_PAGES, "I_DIRTY_PAGES"}, \ | ||
46 | + {I_NEW, "I_NEW"}, \ | ||
47 | + {I_WILL_FREE, "I_WILL_FREE"}, \ | ||
48 | + {I_FREEING, "I_FREEING"}, \ | ||
49 | + {I_CLEAR, "I_CLEAR"}, \ | ||
50 | + {I_SYNC, "I_SYNC"}, \ | ||
51 | + {I_DIRTY_TIME, "I_DIRTY_TIME"}, \ | ||
52 | + {I_REFERENCED, "I_REFERENCED"}, \ | ||
53 | + {I_LINKABLE, "I_LINKABLE"}, \ | ||
54 | + {I_WB_SWITCH, "I_WB_SWITCH"}, \ | ||
55 | + {I_OVL_INUSE, "I_OVL_INUSE"}, \ | ||
56 | + {I_CREATING, "I_CREATING"}, \ | ||
57 | + {I_DONTCACHE, "I_DONTCACHE"}, \ | ||
58 | + {I_SYNC_QUEUED, "I_SYNC_QUEUED"}, \ | ||
59 | + {I_PINNING_NETFS_WB, "I_PINNING_NETFS_WB"}, \ | ||
60 | + {I_LRU_ISOLATING, "I_LRU_ISOLATING"} \ | ||
61 | + ) | ||
62 | +#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,9,0) || \ | ||
63 | LTTNG_KERNEL_RANGE(4,14,218, 4,15,0) || \ | ||
64 | LTTNG_KERNEL_RANGE(4,19,172, 4,20,0) || \ | ||
65 | LTTNG_KERNEL_RANGE(5,4,94, 5,5,0) || \ | ||
66 | -- | ||
67 | 2.39.2 | ||
68 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-modules_2.13.15.bb b/meta/recipes-kernel/lttng/lttng-modules_2.13.16.bb index e05a2c9572..feba35fd2d 100644 --- a/meta/recipes-kernel/lttng/lttng-modules_2.13.15.bb +++ b/meta/recipes-kernel/lttng/lttng-modules_2.13.16.bb | |||
@@ -10,14 +10,12 @@ inherit module | |||
10 | include lttng-platforms.inc | 10 | include lttng-platforms.inc |
11 | 11 | ||
12 | SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2 \ | 12 | SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2 \ |
13 | file://0001-fix-writeback-Refine-the-show_inode_state-macro-defi.patch \ | ||
14 | file://0001-Fix-uprobes-make-uprobe_register-return-struct-uprob.patch \ | ||
15 | " | 13 | " |
16 | 14 | ||
17 | # Use :append here so that the patch is applied also when using devupstream | 15 | # Use :append here so that the patch is applied also when using devupstream |
18 | SRC_URI:append = " file://0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch" | 16 | SRC_URI:append = " file://0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch" |
19 | 17 | ||
20 | SRC_URI[sha256sum] = "6692554eca50e9d22e71b7c2ee6c7db89d393268d404261212af37c5247c0729" | 18 | SRC_URI[sha256sum] = "6694414a3701fcd6e05b3cb20cfecae3b46b3dfb9e5361b344851c1f8052e854" |
21 | 19 | ||
22 | export INSTALL_MOD_DIR="kernel/lttng-modules" | 20 | export INSTALL_MOD_DIR="kernel/lttng-modules" |
23 | 21 | ||