summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2020-12-14 10:09:23 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-01-04 11:45:47 +0000
commite876c23cd869dcac47fa5ffa5575abaf6421214b (patch)
treea7a6dde757ccac1f12a88222ade5175a8bd108cf /meta/recipes-kernel
parentb471e29b8d5ad37fb34d09ef9716c694999d4b64 (diff)
downloadpoky-e876c23cd869dcac47fa5ffa5575abaf6421214b.tar.gz
lttng-modules: fix build against v5.10+
lttng-modules doesn't currently build against the lastest 5.10-rc versions. Upstream lttng does have fixes for the issues, but hasn't done a release that contains them yet. There are other patches on the 2.12.x branch, but I've skipped them for now as they aren't necessary for 5.10 builds, and can be picked up with the next full update. We also bump the dev-upstream hash to make them easier to pickup for those building from git. (From OE-Core rev: 6d1169d2c046d8fa6220ab04863672557aa42cf1) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 47201e98bb293d59c5d41986d066fd7614b914fa) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel')
-rw-r--r--meta/recipes-kernel/lttng/lttng-modules/0007-fix-objtool-Rename-frame.h-objtool.h-v5.10.patch88
-rw-r--r--meta/recipes-kernel/lttng/lttng-modules/0009-fix-btrfs-make-ordered-extent-tracepoint-take-btrfs_.patch179
-rw-r--r--meta/recipes-kernel/lttng/lttng-modules/0010-fix-ext4-fast-commit-recovery-path-v5.10.patch99
-rw-r--r--meta/recipes-kernel/lttng/lttng-modules/0012-fix-kvm-x86-mmu-Add-TDP-MMU-PF-handler-v5.10.patch82
-rw-r--r--meta/recipes-kernel/lttng/lttng-modules/0014-fix-tracepoint-Optimize-using-static_call-v5.10.patch196
-rw-r--r--meta/recipes-kernel/lttng/lttng-modules/0016-fix-statedump-undefined-symbols-caused-by-incorrect-.patch55
-rw-r--r--meta/recipes-kernel/lttng/lttng-modules_2.12.3.bb10
7 files changed, 707 insertions, 2 deletions
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0007-fix-objtool-Rename-frame.h-objtool.h-v5.10.patch b/meta/recipes-kernel/lttng/lttng-modules/0007-fix-objtool-Rename-frame.h-objtool.h-v5.10.patch
new file mode 100644
index 0000000000..fde9398394
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-modules/0007-fix-objtool-Rename-frame.h-objtool.h-v5.10.patch
@@ -0,0 +1,88 @@
1From 37b9cb0e6cb92181b7a25583849a9d161a558982 Mon Sep 17 00:00:00 2001
2From: Michael Jeanson <mjeanson@efficios.com>
3Date: Mon, 26 Oct 2020 13:41:02 -0400
4Subject: [PATCH 07/19] fix: objtool: Rename frame.h -> objtool.h (v5.10)
5
6See upstream commit :
7
8 commit 00089c048eb4a8250325efb32a2724fd0da68cce
9 Author: Julien Thierry <jthierry@redhat.com>
10 Date: Fri Sep 4 16:30:25 2020 +0100
11
12 objtool: Rename frame.h -> objtool.h
13
14 Header frame.h is getting more code annotations to help objtool analyze
15 object files.
16
17 Rename the file to objtool.h.
18
19Upstream-Status: Backport
20
21Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
22Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
23Change-Id: Ic2283161bebcbf1e33b72805eb4d2628f4ae3e89
24---
25 lttng-filter-interpreter.c | 2 +-
26 wrapper/{frame.h => objtool.h} | 19 ++++++++++++-------
27 2 files changed, 13 insertions(+), 8 deletions(-)
28 rename wrapper/{frame.h => objtool.h} (50%)
29
30diff --git a/lttng-filter-interpreter.c b/lttng-filter-interpreter.c
31index 21169f01..5d572437 100644
32--- a/lttng-filter-interpreter.c
33+++ b/lttng-filter-interpreter.c
34@@ -8,7 +8,7 @@
35 */
36
37 #include <wrapper/uaccess.h>
38-#include <wrapper/frame.h>
39+#include <wrapper/objtool.h>
40 #include <wrapper/types.h>
41 #include <linux/swab.h>
42
43diff --git a/wrapper/frame.h b/wrapper/objtool.h
44similarity index 50%
45rename from wrapper/frame.h
46rename to wrapper/objtool.h
47index 6e6dc811..3b997cae 100644
48--- a/wrapper/frame.h
49+++ b/wrapper/objtool.h
50@@ -1,18 +1,23 @@
51-/* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1)
52+/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
53 *
54- * wrapper/frame.h
55+ * wrapper/objtool.h
56 *
57 * Copyright (C) 2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
58 */
59
60-#ifndef _LTTNG_WRAPPER_FRAME_H
61-#define _LTTNG_WRAPPER_FRAME_H
62+#ifndef _LTTNG_WRAPPER_OBJTOOL_H
63+#define _LTTNG_WRAPPER_OBJTOOL_H
64
65 #include <linux/version.h>
66
67-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0))
68-
69+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0))
70+#include <linux/objtool.h>
71+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0))
72 #include <linux/frame.h>
73+#endif
74+
75+
76+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0))
77
78 #define LTTNG_STACK_FRAME_NON_STANDARD(func) \
79 STACK_FRAME_NON_STANDARD(func)
80@@ -23,4 +28,4 @@
81
82 #endif
83
84-#endif /* _LTTNG_WRAPPER_FRAME_H */
85+#endif /* _LTTNG_WRAPPER_OBJTOOL_H */
86--
872.19.1
88
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0009-fix-btrfs-make-ordered-extent-tracepoint-take-btrfs_.patch b/meta/recipes-kernel/lttng/lttng-modules/0009-fix-btrfs-make-ordered-extent-tracepoint-take-btrfs_.patch
new file mode 100644
index 0000000000..bc87c7174e
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-modules/0009-fix-btrfs-make-ordered-extent-tracepoint-take-btrfs_.patch
@@ -0,0 +1,179 @@
1From ddad4e82bc2cc48c0eb56d2daf69409026e8b31a Mon Sep 17 00:00:00 2001
2From: Michael Jeanson <mjeanson@efficios.com>
3Date: Tue, 27 Oct 2020 12:10:05 -0400
4Subject: [PATCH 09/19] fix: btrfs: make ordered extent tracepoint take
5 btrfs_inode (v5.10)
6
7See upstream commit :
8
9 commit acbf1dd0fcbd10c67826a19958f55a053b32f532
10 Author: Nikolay Borisov <nborisov@suse.com>
11 Date: Mon Aug 31 14:42:40 2020 +0300
12
13 btrfs: make ordered extent tracepoint take btrfs_inode
14
15Upstream-Status: Backport
16
17Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
18Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
19Change-Id: I096d0801ffe0ad826cfe414cdd1c0857cbd2b624
20---
21 instrumentation/events/lttng-module/btrfs.h | 120 +++++++++++++++-----
22 1 file changed, 90 insertions(+), 30 deletions(-)
23
24diff --git a/instrumentation/events/lttng-module/btrfs.h b/instrumentation/events/lttng-module/btrfs.h
25index 52fcfd0d..d47f3280 100644
26--- a/instrumentation/events/lttng-module/btrfs.h
27+++ b/instrumentation/events/lttng-module/btrfs.h
28@@ -346,7 +346,29 @@ LTTNG_TRACEPOINT_EVENT(btrfs_handle_em_exist,
29 )
30 #endif
31
32-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
33+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0))
34+LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
35+
36+ TP_PROTO(const struct btrfs_inode *inode,
37+ const struct btrfs_ordered_extent *ordered),
38+
39+ TP_ARGS(inode, ordered),
40+
41+ TP_FIELDS(
42+ ctf_array(u8, fsid, inode->root->lttng_fs_info_fsid, BTRFS_UUID_SIZE)
43+ ctf_integer(ino_t, ino, btrfs_ino(inode))
44+ ctf_integer(u64, file_offset, ordered->file_offset)
45+ ctf_integer(u64, start, ordered->disk_bytenr)
46+ ctf_integer(u64, len, ordered->num_bytes)
47+ ctf_integer(u64, disk_len, ordered->disk_num_bytes)
48+ ctf_integer(u64, bytes_left, ordered->bytes_left)
49+ ctf_integer(unsigned long, flags, ordered->flags)
50+ ctf_integer(int, compress_type, ordered->compress_type)
51+ ctf_integer(int, refs, refcount_read(&ordered->refs))
52+ ctf_integer(u64, root_objectid, inode->root->root_key.objectid)
53+ )
54+)
55+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
56 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
57
58 TP_PROTO(const struct inode *inode,
59@@ -458,7 +480,39 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
60 )
61 #endif
62
63-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
64+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0))
65+LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_add,
66+
67+ TP_PROTO(const struct btrfs_inode *inode,
68+ const struct btrfs_ordered_extent *ordered),
69+
70+ TP_ARGS(inode, ordered)
71+)
72+
73+LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_remove,
74+
75+ TP_PROTO(const struct btrfs_inode *inode,
76+ const struct btrfs_ordered_extent *ordered),
77+
78+ TP_ARGS(inode, ordered)
79+)
80+
81+LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_start,
82+
83+ TP_PROTO(const struct btrfs_inode *inode,
84+ const struct btrfs_ordered_extent *ordered),
85+
86+ TP_ARGS(inode, ordered)
87+)
88+
89+LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_put,
90+
91+ TP_PROTO(const struct btrfs_inode *inode,
92+ const struct btrfs_ordered_extent *ordered),
93+
94+ TP_ARGS(inode, ordered)
95+)
96+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
97 LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
98 LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
99 LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
100@@ -494,7 +548,41 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_put,
101
102 TP_ARGS(inode, ordered)
103 )
104+#else
105+LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_add,
106+
107+ TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
108+
109+ TP_ARGS(inode, ordered)
110+)
111+
112+LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_remove,
113+
114+ TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
115+
116+ TP_ARGS(inode, ordered)
117+)
118+
119+LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_start,
120+
121+ TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
122+
123+ TP_ARGS(inode, ordered)
124+)
125
126+LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_put,
127+
128+ TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
129+
130+ TP_ARGS(inode, ordered)
131+)
132+#endif
133+
134+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
135+ LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
136+ LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
137+ LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
138+ LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
139 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__writepage,
140
141 TP_PROTO(const struct page *page, const struct inode *inode,
142@@ -563,34 +651,6 @@ LTTNG_TRACEPOINT_EVENT(btrfs_sync_file,
143 )
144 )
145 #else
146-LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_add,
147-
148- TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
149-
150- TP_ARGS(inode, ordered)
151-)
152-
153-LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_remove,
154-
155- TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
156-
157- TP_ARGS(inode, ordered)
158-)
159-
160-LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_start,
161-
162- TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
163-
164- TP_ARGS(inode, ordered)
165-)
166-
167-LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_put,
168-
169- TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
170-
171- TP_ARGS(inode, ordered)
172-)
173-
174 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__writepage,
175
176 TP_PROTO(struct page *page, struct inode *inode,
177--
1782.19.1
179
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0010-fix-ext4-fast-commit-recovery-path-v5.10.patch b/meta/recipes-kernel/lttng/lttng-modules/0010-fix-ext4-fast-commit-recovery-path-v5.10.patch
new file mode 100644
index 0000000000..fb00a44b31
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-modules/0010-fix-ext4-fast-commit-recovery-path-v5.10.patch
@@ -0,0 +1,99 @@
1From a28235f8ffa3c961640a835686dddb5ca600dfaf Mon Sep 17 00:00:00 2001
2From: Michael Jeanson <mjeanson@efficios.com>
3Date: Mon, 26 Oct 2020 17:03:23 -0400
4Subject: [PATCH 10/19] fix: ext4: fast commit recovery path (v5.10)
5
6See upstream commit :
7
8 commit 8016e29f4362e285f0f7e38fadc61a5b7bdfdfa2
9 Author: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
10 Date: Thu Oct 15 13:37:59 2020 -0700
11
12 ext4: fast commit recovery path
13
14 This patch adds fast commit recovery path support for Ext4 file
15 system. We add several helper functions that are similar in spirit to
16 e2fsprogs journal recovery path handlers. Example of such functions
17 include - a simple block allocator, idempotent block bitmap update
18 function etc. Using these routines and the fast commit log in the fast
19 commit area, the recovery path (ext4_fc_replay()) performs fast commit
20 log recovery.
21
22Upstream-Status: Backport
23
24Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
25Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
26Change-Id: Ia65cf44e108f2df0b458f0d335f33a8f18f50baa
27---
28 instrumentation/events/lttng-module/ext4.h | 41 ++++++++++++++++++++++
29 1 file changed, 41 insertions(+)
30
31diff --git a/instrumentation/events/lttng-module/ext4.h b/instrumentation/events/lttng-module/ext4.h
32index b172c8d9..6e74abad 100644
33--- a/instrumentation/events/lttng-module/ext4.h
34+++ b/instrumentation/events/lttng-module/ext4.h
35@@ -1274,6 +1274,18 @@ LTTNG_TRACEPOINT_EVENT(ext4_ext_load_extent,
36 )
37 )
38
39+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0))
40+LTTNG_TRACEPOINT_EVENT(ext4_load_inode,
41+ TP_PROTO(struct super_block *sb, unsigned long ino),
42+
43+ TP_ARGS(sb, ino),
44+
45+ TP_FIELDS(
46+ ctf_integer(dev_t, dev, sb->s_dev)
47+ ctf_integer(ino_t, ino, ino)
48+ )
49+)
50+#else
51 LTTNG_TRACEPOINT_EVENT(ext4_load_inode,
52 TP_PROTO(struct inode *inode),
53
54@@ -1284,6 +1296,7 @@ LTTNG_TRACEPOINT_EVENT(ext4_load_inode,
55 ctf_integer(ino_t, ino, inode->i_ino)
56 )
57 )
58+#endif
59
60 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0))
61
62@@ -1895,6 +1908,34 @@ LTTNG_TRACEPOINT_EVENT(ext4_es_shrink_exit,
63
64 #endif
65
66+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0))
67+LTTNG_TRACEPOINT_EVENT(ext4_fc_replay_scan,
68+ TP_PROTO(struct super_block *sb, int error, int off),
69+
70+ TP_ARGS(sb, error, off),
71+
72+ TP_FIELDS(
73+ ctf_integer(dev_t, dev, sb->s_dev)
74+ ctf_integer(int, error, error)
75+ ctf_integer(int, off, off)
76+ )
77+)
78+
79+LTTNG_TRACEPOINT_EVENT(ext4_fc_replay,
80+ TP_PROTO(struct super_block *sb, int tag, int ino, int priv1, int priv2),
81+
82+ TP_ARGS(sb, tag, ino, priv1, priv2),
83+
84+ TP_FIELDS(
85+ ctf_integer(dev_t, dev, sb->s_dev)
86+ ctf_integer(int, tag, tag)
87+ ctf_integer(int, ino, ino)
88+ ctf_integer(int, priv1, priv1)
89+ ctf_integer(int, priv2, priv2)
90+ )
91+)
92+#endif
93+
94 #endif /* LTTNG_TRACE_EXT4_H */
95
96 /* This part must be outside protection */
97--
982.19.1
99
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0012-fix-kvm-x86-mmu-Add-TDP-MMU-PF-handler-v5.10.patch b/meta/recipes-kernel/lttng/lttng-modules/0012-fix-kvm-x86-mmu-Add-TDP-MMU-PF-handler-v5.10.patch
new file mode 100644
index 0000000000..8651bded99
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-modules/0012-fix-kvm-x86-mmu-Add-TDP-MMU-PF-handler-v5.10.patch
@@ -0,0 +1,82 @@
1From e30866f96b3ab02639f429e4bd34e59b3a336579 Mon Sep 17 00:00:00 2001
2From: Michael Jeanson <mjeanson@efficios.com>
3Date: Mon, 26 Oct 2020 14:28:35 -0400
4Subject: [PATCH 12/19] fix: kvm: x86/mmu: Add TDP MMU PF handler (v5.10)
5
6See upstream commit :
7
8 commit bb18842e21111a979e2e0e1c5d85c09646f18d51
9 Author: Ben Gardon <bgardon@google.com>
10 Date: Wed Oct 14 11:26:50 2020 -0700
11
12 kvm: x86/mmu: Add TDP MMU PF handler
13
14 Add functions to handle page faults in the TDP MMU. These page faults
15 are currently handled in much the same way as the x86 shadow paging
16 based MMU, however the ordering of some operations is slightly
17 different. Future patches will add eager NX splitting, a fast page fault
18 handler, and parallel page faults.
19
20 Tested by running kvm-unit-tests and KVM selftests on an Intel Haswell
21 machine. This series introduced no new failures.
22
23Upstream-Status: Backport
24
25Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
26Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
27Change-Id: Ie56959cb6c77913d2f1188b0ca15da9114623a4e
28---
29 .../lttng-module/arch/x86/kvm/mmutrace.h | 20 ++++++++++++++++++-
30 probes/lttng-probe-kvm-x86-mmu.c | 5 +++++
31 2 files changed, 24 insertions(+), 1 deletion(-)
32
33diff --git a/instrumentation/events/lttng-module/arch/x86/kvm/mmutrace.h b/instrumentation/events/lttng-module/arch/x86/kvm/mmutrace.h
34index e5470400..86717835 100644
35--- a/instrumentation/events/lttng-module/arch/x86/kvm/mmutrace.h
36+++ b/instrumentation/events/lttng-module/arch/x86/kvm/mmutrace.h
37@@ -163,7 +163,25 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(kvm_mmu_page_class, kvm_mmu_prepare_zap_page,
38 TP_ARGS(sp)
39 )
40
41-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0))
42+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0))
43+
44+LTTNG_TRACEPOINT_EVENT_MAP(
45+ mark_mmio_spte,
46+
47+ kvm_mmu_mark_mmio_spte,
48+
49+ TP_PROTO(u64 *sptep, gfn_t gfn, u64 spte),
50+ TP_ARGS(sptep, gfn, spte),
51+
52+ TP_FIELDS(
53+ ctf_integer_hex(void *, sptep, sptep)
54+ ctf_integer(gfn_t, gfn, gfn)
55+ ctf_integer(unsigned, access, spte & ACC_ALL)
56+ ctf_integer(unsigned int, gen, get_mmio_spte_generation(spte))
57+ )
58+)
59+
60+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0))
61
62 LTTNG_TRACEPOINT_EVENT_MAP(
63 mark_mmio_spte,
64diff --git a/probes/lttng-probe-kvm-x86-mmu.c b/probes/lttng-probe-kvm-x86-mmu.c
65index 8f981865..5043c776 100644
66--- a/probes/lttng-probe-kvm-x86-mmu.c
67+++ b/probes/lttng-probe-kvm-x86-mmu.c
68@@ -31,6 +31,11 @@
69 #include <../../arch/x86/kvm/mmutrace.h>
70 #endif
71
72+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0))
73+#include <../arch/x86/kvm/mmu.h>
74+#include <../arch/x86/kvm/mmu/spte.h>
75+#endif
76+
77 #undef TRACE_INCLUDE_PATH
78 #undef TRACE_INCLUDE_FILE
79
80--
812.19.1
82
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0014-fix-tracepoint-Optimize-using-static_call-v5.10.patch b/meta/recipes-kernel/lttng/lttng-modules/0014-fix-tracepoint-Optimize-using-static_call-v5.10.patch
new file mode 100644
index 0000000000..5892a408b3
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-modules/0014-fix-tracepoint-Optimize-using-static_call-v5.10.patch
@@ -0,0 +1,196 @@
1From bb346792c2cb6995ffc08d2084121935c6384865 Mon Sep 17 00:00:00 2001
2From: Michael Jeanson <mjeanson@efficios.com>
3Date: Mon, 26 Oct 2020 17:09:05 -0400
4Subject: [PATCH 14/19] fix: tracepoint: Optimize using static_call() (v5.10)
5
6See upstream commit :
7
8 commit d25e37d89dd2f41d7acae0429039d2f0ae8b4a07
9 Author: Steven Rostedt (VMware) <rostedt@goodmis.org>
10 Date: Tue Aug 18 15:57:52 2020 +0200
11
12 tracepoint: Optimize using static_call()
13
14 Currently the tracepoint site will iterate a vector and issue indirect
15 calls to however many handlers are registered (ie. the vector is
16 long).
17
18 Using static_call() it is possible to optimize this for the common
19 case of only having a single handler registered. In this case the
20 static_call() can directly call this handler. Otherwise, if the vector
21 is longer than 1, call a function that iterates the whole vector like
22 the current code.
23
24Upstream-Status: Backport
25
26Change-Id: I739dd84d62cc1a821b8bd8acff74fa29aa25d22f
27Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
28Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
29---
30 lttng-statedump-impl.c | 80 +++++++++++++++++++++++++++++++--------
31 probes/lttng.c | 7 +++-
32 tests/probes/lttng-test.c | 7 +++-
33 wrapper/tracepoint.h | 8 ++++
34 4 files changed, 84 insertions(+), 18 deletions(-)
35
36diff --git a/lttng-statedump-impl.c b/lttng-statedump-impl.c
37index a6fa71a5..67ecd33c 100644
38--- a/lttng-statedump-impl.c
39+++ b/lttng-statedump-impl.c
40@@ -55,26 +55,76 @@
41 #define LTTNG_INSTRUMENTATION
42 #include <instrumentation/events/lttng-module/lttng-statedump.h>
43
44-DEFINE_TRACE(lttng_statedump_block_device);
45-DEFINE_TRACE(lttng_statedump_end);
46-DEFINE_TRACE(lttng_statedump_interrupt);
47-DEFINE_TRACE(lttng_statedump_file_descriptor);
48-DEFINE_TRACE(lttng_statedump_start);
49-DEFINE_TRACE(lttng_statedump_process_state);
50-DEFINE_TRACE(lttng_statedump_process_pid_ns);
51+LTTNG_DEFINE_TRACE(lttng_statedump_block_device,
52+ TP_PROTO(struct lttng_session *session,
53+ dev_t dev, const char *diskname),
54+ TP_ARGS(session, dev, diskname));
55+
56+LTTNG_DEFINE_TRACE(lttng_statedump_end,
57+ TP_PROTO(struct lttng_session *session),
58+ TP_ARGS(session));
59+
60+LTTNG_DEFINE_TRACE(lttng_statedump_interrupt,
61+ TP_PROTO(struct lttng_session *session,
62+ unsigned int irq, const char *chip_name,
63+ struct irqaction *action),
64+ TP_ARGS(session, irq, chip_name, action));
65+
66+LTTNG_DEFINE_TRACE(lttng_statedump_file_descriptor,
67+ TP_PROTO(struct lttng_session *session,
68+ struct files_struct *files,
69+ int fd, const char *filename,
70+ unsigned int flags, fmode_t fmode),
71+ TP_ARGS(session, files, fd, filename, flags, fmode));
72+
73+LTTNG_DEFINE_TRACE(lttng_statedump_start,
74+ TP_PROTO(struct lttng_session *session),
75+ TP_ARGS(session));
76+
77+LTTNG_DEFINE_TRACE(lttng_statedump_process_state,
78+ TP_PROTO(struct lttng_session *session,
79+ struct task_struct *p,
80+ int type, int mode, int submode, int status,
81+ struct files_struct *files),
82+ TP_ARGS(session, p, type, mode, submode, status, files));
83+
84+LTTNG_DEFINE_TRACE(lttng_statedump_process_pid_ns,
85+ TP_PROTO(struct lttng_session *session,
86+ struct task_struct *p,
87+ struct pid_namespace *pid_ns),
88+ TP_ARGS(session, p, pid_ns));
89+
90 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0))
91-DEFINE_TRACE(lttng_statedump_process_cgroup_ns);
92+LTTNG_DEFINE_TRACE(lttng_statedump_process_cgroup_ns,
93+ TP_PROTO(struct lttng_session *session,
94+ struct task_struct *p,
95+ struct cgroup_namespace *cgroup_ns),
96+ TP_ARGS(session, p, cgroup_ns));
97 #endif
98-DEFINE_TRACE(lttng_statedump_process_ipc_ns);
99+
100+LTTNG_DEFINE_TRACE(lttng_statedump_process_ipc_ns,
101+ TP_PROTO(struct lttng_session *session,
102+ struct task_struct *p,
103+ struct ipc_namespace *ipc_ns),
104+ TP_ARGS(session, p, ipc_ns));
105+
106 #ifndef LTTNG_MNT_NS_MISSING_HEADER
107-DEFINE_TRACE(lttng_statedump_process_mnt_ns);
108+LTTNG_DEFINE_TRACE(lttng_statedump_process_mnt_ns,
109+ TP_PROTO(struct lttng_session *session,
110+ struct task_struct *p,
111+ struct mnt_namespace *mnt_ns),
112+ TP_ARGS(session, p, mnt_ns));
113 #endif
114-DEFINE_TRACE(lttng_statedump_process_net_ns);
115-DEFINE_TRACE(lttng_statedump_process_user_ns);
116-DEFINE_TRACE(lttng_statedump_process_uts_ns);
117-DEFINE_TRACE(lttng_statedump_network_interface);
118+
119+LTTNG_DEFINE_TRACE(lttng_statedump_network_interface,
120+ TP_PROTO(struct lttng_session *session,
121+ struct net_device *dev, struct in_ifaddr *ifa),
122+ TP_ARGS(session, dev, ifa));
123+
124 #ifdef LTTNG_HAVE_STATEDUMP_CPU_TOPOLOGY
125-DEFINE_TRACE(lttng_statedump_cpu_topology);
126+LTTNG_DEFINE_TRACE(lttng_statedump_cpu_topology,
127+ TP_PROTO(struct lttng_session *session, struct cpuinfo_x86 *c),
128+ TP_ARGS(session, c));
129 #endif
130
131 struct lttng_fd_ctx {
132diff --git a/probes/lttng.c b/probes/lttng.c
133index 05bc1388..7ddaa69f 100644
134--- a/probes/lttng.c
135+++ b/probes/lttng.c
136@@ -8,7 +8,7 @@
137 */
138
139 #include <linux/module.h>
140-#include <linux/tracepoint.h>
141+#include <wrapper/tracepoint.h>
142 #include <linux/uaccess.h>
143 #include <linux/gfp.h>
144 #include <linux/fs.h>
145@@ -32,7 +32,10 @@
146 #define LTTNG_LOGGER_COUNT_MAX 1024
147 #define LTTNG_LOGGER_FILE "lttng-logger"
148
149-DEFINE_TRACE(lttng_logger);
150+LTTNG_DEFINE_TRACE(lttng_logger,
151+ PARAMS(const char __user *text, size_t len),
152+ PARAMS(text, len)
153+);
154
155 static struct proc_dir_entry *lttng_logger_dentry;
156
157diff --git a/tests/probes/lttng-test.c b/tests/probes/lttng-test.c
158index b450e7d7..a4fa0645 100644
159--- a/tests/probes/lttng-test.c
160+++ b/tests/probes/lttng-test.c
161@@ -25,7 +25,12 @@
162 #define LTTNG_INSTRUMENTATION
163 #include <instrumentation/events/lttng-module/lttng-test.h>
164
165-DEFINE_TRACE(lttng_test_filter_event);
166+LTTNG_DEFINE_TRACE(lttng_test_filter_event,
167+ PARAMS(int anint, int netint, long *values,
168+ char *text, size_t textlen,
169+ char *etext, uint32_t * net_values),
170+ PARAMS(anint, netint, values, text, textlen, etext, net_values)
171+);
172
173 #define LTTNG_TEST_FILTER_EVENT_FILE "lttng-test-filter-event"
174
175diff --git a/wrapper/tracepoint.h b/wrapper/tracepoint.h
176index c4ba0123..bc19d8c1 100644
177--- a/wrapper/tracepoint.h
178+++ b/wrapper/tracepoint.h
179@@ -14,6 +14,14 @@
180 #include <linux/tracepoint.h>
181 #include <linux/module.h>
182
183+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0))
184+#define LTTNG_DEFINE_TRACE(name, proto, args) \
185+ DEFINE_TRACE(name, PARAMS(proto), PARAMS(args))
186+#else
187+#define LTTNG_DEFINE_TRACE(name, proto, args) \
188+ DEFINE_TRACE(name)
189+#endif
190+
191 #ifndef HAVE_KABI_2635_TRACEPOINT
192
193 #define kabi_2635_tracepoint_probe_register tracepoint_probe_register
194--
1952.19.1
196
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0016-fix-statedump-undefined-symbols-caused-by-incorrect-.patch b/meta/recipes-kernel/lttng/lttng-modules/0016-fix-statedump-undefined-symbols-caused-by-incorrect-.patch
new file mode 100644
index 0000000000..e848e16f59
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-modules/0016-fix-statedump-undefined-symbols-caused-by-incorrect-.patch
@@ -0,0 +1,55 @@
1From 31f8bf794172102e9758928b481856c4a8800a7f Mon Sep 17 00:00:00 2001
2From: He Zhe <zhe.he@windriver.com>
3Date: Mon, 23 Nov 2020 18:14:25 +0800
4Subject: [PATCH 16/19] fix: statedump: undefined symbols caused by incorrect
5 patch backport
6
7bb346792c2cb ("fix: tracepoint: Optimize using static_call() (v5.10)")
8misses three definitions and causes the following build failures.
9
10ERROR: "__tracepoint_lttng_statedump_process_net_ns" [lttng-statedump.ko] undefined!
11ERROR: "__tracepoint_lttng_statedump_process_user_ns" [lttng-statedump.ko] undefined!
12ERROR: "__tracepoint_lttng_statedump_process_uts_ns" [lttng-statedump.ko] undefined!
13
14Fixes: #1290
15
16Upstream-Status: Backport
17
18Signed-off-by: He Zhe <zhe.he@windriver.com>
19Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
20---
21 lttng-statedump-impl.c | 18 ++++++++++++++++++
22 1 file changed, 18 insertions(+)
23
24diff --git a/lttng-statedump-impl.c b/lttng-statedump-impl.c
25index 67ecd33c..cf803a73 100644
26--- a/lttng-statedump-impl.c
27+++ b/lttng-statedump-impl.c
28@@ -116,6 +116,24 @@ LTTNG_DEFINE_TRACE(lttng_statedump_process_mnt_ns,
29 TP_ARGS(session, p, mnt_ns));
30 #endif
31
32+LTTNG_DEFINE_TRACE(lttng_statedump_process_net_ns,
33+ TP_PROTO(struct lttng_session *session,
34+ struct task_struct *p,
35+ struct net *net_ns),
36+ TP_ARGS(session, p, net_ns));
37+
38+LTTNG_DEFINE_TRACE(lttng_statedump_process_user_ns,
39+ TP_PROTO(struct lttng_session *session,
40+ struct task_struct *p,
41+ struct user_namespace *user_ns),
42+ TP_ARGS(session, p, user_ns));
43+
44+LTTNG_DEFINE_TRACE(lttng_statedump_process_uts_ns,
45+ TP_PROTO(struct lttng_session *session,
46+ struct task_struct *p,
47+ struct uts_namespace *uts_ns),
48+ TP_ARGS(session, p, uts_ns));
49+
50 LTTNG_DEFINE_TRACE(lttng_statedump_network_interface,
51 TP_PROTO(struct lttng_session *session,
52 struct net_device *dev, struct in_ifaddr *ifa),
53--
542.19.1
55
diff --git a/meta/recipes-kernel/lttng/lttng-modules_2.12.3.bb b/meta/recipes-kernel/lttng/lttng-modules_2.12.3.bb
index ca79e27df6..3515e4f51e 100644
--- a/meta/recipes-kernel/lttng/lttng-modules_2.12.3.bb
+++ b/meta/recipes-kernel/lttng/lttng-modules_2.12.3.bb
@@ -12,6 +12,12 @@ SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2 \
12 file://Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch \ 12 file://Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch \
13 file://BUILD_RUNTIME_BUG_ON-vs-gcc7.patch \ 13 file://BUILD_RUNTIME_BUG_ON-vs-gcc7.patch \
14 file://0001-fix-btrfs-tracepoints-output-proper-root-owner-for-t.patch \ 14 file://0001-fix-btrfs-tracepoints-output-proper-root-owner-for-t.patch \
15 file://0007-fix-objtool-Rename-frame.h-objtool.h-v5.10.patch \
16 file://0009-fix-btrfs-make-ordered-extent-tracepoint-take-btrfs_.patch \
17 file://0010-fix-ext4-fast-commit-recovery-path-v5.10.patch \
18 file://0012-fix-kvm-x86-mmu-Add-TDP-MMU-PF-handler-v5.10.patch \
19 file://0014-fix-tracepoint-Optimize-using-static_call-v5.10.patch \
20 file://0016-fix-statedump-undefined-symbols-caused-by-incorrect-.patch \
15 " 21 "
16 22
17SRC_URI[sha256sum] = "673ef85c9f03e9b8fed10795e09d4e68add39404b70068d08b10f7b85754d7f0" 23SRC_URI[sha256sum] = "673ef85c9f03e9b8fed10795e09d4e68add39404b70068d08b10f7b85754d7f0"
@@ -37,7 +43,7 @@ SRC_URI_class-devupstream = "git://git.lttng.org/lttng-modules;branch=stable-2.1
37 file://Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch \ 43 file://Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch \
38 file://BUILD_RUNTIME_BUG_ON-vs-gcc7.patch \ 44 file://BUILD_RUNTIME_BUG_ON-vs-gcc7.patch \
39 " 45 "
40SRCREV_class-devupstream = "ad594e3a953db1b0c3c059fde45b5a5494f6be78" 46SRCREV_class-devupstream = "be71b60a327d7ad2588abc5cad2861177119972b"
41PV_class-devupstream = "2.12.2+git${SRCPV}" 47PV_class-devupstream = "2.12.3+git${SRCPV}"
42S_class-devupstream = "${WORKDIR}/git" 48S_class-devupstream = "${WORKDIR}/git"
43SRCREV_FORMAT ?= "lttng_git" 49SRCREV_FORMAT ?= "lttng_git"