diff options
author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2022-06-30 15:16:55 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-07-04 22:51:49 +0100 |
commit | 04467fb51c6816e7373e0bbbe983a97972c6312f (patch) | |
tree | bb2a5a8004d98b8a80e32def58a9c88889c4db3a /meta/recipes-kernel/lttng/lttng-modules | |
parent | 41c0922c2a6e740e6640d7bd5742beab77dadcc9 (diff) | |
download | poky-04467fb51c6816e7373e0bbbe983a97972c6312f.tar.gz |
lttng-modules: fix 5.19+ build
We need to backport three patches from the lttng upstream tree to
fix the build against 5.19+.
Obviously we'll drop these once the next lttng-modules release is
available.
(From OE-Core rev: dce3c772efab4e51a82fb9c8fb74bc614ee3a82e)
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel/lttng/lttng-modules')
3 files changed, 306 insertions, 0 deletions
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0001-fix-mm-page_alloc-fix-tracepoint-mm_page_alloc_zone_.patch b/meta/recipes-kernel/lttng/lttng-modules/0001-fix-mm-page_alloc-fix-tracepoint-mm_page_alloc_zone_.patch new file mode 100644 index 0000000000..62376806c8 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0001-fix-mm-page_alloc-fix-tracepoint-mm_page_alloc_zone_.patch | |||
@@ -0,0 +1,106 @@ | |||
1 | From 8d5da4d2a3d7d9173208f4e8dc7a709f0bfc9820 Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Jeanson <mjeanson@efficios.com> | ||
3 | Date: Wed, 8 Jun 2022 12:56:36 -0400 | ||
4 | Subject: [PATCH 1/3] fix: mm/page_alloc: fix tracepoint | ||
5 | mm_page_alloc_zone_locked() (v5.19) | ||
6 | |||
7 | See upstream commit : | ||
8 | |||
9 | commit 10e0f7530205799e7e971aba699a7cb3a47456de | ||
10 | Author: Wonhyuk Yang <vvghjk1234@gmail.com> | ||
11 | Date: Thu May 19 14:08:54 2022 -0700 | ||
12 | |||
13 | mm/page_alloc: fix tracepoint mm_page_alloc_zone_locked() | ||
14 | |||
15 | Currently, trace point mm_page_alloc_zone_locked() doesn't show correct | ||
16 | information. | ||
17 | |||
18 | First, when alloc_flag has ALLOC_HARDER/ALLOC_CMA, page can be allocated | ||
19 | from MIGRATE_HIGHATOMIC/MIGRATE_CMA. Nevertheless, tracepoint use | ||
20 | requested migration type not MIGRATE_HIGHATOMIC and MIGRATE_CMA. | ||
21 | |||
22 | Second, after commit 44042b4498728 ("mm/page_alloc: allow high-order pages | ||
23 | to be stored on the per-cpu lists") percpu-list can store high order | ||
24 | pages. But trace point determine whether it is a refiil of percpu-list by | ||
25 | comparing requested order and 0. | ||
26 | |||
27 | To handle these problems, make mm_page_alloc_zone_locked() only be called | ||
28 | by __rmqueue_smallest with correct migration type. With a new argument | ||
29 | called percpu_refill, it can show roughly whether it is a refill of | ||
30 | percpu-list. | ||
31 | |||
32 | Upstream-Status: Backport | ||
33 | |||
34 | Change-Id: I2e4a57393757f12b9c5a4566c4d1102ee2474a09 | ||
35 | Signed-off-by: Michael Jeanson <mjeanson@efficios.com> | ||
36 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
37 | --- | ||
38 | include/instrumentation/events/kmem.h | 45 +++++++++++++++++++++++++++ | ||
39 | 1 file changed, 45 insertions(+) | ||
40 | |||
41 | diff --git a/include/instrumentation/events/kmem.h b/include/instrumentation/events/kmem.h | ||
42 | index 29c0fb7f..8c19e962 100644 | ||
43 | --- a/include/instrumentation/events/kmem.h | ||
44 | +++ b/include/instrumentation/events/kmem.h | ||
45 | @@ -218,6 +218,50 @@ LTTNG_TRACEPOINT_EVENT_MAP(mm_page_alloc, kmem_mm_page_alloc, | ||
46 | ) | ||
47 | ) | ||
48 | |||
49 | +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,19,0)) | ||
50 | +LTTNG_TRACEPOINT_EVENT_CLASS(kmem_mm_page, | ||
51 | + | ||
52 | + TP_PROTO(struct page *page, unsigned int order, int migratetype, | ||
53 | + int percpu_refill), | ||
54 | + | ||
55 | + TP_ARGS(page, order, migratetype, percpu_refill), | ||
56 | + | ||
57 | + TP_FIELDS( | ||
58 | + ctf_integer_hex(struct page *, page, page) | ||
59 | + ctf_integer(unsigned long, pfn, | ||
60 | + page ? page_to_pfn(page) : -1UL) | ||
61 | + ctf_integer(unsigned int, order, order) | ||
62 | + ctf_integer(int, migratetype, migratetype) | ||
63 | + ctf_integer(int, percpu_refill, percpu_refill) | ||
64 | + ) | ||
65 | +) | ||
66 | + | ||
67 | +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(kmem_mm_page, mm_page_alloc_zone_locked, | ||
68 | + | ||
69 | + kmem_mm_page_alloc_zone_locked, | ||
70 | + | ||
71 | + TP_PROTO(struct page *page, unsigned int order, int migratetype, | ||
72 | + int percpu_refill), | ||
73 | + | ||
74 | + TP_ARGS(page, order, migratetype, percpu_refill) | ||
75 | +) | ||
76 | + | ||
77 | +LTTNG_TRACEPOINT_EVENT_MAP(mm_page_pcpu_drain, | ||
78 | + | ||
79 | + kmem_mm_page_pcpu_drain, | ||
80 | + | ||
81 | + TP_PROTO(struct page *page, unsigned int order, int migratetype), | ||
82 | + | ||
83 | + TP_ARGS(page, order, migratetype), | ||
84 | + | ||
85 | + TP_FIELDS( | ||
86 | + ctf_integer(unsigned long, pfn, | ||
87 | + page ? page_to_pfn(page) : -1UL) | ||
88 | + ctf_integer(unsigned int, order, order) | ||
89 | + ctf_integer(int, migratetype, migratetype) | ||
90 | + ) | ||
91 | +) | ||
92 | +#else | ||
93 | LTTNG_TRACEPOINT_EVENT_CLASS(kmem_mm_page, | ||
94 | |||
95 | TP_PROTO(struct page *page, unsigned int order, int migratetype), | ||
96 | @@ -250,6 +294,7 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(kmem_mm_page, mm_page_pcpu_drain, | ||
97 | |||
98 | TP_ARGS(page, order, migratetype) | ||
99 | ) | ||
100 | +#endif | ||
101 | |||
102 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,2) \ | ||
103 | || LTTNG_KERNEL_RANGE(3,14,36, 3,15,0) \ | ||
104 | -- | ||
105 | 2.19.1 | ||
106 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0002-fix-fs-Remove-flags-parameter-from-aops-write_begin-.patch b/meta/recipes-kernel/lttng/lttng-modules/0002-fix-fs-Remove-flags-parameter-from-aops-write_begin-.patch new file mode 100644 index 0000000000..84c97d5f90 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0002-fix-fs-Remove-flags-parameter-from-aops-write_begin-.patch | |||
@@ -0,0 +1,76 @@ | |||
1 | From b5d1c38665cd69d7d1c94231fe0609da5c8afbc3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Jeanson <mjeanson@efficios.com> | ||
3 | Date: Wed, 8 Jun 2022 13:07:59 -0400 | ||
4 | Subject: [PATCH 2/3] fix: fs: Remove flags parameter from aops->write_begin | ||
5 | (v5.19) | ||
6 | |||
7 | See upstream commit : | ||
8 | |||
9 | commit 9d6b0cd7579844761ed68926eb3073bab1dca87b | ||
10 | Author: Matthew Wilcox (Oracle) <willy@infradead.org> | ||
11 | Date: Tue Feb 22 14:31:43 2022 -0500 | ||
12 | |||
13 | fs: Remove flags parameter from aops->write_begin | ||
14 | |||
15 | There are no more aop flags left, so remove the parameter. | ||
16 | |||
17 | Upstream-Status: Backport | ||
18 | |||
19 | Change-Id: I82725b93e13d749f52a631b2ac60df81a5e839f8 | ||
20 | Signed-off-by: Michael Jeanson <mjeanson@efficios.com> | ||
21 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
22 | --- | ||
23 | include/instrumentation/events/ext4.h | 30 +++++++++++++++++++++++++++ | ||
24 | 1 file changed, 30 insertions(+) | ||
25 | |||
26 | diff --git a/include/instrumentation/events/ext4.h b/include/instrumentation/events/ext4.h | ||
27 | index 513762c0..222416ec 100644 | ||
28 | --- a/include/instrumentation/events/ext4.h | ||
29 | +++ b/include/instrumentation/events/ext4.h | ||
30 | @@ -122,6 +122,35 @@ LTTNG_TRACEPOINT_EVENT(ext4_begin_ordered_truncate, | ||
31 | ) | ||
32 | ) | ||
33 | |||
34 | +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,19,0)) | ||
35 | +LTTNG_TRACEPOINT_EVENT_CLASS(ext4__write_begin, | ||
36 | + | ||
37 | + TP_PROTO(struct inode *inode, loff_t pos, unsigned int len), | ||
38 | + | ||
39 | + TP_ARGS(inode, pos, len), | ||
40 | + | ||
41 | + TP_FIELDS( | ||
42 | + ctf_integer(dev_t, dev, inode->i_sb->s_dev) | ||
43 | + ctf_integer(ino_t, ino, inode->i_ino) | ||
44 | + ctf_integer(loff_t, pos, pos) | ||
45 | + ctf_integer(unsigned int, len, len) | ||
46 | + ) | ||
47 | +) | ||
48 | + | ||
49 | +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__write_begin, ext4_write_begin, | ||
50 | + | ||
51 | + TP_PROTO(struct inode *inode, loff_t pos, unsigned int len), | ||
52 | + | ||
53 | + TP_ARGS(inode, pos, len) | ||
54 | +) | ||
55 | + | ||
56 | +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__write_begin, ext4_da_write_begin, | ||
57 | + | ||
58 | + TP_PROTO(struct inode *inode, loff_t pos, unsigned int len), | ||
59 | + | ||
60 | + TP_ARGS(inode, pos, len) | ||
61 | +) | ||
62 | +#else | ||
63 | LTTNG_TRACEPOINT_EVENT_CLASS(ext4__write_begin, | ||
64 | |||
65 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, | ||
66 | @@ -153,6 +182,7 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__write_begin, ext4_da_write_begin, | ||
67 | |||
68 | TP_ARGS(inode, pos, len, flags) | ||
69 | ) | ||
70 | +#endif | ||
71 | |||
72 | LTTNG_TRACEPOINT_EVENT_CLASS(ext4__write_end, | ||
73 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, | ||
74 | -- | ||
75 | 2.19.1 | ||
76 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0003-fix-workqueue-Fix-type-of-cpu-in-trace-event-v5.19.patch b/meta/recipes-kernel/lttng/lttng-modules/0003-fix-workqueue-Fix-type-of-cpu-in-trace-event-v5.19.patch new file mode 100644 index 0000000000..63f9c40d92 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0003-fix-workqueue-Fix-type-of-cpu-in-trace-event-v5.19.patch | |||
@@ -0,0 +1,124 @@ | |||
1 | From 526f13c844cd29f89bd3e924867d9ddfe3c40ade Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Jeanson <mjeanson@efficios.com> | ||
3 | Date: Wed, 15 Jun 2022 12:07:16 -0400 | ||
4 | Subject: [PATCH 3/3] fix: workqueue: Fix type of cpu in trace event (v5.19) | ||
5 | |||
6 | See upstream commit : | ||
7 | |||
8 | commit 873a400938b31a1e443c4d94b560b78300787540 | ||
9 | Author: Wonhyuk Yang <vvghjk1234@gmail.com> | ||
10 | Date: Wed May 4 11:32:03 2022 +0900 | ||
11 | |||
12 | workqueue: Fix type of cpu in trace event | ||
13 | |||
14 | The trace event "workqueue_queue_work" use unsigned int type for | ||
15 | req_cpu, cpu. This casue confusing cpu number like below log. | ||
16 | |||
17 | $ cat /sys/kernel/debug/tracing/trace | ||
18 | cat-317 [001] ...: workqueue_queue_work: ... req_cpu=8192 cpu=4294967295 | ||
19 | |||
20 | So, change unsigned type to signed type in the trace event. After | ||
21 | applying this patch, cpu number will be printed as -1 instead of | ||
22 | 4294967295 as folllows. | ||
23 | |||
24 | $ cat /sys/kernel/debug/tracing/trace | ||
25 | cat-1338 [002] ...: workqueue_queue_work: ... req_cpu=8192 cpu=-1 | ||
26 | |||
27 | Upstream-Status: Backport | ||
28 | |||
29 | Change-Id: I478083c350b6ec314d87e9159dc5b342b96daed7 | ||
30 | Signed-off-by: Michael Jeanson <mjeanson@efficios.com> | ||
31 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
32 | --- | ||
33 | include/instrumentation/events/workqueue.h | 49 ++++++++++++++++++++-- | ||
34 | 1 file changed, 46 insertions(+), 3 deletions(-) | ||
35 | |||
36 | diff --git a/include/instrumentation/events/workqueue.h b/include/instrumentation/events/workqueue.h | ||
37 | index 023b65a8..5693cf89 100644 | ||
38 | --- a/include/instrumentation/events/workqueue.h | ||
39 | +++ b/include/instrumentation/events/workqueue.h | ||
40 | @@ -28,10 +28,35 @@ LTTNG_TRACEPOINT_EVENT_CLASS(workqueue_work, | ||
41 | ) | ||
42 | ) | ||
43 | |||
44 | +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,19,0)) | ||
45 | /** | ||
46 | * workqueue_queue_work - called when a work gets queued | ||
47 | * @req_cpu: the requested cpu | ||
48 | - * @cwq: pointer to struct cpu_workqueue_struct | ||
49 | + * @pwq: pointer to struct pool_workqueue | ||
50 | + * @work: pointer to struct work_struct | ||
51 | + * | ||
52 | + * This event occurs when a work is queued immediately or once a | ||
53 | + * delayed work is actually queued on a workqueue (ie: once the delay | ||
54 | + * has been reached). | ||
55 | + */ | ||
56 | +LTTNG_TRACEPOINT_EVENT(workqueue_queue_work, | ||
57 | + | ||
58 | + TP_PROTO(int req_cpu, struct pool_workqueue *pwq, | ||
59 | + struct work_struct *work), | ||
60 | + | ||
61 | + TP_ARGS(req_cpu, pwq, work), | ||
62 | + | ||
63 | + TP_FIELDS( | ||
64 | + ctf_integer_hex(void *, work, work) | ||
65 | + ctf_integer_hex(void *, function, work->func) | ||
66 | + ctf_integer(int, req_cpu, req_cpu) | ||
67 | + ) | ||
68 | +) | ||
69 | +#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0)) | ||
70 | +/** | ||
71 | + * workqueue_queue_work - called when a work gets queued | ||
72 | + * @req_cpu: the requested cpu | ||
73 | + * @pwq: pointer to struct pool_workqueue | ||
74 | * @work: pointer to struct work_struct | ||
75 | * | ||
76 | * This event occurs when a work is queued immediately or once a | ||
77 | @@ -40,17 +65,34 @@ LTTNG_TRACEPOINT_EVENT_CLASS(workqueue_work, | ||
78 | */ | ||
79 | LTTNG_TRACEPOINT_EVENT(workqueue_queue_work, | ||
80 | |||
81 | -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0)) | ||
82 | TP_PROTO(unsigned int req_cpu, struct pool_workqueue *pwq, | ||
83 | struct work_struct *work), | ||
84 | |||
85 | TP_ARGS(req_cpu, pwq, work), | ||
86 | + | ||
87 | + TP_FIELDS( | ||
88 | + ctf_integer_hex(void *, work, work) | ||
89 | + ctf_integer_hex(void *, function, work->func) | ||
90 | + ctf_integer(unsigned int, req_cpu, req_cpu) | ||
91 | + ) | ||
92 | +) | ||
93 | #else | ||
94 | +/** | ||
95 | + * workqueue_queue_work - called when a work gets queued | ||
96 | + * @req_cpu: the requested cpu | ||
97 | + * @cwq: pointer to struct cpu_workqueue_struct | ||
98 | + * @work: pointer to struct work_struct | ||
99 | + * | ||
100 | + * This event occurs when a work is queued immediately or once a | ||
101 | + * delayed work is actually queued on a workqueue (ie: once the delay | ||
102 | + * has been reached). | ||
103 | + */ | ||
104 | +LTTNG_TRACEPOINT_EVENT(workqueue_queue_work, | ||
105 | + | ||
106 | TP_PROTO(unsigned int req_cpu, struct cpu_workqueue_struct *cwq, | ||
107 | struct work_struct *work), | ||
108 | |||
109 | TP_ARGS(req_cpu, cwq, work), | ||
110 | -#endif | ||
111 | |||
112 | TP_FIELDS( | ||
113 | ctf_integer_hex(void *, work, work) | ||
114 | @@ -58,6 +100,7 @@ LTTNG_TRACEPOINT_EVENT(workqueue_queue_work, | ||
115 | ctf_integer(unsigned int, req_cpu, req_cpu) | ||
116 | ) | ||
117 | ) | ||
118 | +#endif | ||
119 | |||
120 | /** | ||
121 | * workqueue_activate_work - called when a work gets activated | ||
122 | -- | ||
123 | 2.19.1 | ||
124 | |||