diff options
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 @@ | |||
1 | From 37b9cb0e6cb92181b7a25583849a9d161a558982 Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Jeanson <mjeanson@efficios.com> | ||
3 | Date: Mon, 26 Oct 2020 13:41:02 -0400 | ||
4 | Subject: [PATCH 07/19] fix: objtool: Rename frame.h -> objtool.h (v5.10) | ||
5 | |||
6 | See 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 | |||
19 | Upstream-Status: Backport | ||
20 | |||
21 | Signed-off-by: Michael Jeanson <mjeanson@efficios.com> | ||
22 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
23 | Change-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 | |||
30 | diff --git a/lttng-filter-interpreter.c b/lttng-filter-interpreter.c | ||
31 | index 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 | |||
43 | diff --git a/wrapper/frame.h b/wrapper/objtool.h | ||
44 | similarity index 50% | ||
45 | rename from wrapper/frame.h | ||
46 | rename to wrapper/objtool.h | ||
47 | index 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 | -- | ||
87 | 2.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 @@ | |||
1 | From ddad4e82bc2cc48c0eb56d2daf69409026e8b31a Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Jeanson <mjeanson@efficios.com> | ||
3 | Date: Tue, 27 Oct 2020 12:10:05 -0400 | ||
4 | Subject: [PATCH 09/19] fix: btrfs: make ordered extent tracepoint take | ||
5 | btrfs_inode (v5.10) | ||
6 | |||
7 | See 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 | |||
15 | Upstream-Status: Backport | ||
16 | |||
17 | Signed-off-by: Michael Jeanson <mjeanson@efficios.com> | ||
18 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
19 | Change-Id: I096d0801ffe0ad826cfe414cdd1c0857cbd2b624 | ||
20 | --- | ||
21 | instrumentation/events/lttng-module/btrfs.h | 120 +++++++++++++++----- | ||
22 | 1 file changed, 90 insertions(+), 30 deletions(-) | ||
23 | |||
24 | diff --git a/instrumentation/events/lttng-module/btrfs.h b/instrumentation/events/lttng-module/btrfs.h | ||
25 | index 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 | -- | ||
178 | 2.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 @@ | |||
1 | From a28235f8ffa3c961640a835686dddb5ca600dfaf Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Jeanson <mjeanson@efficios.com> | ||
3 | Date: Mon, 26 Oct 2020 17:03:23 -0400 | ||
4 | Subject: [PATCH 10/19] fix: ext4: fast commit recovery path (v5.10) | ||
5 | |||
6 | See 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 | |||
22 | Upstream-Status: Backport | ||
23 | |||
24 | Signed-off-by: Michael Jeanson <mjeanson@efficios.com> | ||
25 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
26 | Change-Id: Ia65cf44e108f2df0b458f0d335f33a8f18f50baa | ||
27 | --- | ||
28 | instrumentation/events/lttng-module/ext4.h | 41 ++++++++++++++++++++++ | ||
29 | 1 file changed, 41 insertions(+) | ||
30 | |||
31 | diff --git a/instrumentation/events/lttng-module/ext4.h b/instrumentation/events/lttng-module/ext4.h | ||
32 | index 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 | -- | ||
98 | 2.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 @@ | |||
1 | From e30866f96b3ab02639f429e4bd34e59b3a336579 Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Jeanson <mjeanson@efficios.com> | ||
3 | Date: Mon, 26 Oct 2020 14:28:35 -0400 | ||
4 | Subject: [PATCH 12/19] fix: kvm: x86/mmu: Add TDP MMU PF handler (v5.10) | ||
5 | |||
6 | See 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 | |||
23 | Upstream-Status: Backport | ||
24 | |||
25 | Signed-off-by: Michael Jeanson <mjeanson@efficios.com> | ||
26 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
27 | Change-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 | |||
33 | diff --git a/instrumentation/events/lttng-module/arch/x86/kvm/mmutrace.h b/instrumentation/events/lttng-module/arch/x86/kvm/mmutrace.h | ||
34 | index 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, | ||
64 | diff --git a/probes/lttng-probe-kvm-x86-mmu.c b/probes/lttng-probe-kvm-x86-mmu.c | ||
65 | index 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 | -- | ||
81 | 2.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 @@ | |||
1 | From bb346792c2cb6995ffc08d2084121935c6384865 Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Jeanson <mjeanson@efficios.com> | ||
3 | Date: Mon, 26 Oct 2020 17:09:05 -0400 | ||
4 | Subject: [PATCH 14/19] fix: tracepoint: Optimize using static_call() (v5.10) | ||
5 | |||
6 | See 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 | |||
24 | Upstream-Status: Backport | ||
25 | |||
26 | Change-Id: I739dd84d62cc1a821b8bd8acff74fa29aa25d22f | ||
27 | Signed-off-by: Michael Jeanson <mjeanson@efficios.com> | ||
28 | Signed-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 | |||
36 | diff --git a/lttng-statedump-impl.c b/lttng-statedump-impl.c | ||
37 | index 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 { | ||
132 | diff --git a/probes/lttng.c b/probes/lttng.c | ||
133 | index 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 | |||
157 | diff --git a/tests/probes/lttng-test.c b/tests/probes/lttng-test.c | ||
158 | index 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 | |||
175 | diff --git a/wrapper/tracepoint.h b/wrapper/tracepoint.h | ||
176 | index 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 | -- | ||
195 | 2.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 @@ | |||
1 | From 31f8bf794172102e9758928b481856c4a8800a7f Mon Sep 17 00:00:00 2001 | ||
2 | From: He Zhe <zhe.he@windriver.com> | ||
3 | Date: Mon, 23 Nov 2020 18:14:25 +0800 | ||
4 | Subject: [PATCH 16/19] fix: statedump: undefined symbols caused by incorrect | ||
5 | patch backport | ||
6 | |||
7 | bb346792c2cb ("fix: tracepoint: Optimize using static_call() (v5.10)") | ||
8 | misses three definitions and causes the following build failures. | ||
9 | |||
10 | ERROR: "__tracepoint_lttng_statedump_process_net_ns" [lttng-statedump.ko] undefined! | ||
11 | ERROR: "__tracepoint_lttng_statedump_process_user_ns" [lttng-statedump.ko] undefined! | ||
12 | ERROR: "__tracepoint_lttng_statedump_process_uts_ns" [lttng-statedump.ko] undefined! | ||
13 | |||
14 | Fixes: #1290 | ||
15 | |||
16 | Upstream-Status: Backport | ||
17 | |||
18 | Signed-off-by: He Zhe <zhe.he@windriver.com> | ||
19 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
20 | --- | ||
21 | lttng-statedump-impl.c | 18 ++++++++++++++++++ | ||
22 | 1 file changed, 18 insertions(+) | ||
23 | |||
24 | diff --git a/lttng-statedump-impl.c b/lttng-statedump-impl.c | ||
25 | index 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 | -- | ||
54 | 2.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 | ||
17 | SRC_URI[sha256sum] = "673ef85c9f03e9b8fed10795e09d4e68add39404b70068d08b10f7b85754d7f0" | 23 | SRC_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 | " |
40 | SRCREV_class-devupstream = "ad594e3a953db1b0c3c059fde45b5a5494f6be78" | 46 | SRCREV_class-devupstream = "be71b60a327d7ad2588abc5cad2861177119972b" |
41 | PV_class-devupstream = "2.12.2+git${SRCPV}" | 47 | PV_class-devupstream = "2.12.3+git${SRCPV}" |
42 | S_class-devupstream = "${WORKDIR}/git" | 48 | S_class-devupstream = "${WORKDIR}/git" |
43 | SRCREV_FORMAT ?= "lttng_git" | 49 | SRCREV_FORMAT ?= "lttng_git" |