diff options
author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2019-03-06 11:37:12 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-03-06 16:44:37 +0000 |
commit | cb3194828a3a83372c222103bfe3c2a61cea16d9 (patch) | |
tree | e8d966a23c12c76d939153d586664f4a01eba8bd /meta | |
parent | 0f2b2b6c9877fbffe2bffddbcb920e1d9aa63c18 (diff) | |
download | poky-cb3194828a3a83372c222103bfe3c2a61cea16d9.tar.gz |
lttng: add 5.x fixup patches to 2.10.8 release
lttng hasn't released 2.10.9, but the stable/2.10 branch
contains changes that we need to build against the 5.0
kernel.
We add them here as patches, and we can drop them in the
future when lttng is updated.
(From OE-Core rev: f8bcf3486d44ebd867e9089d4dbd3b56726c9075)
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
10 files changed, 1350 insertions, 0 deletions
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0001-Fix-signal-Distinguish-between-kernel_siginfo-and-si.patch b/meta/recipes-kernel/lttng/lttng-modules/0001-Fix-signal-Distinguish-between-kernel_siginfo-and-si.patch new file mode 100644 index 0000000000..351184dabb --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0001-Fix-signal-Distinguish-between-kernel_siginfo-and-si.patch | |||
@@ -0,0 +1,133 @@ | |||
1 | From 0a0d736ec89dffdbc83e7181166a99d5563acfe8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Jeanson <mjeanson@efficios.com> | ||
3 | Date: Mon, 5 Nov 2018 11:35:52 -0500 | ||
4 | Subject: [PATCH 1/9] Fix: signal: Distinguish between kernel_siginfo and | ||
5 | siginfo (v4.20) | ||
6 | |||
7 | See upstream commit : | ||
8 | |||
9 | commit ae7795bc6187a15ec51cf258abae656a625f9980 | ||
10 | Author: Eric W. Biederman <ebiederm@xmission.com> | ||
11 | Date: Tue Sep 25 11:27:20 2018 +0200 | ||
12 | |||
13 | signal: Distinguish between kernel_siginfo and siginfo | ||
14 | |||
15 | Linus recently observed that if we did not worry about the padding | ||
16 | member in struct siginfo it is only about 48 bytes, and 48 bytes is | ||
17 | much nicer than 128 bytes for allocating on the stack and copying | ||
18 | around in the kernel. | ||
19 | |||
20 | The obvious thing of only adding the padding when userspace is | ||
21 | including siginfo.h won't work as there are sigframe definitions in | ||
22 | the kernel that embed struct siginfo. | ||
23 | |||
24 | So split siginfo in two; kernel_siginfo and siginfo. Keeping the | ||
25 | traditional name for the userspace definition. While the version that | ||
26 | is used internally to the kernel and ultimately will not be padded to | ||
27 | 128 bytes is called kernel_siginfo. | ||
28 | |||
29 | The definition of struct kernel_siginfo I have put in include/signal_types.h | ||
30 | |||
31 | A set of buildtime checks has been added to verify the two structures have | ||
32 | the same field offsets. | ||
33 | |||
34 | To make it easy to verify the change kernel_siginfo retains the same | ||
35 | size as siginfo. The reduction in size comes in a following change. | ||
36 | |||
37 | Signed-off-by: Michael Jeanson <mjeanson@efficios.com> | ||
38 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
39 | |||
40 | Upstream-Status: backport https://github.com/lttng/lttng-modules/commit/0a0d736ec89dffdbc83e7181166a99d5563acfe8 | ||
41 | |||
42 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
43 | --- | ||
44 | instrumentation/events/lttng-module/signal.h | 41 ++++++++++++++++++-- | ||
45 | 1 file changed, 37 insertions(+), 4 deletions(-) | ||
46 | |||
47 | diff --git a/instrumentation/events/lttng-module/signal.h b/instrumentation/events/lttng-module/signal.h | ||
48 | index b3c9126..8783b52 100644 | ||
49 | --- a/instrumentation/events/lttng-module/signal.h | ||
50 | +++ b/instrumentation/events/lttng-module/signal.h | ||
51 | @@ -35,21 +35,24 @@ | ||
52 | * SEND_SIG_NOINFO means that si_code is SI_USER, and SEND_SIG_PRIV | ||
53 | * means that si_code is SI_KERNEL. | ||
54 | */ | ||
55 | -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) | ||
56 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0)) | ||
57 | LTTNG_TRACEPOINT_EVENT(signal_generate, | ||
58 | |||
59 | - TP_PROTO(int sig, struct siginfo *info, struct task_struct *task), | ||
60 | + TP_PROTO(int sig, struct kernel_siginfo *info, struct task_struct *task, | ||
61 | + int group, int result), | ||
62 | |||
63 | - TP_ARGS(sig, info, task), | ||
64 | + TP_ARGS(sig, info, task, group, result), | ||
65 | |||
66 | TP_FIELDS( | ||
67 | ctf_integer(int, sig, sig) | ||
68 | LTTNG_FIELDS_SIGINFO(info) | ||
69 | ctf_array_text(char, comm, task->comm, TASK_COMM_LEN) | ||
70 | ctf_integer(pid_t, pid, task->pid) | ||
71 | + ctf_integer(int, group, group) | ||
72 | + ctf_integer(int, result, result) | ||
73 | ) | ||
74 | ) | ||
75 | -#else | ||
76 | +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | ||
77 | LTTNG_TRACEPOINT_EVENT(signal_generate, | ||
78 | |||
79 | TP_PROTO(int sig, struct siginfo *info, struct task_struct *task, | ||
80 | @@ -66,6 +69,20 @@ LTTNG_TRACEPOINT_EVENT(signal_generate, | ||
81 | ctf_integer(int, result, result) | ||
82 | ) | ||
83 | ) | ||
84 | +#else | ||
85 | +LTTNG_TRACEPOINT_EVENT(signal_generate, | ||
86 | + | ||
87 | + TP_PROTO(int sig, struct siginfo *info, struct task_struct *task), | ||
88 | + | ||
89 | + TP_ARGS(sig, info, task), | ||
90 | + | ||
91 | + TP_FIELDS( | ||
92 | + ctf_integer(int, sig, sig) | ||
93 | + LTTNG_FIELDS_SIGINFO(info) | ||
94 | + ctf_array_text(char, comm, task->comm, TASK_COMM_LEN) | ||
95 | + ctf_integer(pid_t, pid, task->pid) | ||
96 | + ) | ||
97 | +) | ||
98 | #endif | ||
99 | |||
100 | /** | ||
101 | @@ -82,6 +99,21 @@ LTTNG_TRACEPOINT_EVENT(signal_generate, | ||
102 | * This means, this can show which signals are actually delivered, but | ||
103 | * matching generated signals and delivered signals may not be correct. | ||
104 | */ | ||
105 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0)) | ||
106 | +LTTNG_TRACEPOINT_EVENT(signal_deliver, | ||
107 | + | ||
108 | + TP_PROTO(int sig, struct kernel_siginfo *info, struct k_sigaction *ka), | ||
109 | + | ||
110 | + TP_ARGS(sig, info, ka), | ||
111 | + | ||
112 | + TP_FIELDS( | ||
113 | + ctf_integer(int, sig, sig) | ||
114 | + LTTNG_FIELDS_SIGINFO(info) | ||
115 | + ctf_integer(unsigned long, sa_handler, (unsigned long) ka->sa.sa_handler) | ||
116 | + ctf_integer(unsigned long, sa_flags, ka->sa.sa_flags) | ||
117 | + ) | ||
118 | +) | ||
119 | +#else | ||
120 | LTTNG_TRACEPOINT_EVENT(signal_deliver, | ||
121 | |||
122 | TP_PROTO(int sig, struct siginfo *info, struct k_sigaction *ka), | ||
123 | @@ -95,6 +127,7 @@ LTTNG_TRACEPOINT_EVENT(signal_deliver, | ||
124 | ctf_integer(unsigned long, sa_flags, ka->sa.sa_flags) | ||
125 | ) | ||
126 | ) | ||
127 | +#endif | ||
128 | |||
129 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) | ||
130 | LTTNG_TRACEPOINT_EVENT_CLASS(signal_queue_overflow, | ||
131 | -- | ||
132 | 2.19.1 | ||
133 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0002-Fix-signal-Remove-SEND_SIG_FORCED-v4.20.patch b/meta/recipes-kernel/lttng/lttng-modules/0002-Fix-signal-Remove-SEND_SIG_FORCED-v4.20.patch new file mode 100644 index 0000000000..905b68165b --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0002-Fix-signal-Remove-SEND_SIG_FORCED-v4.20.patch | |||
@@ -0,0 +1,67 @@ | |||
1 | From 26bc064a4d4c85e6000393aadb38659f99b59162 Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Jeanson <mjeanson@efficios.com> | ||
3 | Date: Mon, 5 Nov 2018 11:35:53 -0500 | ||
4 | Subject: [PATCH 2/9] Fix: signal: Remove SEND_SIG_FORCED (v4.20) | ||
5 | |||
6 | See upstream commit : | ||
7 | |||
8 | commit 4ff4c31a6e85f4c49fbeebeaa28018d002884b5a | ||
9 | Author: Eric W. Biederman <ebiederm@xmission.com> | ||
10 | Date: Mon Sep 3 10:39:04 2018 +0200 | ||
11 | |||
12 | signal: Remove SEND_SIG_FORCED | ||
13 | |||
14 | There are no more users of SEND_SIG_FORCED so it may be safely removed. | ||
15 | |||
16 | Remove the definition of SEND_SIG_FORCED, it's use in is_si_special, | ||
17 | it's use in TP_STORE_SIGINFO, and it's use in __send_signal as without | ||
18 | any users the uses of SEND_SIG_FORCED are now unncessary. | ||
19 | |||
20 | This makes the code simpler, easier to understand and use. Users of | ||
21 | signal sending functions now no longer need to ask themselves do I | ||
22 | need to use SEND_SIG_FORCED. | ||
23 | |||
24 | Signed-off-by: Michael Jeanson <mjeanson@efficios.com> | ||
25 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
26 | |||
27 | Upstream-Status: backport https://github.com/lttng/lttng-modules/commit/26bc064a4d4c85e6000393aadb38659f99b59162 | ||
28 | |||
29 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
30 | |||
31 | --- | ||
32 | instrumentation/events/lttng-module/signal.h | 12 ++++++++++++ | ||
33 | 1 file changed, 12 insertions(+) | ||
34 | |||
35 | diff --git a/instrumentation/events/lttng-module/signal.h b/instrumentation/events/lttng-module/signal.h | ||
36 | index 8783b52..ad8fe69 100644 | ||
37 | --- a/instrumentation/events/lttng-module/signal.h | ||
38 | +++ b/instrumentation/events/lttng-module/signal.h | ||
39 | @@ -12,6 +12,17 @@ | ||
40 | #include <linux/signal.h> | ||
41 | #include <linux/sched.h> | ||
42 | #undef LTTNG_FIELDS_SIGINFO | ||
43 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0)) | ||
44 | +#define LTTNG_FIELDS_SIGINFO(info) \ | ||
45 | + ctf_integer(int, errno, \ | ||
46 | + (info == SEND_SIG_NOINFO || info == SEND_SIG_PRIV) ? \ | ||
47 | + 0 : \ | ||
48 | + info->si_errno) \ | ||
49 | + ctf_integer(int, code, \ | ||
50 | + (info == SEND_SIG_NOINFO) ? \ | ||
51 | + SI_USER : \ | ||
52 | + ((info == SEND_SIG_PRIV) ? SI_KERNEL : info->si_code)) | ||
53 | +#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) */ | ||
54 | #define LTTNG_FIELDS_SIGINFO(info) \ | ||
55 | ctf_integer(int, errno, \ | ||
56 | (info == SEND_SIG_NOINFO || info == SEND_SIG_FORCED || info == SEND_SIG_PRIV) ? \ | ||
57 | @@ -21,6 +32,7 @@ | ||
58 | (info == SEND_SIG_NOINFO || info == SEND_SIG_FORCED) ? \ | ||
59 | SI_USER : \ | ||
60 | ((info == SEND_SIG_PRIV) ? SI_KERNEL : info->si_code)) | ||
61 | +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) */ | ||
62 | #endif /* _TRACE_SIGNAL_DEF */ | ||
63 | |||
64 | /** | ||
65 | -- | ||
66 | 2.19.1 | ||
67 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0003-Fix-ext4-adjust-reserved-cluster-count-when-removing.patch b/meta/recipes-kernel/lttng/lttng-modules/0003-Fix-ext4-adjust-reserved-cluster-count-when-removing.patch new file mode 100644 index 0000000000..7edffee542 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0003-Fix-ext4-adjust-reserved-cluster-count-when-removing.patch | |||
@@ -0,0 +1,149 @@ | |||
1 | From cb9f1a821bcf55cecf3813195fd6d4eff8070927 Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Jeanson <mjeanson@efficios.com> | ||
3 | Date: Mon, 5 Nov 2018 11:35:54 -0500 | ||
4 | Subject: [PATCH 3/9] Fix: ext4: adjust reserved cluster count when removing | ||
5 | extents (v4.20) | ||
6 | |||
7 | See upstream commit : | ||
8 | |||
9 | commit 9fe671496b6c286f9033aedfc1718d67721da0ae | ||
10 | Author: Eric Whitney <enwlinux@gmail.com> | ||
11 | Date: Mon Oct 1 14:25:08 2018 -0400 | ||
12 | |||
13 | ext4: adjust reserved cluster count when removing extents | ||
14 | |||
15 | Modify ext4_ext_remove_space() and the code it calls to correct the | ||
16 | reserved cluster count for pending reservations (delayed allocated | ||
17 | clusters shared with allocated blocks) when a block range is removed | ||
18 | from the extent tree. Pending reservations may be found for the clusters | ||
19 | at the ends of written or unwritten extents when a block range is removed. | ||
20 | If a physical cluster at the end of an extent is freed, it's necessary | ||
21 | to increment the reserved cluster count to maintain correct accounting | ||
22 | if the corresponding logical cluster is shared with at least one | ||
23 | delayed and unwritten extent as found in the extents status tree. | ||
24 | |||
25 | Add a new function, ext4_rereserve_cluster(), to reapply a reservation | ||
26 | on a delayed allocated cluster sharing blocks with a freed allocated | ||
27 | cluster. To avoid ENOSPC on reservation, a flag is applied to | ||
28 | ext4_free_blocks() to briefly defer updating the freeclusters counter | ||
29 | when an allocated cluster is freed. This prevents another thread | ||
30 | from allocating the freed block before the reservation can be reapplied. | ||
31 | |||
32 | Redefine the partial cluster object as a struct to carry more state | ||
33 | information and to clarify the code using it. | ||
34 | |||
35 | Adjust the conditional code structure in ext4_ext_remove_space to | ||
36 | reduce the indentation level in the main body of the code to improve | ||
37 | readability. | ||
38 | |||
39 | Signed-off-by: Michael Jeanson <mjeanson@efficios.com> | ||
40 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
41 | |||
42 | Upstream-Status: backport https://github.com/lttng/lttng-modules/commit/cb9f1a821bcf55cecf3813195fd6d4eff8070927 | ||
43 | |||
44 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
45 | |||
46 | --- | ||
47 | instrumentation/events/lttng-module/ext4.h | 72 +++++++++++++++++++++- | ||
48 | 1 file changed, 69 insertions(+), 3 deletions(-) | ||
49 | |||
50 | diff --git a/instrumentation/events/lttng-module/ext4.h b/instrumentation/events/lttng-module/ext4.h | ||
51 | index fe6f802..83a80ba 100644 | ||
52 | --- a/instrumentation/events/lttng-module/ext4.h | ||
53 | +++ b/instrumentation/events/lttng-module/ext4.h | ||
54 | @@ -1602,7 +1602,30 @@ LTTNG_TRACEPOINT_EVENT(ext4_ext_show_extent, | ||
55 | ) | ||
56 | ) | ||
57 | |||
58 | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) | ||
59 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0)) | ||
60 | + | ||
61 | +LTTNG_TRACEPOINT_EVENT(ext4_remove_blocks, | ||
62 | + TP_PROTO(struct inode *inode, struct ext4_extent *ex, | ||
63 | + ext4_lblk_t from, ext4_fsblk_t to, | ||
64 | + struct partial_cluster *pc), | ||
65 | + | ||
66 | + TP_ARGS(inode, ex, from, to, pc), | ||
67 | + | ||
68 | + TP_FIELDS( | ||
69 | + ctf_integer(dev_t, dev, inode->i_sb->s_dev) | ||
70 | + ctf_integer(ino_t, ino, inode->i_ino) | ||
71 | + ctf_integer(ext4_lblk_t, from, from) | ||
72 | + ctf_integer(ext4_lblk_t, to, to) | ||
73 | + ctf_integer(ext4_fsblk_t, ee_pblk, ext4_ext_pblock(ex)) | ||
74 | + ctf_integer(ext4_lblk_t, ee_lblk, le32_to_cpu(ex->ee_block)) | ||
75 | + ctf_integer(unsigned short, ee_len, ext4_ext_get_actual_len(ex)) | ||
76 | + ctf_integer(ext4_fsblk_t, pc_pclu, pc->pclu) | ||
77 | + ctf_integer(ext4_lblk_t, pc_lblk, pc->lblk) | ||
78 | + ctf_integer(int, pc_state, pc->state) | ||
79 | + ) | ||
80 | +) | ||
81 | + | ||
82 | +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) | ||
83 | |||
84 | LTTNG_TRACEPOINT_EVENT(ext4_remove_blocks, | ||
85 | TP_PROTO(struct inode *inode, struct ext4_extent *ex, | ||
86 | @@ -1646,7 +1669,29 @@ LTTNG_TRACEPOINT_EVENT(ext4_remove_blocks, | ||
87 | |||
88 | #endif | ||
89 | |||
90 | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) | ||
91 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0)) | ||
92 | + | ||
93 | +LTTNG_TRACEPOINT_EVENT(ext4_ext_rm_leaf, | ||
94 | + TP_PROTO(struct inode *inode, ext4_lblk_t start, | ||
95 | + struct ext4_extent *ex, | ||
96 | + struct partial_cluster *pc), | ||
97 | + | ||
98 | + TP_ARGS(inode, start, ex, pc), | ||
99 | + | ||
100 | + TP_FIELDS( | ||
101 | + ctf_integer(dev_t, dev, inode->i_sb->s_dev) | ||
102 | + ctf_integer(ino_t, ino, inode->i_ino) | ||
103 | + ctf_integer(ext4_lblk_t, start, start) | ||
104 | + ctf_integer(ext4_lblk_t, ee_lblk, le32_to_cpu(ex->ee_block)) | ||
105 | + ctf_integer(ext4_fsblk_t, ee_pblk, ext4_ext_pblock(ex)) | ||
106 | + ctf_integer(short, ee_len, ext4_ext_get_actual_len(ex)) | ||
107 | + ctf_integer(ext4_fsblk_t, pc_pclu, pc->pclu) | ||
108 | + ctf_integer(ext4_lblk_t, pc_lblk, pc->lblk) | ||
109 | + ctf_integer(int, pc_state, pc->state) | ||
110 | + ) | ||
111 | +) | ||
112 | + | ||
113 | +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) | ||
114 | |||
115 | LTTNG_TRACEPOINT_EVENT(ext4_ext_rm_leaf, | ||
116 | TP_PROTO(struct inode *inode, ext4_lblk_t start, | ||
117 | @@ -1733,7 +1778,28 @@ LTTNG_TRACEPOINT_EVENT(ext4_ext_remove_space, | ||
118 | |||
119 | #endif | ||
120 | |||
121 | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) | ||
122 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0)) | ||
123 | + | ||
124 | +LTTNG_TRACEPOINT_EVENT(ext4_ext_remove_space_done, | ||
125 | + TP_PROTO(struct inode *inode, ext4_lblk_t start, ext4_lblk_t end, | ||
126 | + int depth, struct partial_cluster *pc, __le16 eh_entries), | ||
127 | + | ||
128 | + TP_ARGS(inode, start, end, depth, pc, eh_entries), | ||
129 | + | ||
130 | + TP_FIELDS( | ||
131 | + ctf_integer(dev_t, dev, inode->i_sb->s_dev) | ||
132 | + ctf_integer(ino_t, ino, inode->i_ino) | ||
133 | + ctf_integer(ext4_lblk_t, start, start) | ||
134 | + ctf_integer(ext4_lblk_t, end, end) | ||
135 | + ctf_integer(int, depth, depth) | ||
136 | + ctf_integer(unsigned short, eh_entries, le16_to_cpu(eh_entries)) | ||
137 | + ctf_integer(ext4_fsblk_t, pc_pclu, pc->pclu) | ||
138 | + ctf_integer(ext4_lblk_t, pc_lblk, pc->lblk) | ||
139 | + ctf_integer(int, pc_state, pc->state) | ||
140 | + ) | ||
141 | +) | ||
142 | + | ||
143 | +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) | ||
144 | |||
145 | LTTNG_TRACEPOINT_EVENT(ext4_ext_remove_space_done, | ||
146 | TP_PROTO(struct inode *inode, ext4_lblk_t start, ext4_lblk_t end, | ||
147 | -- | ||
148 | 2.19.1 | ||
149 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0004-Fix-timer-instrumentation-for-RHEL-7.6.patch b/meta/recipes-kernel/lttng/lttng-modules/0004-Fix-timer-instrumentation-for-RHEL-7.6.patch new file mode 100644 index 0000000000..b5d50dba1c --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0004-Fix-timer-instrumentation-for-RHEL-7.6.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | From 4eaeb54a27fbf701c2a4908a6e90a978b93deb06 Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Jeanson <mjeanson@efficios.com> | ||
3 | Date: Thu, 6 Dec 2018 11:31:51 -0500 | ||
4 | Subject: [PATCH 4/9] Fix: timer instrumentation for RHEL 7.6 | ||
5 | |||
6 | Signed-off-by: Michael Jeanson <mjeanson@efficios.com> | ||
7 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
8 | |||
9 | Upstream-Status: backport https://github.com/lttng/lttng-modules/commit/4eaeb54a27fbf701c2a4908a6e90a978b93deb06 | ||
10 | |||
11 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
12 | --- | ||
13 | instrumentation/events/lttng-module/timer.h | 3 ++- | ||
14 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/instrumentation/events/lttng-module/timer.h b/instrumentation/events/lttng-module/timer.h | ||
17 | index 6f0cb7f..8807ad5 100644 | ||
18 | --- a/instrumentation/events/lttng-module/timer.h | ||
19 | +++ b/instrumentation/events/lttng-module/timer.h | ||
20 | @@ -44,7 +44,8 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(timer_class, timer_init, | ||
21 | TP_ARGS(timer) | ||
22 | ) | ||
23 | |||
24 | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) | ||
25 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) || \ | ||
26 | + LTTNG_RHEL_KERNEL_RANGE(3,10,0,957,0,0, 3,11,0,0,0,0)) | ||
27 | /** | ||
28 | * timer_start - called when the timer is started | ||
29 | * @timer: pointer to struct timer_list | ||
30 | -- | ||
31 | 2.19.1 | ||
32 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0005-Fix-Remove-type-argument-from-access_ok-function-v5..patch b/meta/recipes-kernel/lttng/lttng-modules/0005-Fix-Remove-type-argument-from-access_ok-function-v5..patch new file mode 100644 index 0000000000..2266bbd9e0 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0005-Fix-Remove-type-argument-from-access_ok-function-v5..patch | |||
@@ -0,0 +1,204 @@ | |||
1 | From 0039dbe9891cfdf2c0d04691f83c2f342993dfd7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Jeanson <mjeanson@efficios.com> | ||
3 | Date: Wed, 9 Jan 2019 14:59:15 -0500 | ||
4 | Subject: [PATCH 5/9] Fix: Remove 'type' argument from access_ok() function | ||
5 | (v5.0) | ||
6 | |||
7 | See upstream commit : | ||
8 | |||
9 | commit 96d4f267e40f9509e8a66e2b39e8b95655617693 | ||
10 | Author: Linus Torvalds <torvalds@linux-foundation.org> | ||
11 | Date: Thu Jan 3 18:57:57 2019 -0800 | ||
12 | |||
13 | Remove 'type' argument from access_ok() function | ||
14 | |||
15 | Nobody has actually used the type (VERIFY_READ vs VERIFY_WRITE) argument | ||
16 | of the user address range verification function since we got rid of the | ||
17 | old racy i386-only code to walk page tables by hand. | ||
18 | |||
19 | It existed because the original 80386 would not honor the write protect | ||
20 | bit when in kernel mode, so you had to do COW by hand before doing any | ||
21 | user access. But we haven't supported that in a long time, and these | ||
22 | days the 'type' argument is a purely historical artifact. | ||
23 | |||
24 | A discussion about extending 'user_access_begin()' to do the range | ||
25 | checking resulted this patch, because there is no way we're going to | ||
26 | move the old VERIFY_xyz interface to that model. And it's best done at | ||
27 | the end of the merge window when I've done most of my merges, so let's | ||
28 | just get this done once and for all. | ||
29 | |||
30 | This patch was mostly done with a sed-script, with manual fix-ups for | ||
31 | the cases that weren't of the trivial 'access_ok(VERIFY_xyz' form. | ||
32 | |||
33 | There were a couple of notable cases: | ||
34 | |||
35 | - csky still had the old "verify_area()" name as an alias. | ||
36 | |||
37 | - the iter_iov code had magical hardcoded knowledge of the actual | ||
38 | values of VERIFY_{READ,WRITE} (not that they mattered, since nothing | ||
39 | really used it) | ||
40 | |||
41 | - microblaze used the type argument for a debug printout | ||
42 | |||
43 | but other than those oddities this should be a total no-op patch. | ||
44 | |||
45 | I tried to fix up all architectures, did fairly extensive grepping for | ||
46 | access_ok() uses, and the changes are trivial, but I may have missed | ||
47 | something. Any missed conversion should be trivially fixable, though. | ||
48 | |||
49 | Signed-off-by: Michael Jeanson <mjeanson@efficios.com> | ||
50 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
51 | |||
52 | Upstream-Status: backport https://github.com/lttng/lttng-modules/commit/0039dbe9891cfdf2c0d04691f83c2f342993dfd7 | ||
53 | |||
54 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
55 | --- | ||
56 | lib/ringbuffer/backend.h | 8 ++++---- | ||
57 | lib/ringbuffer/ring_buffer_iterator.c | 3 ++- | ||
58 | lttng-filter-interpreter.c | 4 ++-- | ||
59 | probes/lttng-probe-user.c | 3 ++- | ||
60 | wrapper/uaccess.h | 28 +++++++++++++++++++++++++++ | ||
61 | 5 files changed, 38 insertions(+), 8 deletions(-) | ||
62 | create mode 100644 wrapper/uaccess.h | ||
63 | |||
64 | diff --git a/lib/ringbuffer/backend.h b/lib/ringbuffer/backend.h | ||
65 | index 0b75de8..3f8c108 100644 | ||
66 | --- a/lib/ringbuffer/backend.h | ||
67 | +++ b/lib/ringbuffer/backend.h | ||
68 | @@ -34,7 +34,7 @@ | ||
69 | #include <linux/list.h> | ||
70 | #include <linux/fs.h> | ||
71 | #include <linux/mm.h> | ||
72 | -#include <linux/uaccess.h> | ||
73 | +#include <wrapper/uaccess.h> | ||
74 | |||
75 | /* Internal helpers */ | ||
76 | #include <wrapper/ringbuffer/backend_internal.h> | ||
77 | @@ -302,7 +302,7 @@ void lib_ring_buffer_copy_from_user_inatomic(const struct lib_ring_buffer_config | ||
78 | |||
79 | set_fs(KERNEL_DS); | ||
80 | pagefault_disable(); | ||
81 | - if (unlikely(!access_ok(VERIFY_READ, src, len))) | ||
82 | + if (unlikely(!lttng_access_ok(VERIFY_READ, src, len))) | ||
83 | goto fill_buffer; | ||
84 | |||
85 | if (likely(pagecpy == len)) { | ||
86 | @@ -372,7 +372,7 @@ void lib_ring_buffer_strcpy_from_user_inatomic(const struct lib_ring_buffer_conf | ||
87 | |||
88 | set_fs(KERNEL_DS); | ||
89 | pagefault_disable(); | ||
90 | - if (unlikely(!access_ok(VERIFY_READ, src, len))) | ||
91 | + if (unlikely(!lttng_access_ok(VERIFY_READ, src, len))) | ||
92 | goto fill_buffer; | ||
93 | |||
94 | if (likely(pagecpy == len)) { | ||
95 | @@ -462,7 +462,7 @@ unsigned long lib_ring_buffer_copy_from_user_check_nofault(void *dest, | ||
96 | unsigned long ret; | ||
97 | mm_segment_t old_fs; | ||
98 | |||
99 | - if (!access_ok(VERIFY_READ, src, len)) | ||
100 | + if (!lttng_access_ok(VERIFY_READ, src, len)) | ||
101 | return 1; | ||
102 | old_fs = get_fs(); | ||
103 | set_fs(KERNEL_DS); | ||
104 | diff --git a/lib/ringbuffer/ring_buffer_iterator.c b/lib/ringbuffer/ring_buffer_iterator.c | ||
105 | index 61eaa5b..9645946 100644 | ||
106 | --- a/lib/ringbuffer/ring_buffer_iterator.c | ||
107 | +++ b/lib/ringbuffer/ring_buffer_iterator.c | ||
108 | @@ -27,6 +27,7 @@ | ||
109 | |||
110 | #include <wrapper/ringbuffer/iterator.h> | ||
111 | #include <wrapper/file.h> | ||
112 | +#include <wrapper/uaccess.h> | ||
113 | #include <linux/jiffies.h> | ||
114 | #include <linux/delay.h> | ||
115 | #include <linux/module.h> | ||
116 | @@ -621,7 +622,7 @@ ssize_t channel_ring_buffer_file_read(struct file *filp, | ||
117 | ssize_t len; | ||
118 | |||
119 | might_sleep(); | ||
120 | - if (!access_ok(VERIFY_WRITE, user_buf, count)) | ||
121 | + if (!lttng_access_ok(VERIFY_WRITE, user_buf, count)) | ||
122 | return -EFAULT; | ||
123 | |||
124 | /* Finish copy of previous record */ | ||
125 | diff --git a/lttng-filter-interpreter.c b/lttng-filter-interpreter.c | ||
126 | index e131462..bee2918 100644 | ||
127 | --- a/lttng-filter-interpreter.c | ||
128 | +++ b/lttng-filter-interpreter.c | ||
129 | @@ -24,7 +24,7 @@ | ||
130 | * SOFTWARE. | ||
131 | */ | ||
132 | |||
133 | -#include <linux/uaccess.h> | ||
134 | +#include <wrapper/uaccess.h> | ||
135 | #include <wrapper/frame.h> | ||
136 | #include <wrapper/types.h> | ||
137 | |||
138 | @@ -46,7 +46,7 @@ char get_char(struct estack_entry *reg, size_t offset) | ||
139 | char c; | ||
140 | |||
141 | /* Handle invalid access as end of string. */ | ||
142 | - if (unlikely(!access_ok(VERIFY_READ, | ||
143 | + if (unlikely(!lttng_access_ok(VERIFY_READ, | ||
144 | reg->u.s.user_str + offset, | ||
145 | sizeof(c)))) | ||
146 | return '\0'; | ||
147 | diff --git a/probes/lttng-probe-user.c b/probes/lttng-probe-user.c | ||
148 | index 099a66b..ed566dd 100644 | ||
149 | --- a/probes/lttng-probe-user.c | ||
150 | +++ b/probes/lttng-probe-user.c | ||
151 | @@ -20,6 +20,7 @@ | ||
152 | |||
153 | #include <linux/uaccess.h> | ||
154 | #include <linux/module.h> | ||
155 | +#include <wrapper/uaccess.h> | ||
156 | #include <probes/lttng-probe-user.h> | ||
157 | |||
158 | /* | ||
159 | @@ -43,7 +44,7 @@ long lttng_strlen_user_inatomic(const char *addr) | ||
160 | char v; | ||
161 | unsigned long ret; | ||
162 | |||
163 | - if (unlikely(!access_ok(VERIFY_READ, | ||
164 | + if (unlikely(!lttng_access_ok(VERIFY_READ, | ||
165 | (__force const char __user *) addr, | ||
166 | sizeof(v)))) | ||
167 | break; | ||
168 | diff --git a/wrapper/uaccess.h b/wrapper/uaccess.h | ||
169 | new file mode 100644 | ||
170 | index 0000000..c56427c | ||
171 | --- /dev/null | ||
172 | +++ b/wrapper/uaccess.h | ||
173 | @@ -0,0 +1,28 @@ | ||
174 | +/* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1) | ||
175 | + * | ||
176 | + * wrapper/uaccess.h | ||
177 | + * | ||
178 | + * wrapper around linux/uaccess.h. | ||
179 | + * | ||
180 | + * Copyright (C) 2019 Michael Jeanson <mjeanson@efficios.com> | ||
181 | + */ | ||
182 | + | ||
183 | +#ifndef _LTTNG_WRAPPER_UACCESS_H | ||
184 | +#define _LTTNG_WRAPPER_UACCESS_H | ||
185 | + | ||
186 | +#include <linux/uaccess.h> | ||
187 | +#include <lttng-kernel-version.h> | ||
188 | + | ||
189 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)) | ||
190 | + | ||
191 | +#define VERIFY_READ 0 | ||
192 | +#define VERIFY_WRITE 1 | ||
193 | +#define lttng_access_ok(type, addr, size) access_ok(addr, size) | ||
194 | + | ||
195 | +#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) */ | ||
196 | + | ||
197 | +#define lttng_access_ok(type, addr, size) access_ok(type, addr, size) | ||
198 | + | ||
199 | +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) */ | ||
200 | + | ||
201 | +#endif /* _LTTNG_WRAPPER_UACCESS_H */ | ||
202 | -- | ||
203 | 2.19.1 | ||
204 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0006-Fix-Replace-pointer-values-with-task-tk_pid-and-rpc_.patch b/meta/recipes-kernel/lttng/lttng-modules/0006-Fix-Replace-pointer-values-with-task-tk_pid-and-rpc_.patch new file mode 100644 index 0000000000..089486f51b --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0006-Fix-Replace-pointer-values-with-task-tk_pid-and-rpc_.patch | |||
@@ -0,0 +1,186 @@ | |||
1 | From 89f0be35e1baf411df6852014013ac64ad1bbcf8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Jeanson <mjeanson@efficios.com> | ||
3 | Date: Wed, 9 Jan 2019 14:59:16 -0500 | ||
4 | Subject: [PATCH 6/9] Fix: Replace pointer values with task->tk_pid and | ||
5 | rpc_clnt->cl_clid | ||
6 | |||
7 | Introduced in v3.12. | ||
8 | |||
9 | See upstream commit : | ||
10 | |||
11 | commit 92cb6c5be8134db6f7c38f25f6afd13e444cebaf | ||
12 | Author: Trond Myklebust <Trond.Myklebust@netapp.com> | ||
13 | Date: Wed Sep 4 22:09:50 2013 -0400 | ||
14 | |||
15 | SUNRPC: Replace pointer values with task->tk_pid and rpc_clnt->cl_clid | ||
16 | |||
17 | Instead of the pointer values, use the task and client identifier values | ||
18 | for tracing purposes. | ||
19 | |||
20 | Signed-off-by: Michael Jeanson <mjeanson@efficios.com> | ||
21 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
22 | |||
23 | Upstream-Status: backport https://github.com/lttng/lttng-modules/commit/89f0be35e1baf411df6852014013ac64ad1bbcf8 | ||
24 | |||
25 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
26 | --- | ||
27 | instrumentation/events/lttng-module/rpc.h | 108 ++++++++++++++++++++-- | ||
28 | 1 file changed, 102 insertions(+), 6 deletions(-) | ||
29 | |||
30 | diff --git a/instrumentation/events/lttng-module/rpc.h b/instrumentation/events/lttng-module/rpc.h | ||
31 | index b9e45fe..a4ac557 100644 | ||
32 | --- a/instrumentation/events/lttng-module/rpc.h | ||
33 | +++ b/instrumentation/events/lttng-module/rpc.h | ||
34 | @@ -8,6 +8,20 @@ | ||
35 | #include <linux/sunrpc/sched.h> | ||
36 | #include <linux/sunrpc/clnt.h> | ||
37 | |||
38 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | ||
39 | +LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, | ||
40 | + | ||
41 | + TP_PROTO(struct rpc_task *task), | ||
42 | + | ||
43 | + TP_ARGS(task), | ||
44 | + | ||
45 | + TP_FIELDS( | ||
46 | + ctf_integer(unsigned int, task_id, task->tk_pid) | ||
47 | + ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) | ||
48 | + ctf_integer(int, status, task->tk_status) | ||
49 | + ) | ||
50 | +) | ||
51 | +#else | ||
52 | LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, | ||
53 | |||
54 | TP_PROTO(struct rpc_task *task), | ||
55 | @@ -20,6 +34,7 @@ LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, | ||
56 | ctf_integer(int, status, task->tk_status) | ||
57 | ) | ||
58 | ) | ||
59 | +#endif | ||
60 | |||
61 | LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status, | ||
62 | TP_PROTO(struct rpc_task *task), | ||
63 | @@ -40,8 +55,8 @@ LTTNG_TRACEPOINT_EVENT(rpc_connect_status, | ||
64 | TP_ARGS(task), | ||
65 | |||
66 | TP_FIELDS( | ||
67 | - ctf_integer_hex(const struct rpc_task *, task, task) | ||
68 | - ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client) | ||
69 | + ctf_integer(unsigned int, task_id, task->tk_pid) | ||
70 | + ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) | ||
71 | ctf_integer(int, status, task->tk_status) | ||
72 | ) | ||
73 | ) | ||
74 | @@ -53,8 +68,8 @@ LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running, | ||
75 | TP_ARGS(task, action), | ||
76 | |||
77 | TP_FIELDS( | ||
78 | - ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client) | ||
79 | - ctf_integer_hex(const struct rpc_task *, task, task) | ||
80 | + ctf_integer(unsigned int, task_id, task->tk_pid) | ||
81 | + ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) | ||
82 | ctf_integer_hex(const void *, action, action) | ||
83 | ctf_integer(unsigned long, runstate, task->tk_runstate) | ||
84 | ctf_integer(int, status, task->tk_status) | ||
85 | @@ -90,8 +105,8 @@ LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued, | ||
86 | TP_ARGS(task, q), | ||
87 | |||
88 | TP_FIELDS( | ||
89 | - ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client) | ||
90 | - ctf_integer_hex(const struct rpc_task *, task, task) | ||
91 | + ctf_integer(unsigned int, task_id, task->tk_pid) | ||
92 | + ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) | ||
93 | ctf_integer(unsigned long, timeout, task->tk_timeout) | ||
94 | ctf_integer(unsigned long, runstate, task->tk_runstate) | ||
95 | ctf_integer(int, status, task->tk_status) | ||
96 | @@ -114,6 +129,87 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup, | ||
97 | TP_ARGS(task, q) | ||
98 | ) | ||
99 | |||
100 | +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | ||
101 | +LTTNG_TRACEPOINT_EVENT(rpc_connect_status, | ||
102 | + TP_PROTO(struct rpc_task *task, int status), | ||
103 | + | ||
104 | + TP_ARGS(task, status), | ||
105 | + | ||
106 | + TP_FIELDS( | ||
107 | + ctf_integer(unsigned int, task_id, task->tk_pid) | ||
108 | + ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) | ||
109 | + ctf_integer(int, status, status) | ||
110 | + ) | ||
111 | +) | ||
112 | + | ||
113 | +LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running, | ||
114 | + | ||
115 | + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), | ||
116 | + | ||
117 | + TP_ARGS(clnt, task, action), | ||
118 | + | ||
119 | + TP_FIELDS( | ||
120 | + ctf_integer(unsigned int, task_id, task->tk_pid) | ||
121 | + ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) | ||
122 | + ctf_integer_hex(const void *, action, action) | ||
123 | + ctf_integer(unsigned long, runstate, task->tk_runstate) | ||
124 | + ctf_integer(int, status, task->tk_status) | ||
125 | + ctf_integer(unsigned short, flags, task->tk_flags) | ||
126 | + ) | ||
127 | +) | ||
128 | + | ||
129 | +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_begin, | ||
130 | + | ||
131 | + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), | ||
132 | + | ||
133 | + TP_ARGS(clnt, task, action) | ||
134 | +) | ||
135 | + | ||
136 | +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_run_action, | ||
137 | + | ||
138 | + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), | ||
139 | + | ||
140 | + TP_ARGS(clnt, task, action) | ||
141 | +) | ||
142 | + | ||
143 | +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_complete, | ||
144 | + | ||
145 | + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), | ||
146 | + | ||
147 | + TP_ARGS(clnt, task, action) | ||
148 | +) | ||
149 | + | ||
150 | +LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued, | ||
151 | + | ||
152 | + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), | ||
153 | + | ||
154 | + TP_ARGS(clnt, task, q), | ||
155 | + | ||
156 | + TP_FIELDS( | ||
157 | + ctf_integer(unsigned int, task_id, task->tk_pid) | ||
158 | + ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) | ||
159 | + ctf_integer(unsigned long, timeout, task->tk_timeout) | ||
160 | + ctf_integer(unsigned long, runstate, task->tk_runstate) | ||
161 | + ctf_integer(int, status, task->tk_status) | ||
162 | + ctf_integer(unsigned short, flags, task->tk_flags) | ||
163 | + ctf_string(q_name, rpc_qname(q)) | ||
164 | + ) | ||
165 | +) | ||
166 | + | ||
167 | +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_sleep, | ||
168 | + | ||
169 | + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), | ||
170 | + | ||
171 | + TP_ARGS(clnt, task, q) | ||
172 | +) | ||
173 | + | ||
174 | +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup, | ||
175 | + | ||
176 | + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), | ||
177 | + | ||
178 | + TP_ARGS(clnt, task, q) | ||
179 | +) | ||
180 | + | ||
181 | #else | ||
182 | LTTNG_TRACEPOINT_EVENT(rpc_connect_status, | ||
183 | TP_PROTO(struct rpc_task *task, int status), | ||
184 | -- | ||
185 | 2.19.1 | ||
186 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0007-Fix-SUNRPC-Simplify-defining-common-RPC-trace-events.patch b/meta/recipes-kernel/lttng/lttng-modules/0007-Fix-SUNRPC-Simplify-defining-common-RPC-trace-events.patch new file mode 100644 index 0000000000..f3673301de --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0007-Fix-SUNRPC-Simplify-defining-common-RPC-trace-events.patch | |||
@@ -0,0 +1,183 @@ | |||
1 | From d11b568681f87c2df6ecb0516d3f16d153f24bd2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Jeanson <mjeanson@efficios.com> | ||
3 | Date: Wed, 9 Jan 2019 14:59:17 -0500 | ||
4 | Subject: [PATCH 7/9] Fix: SUNRPC: Simplify defining common RPC trace events | ||
5 | (v5.0) | ||
6 | |||
7 | See upstream commit : | ||
8 | |||
9 | commit dc5820bd21d84ee34770b0a1e2fca9378f8f7456 | ||
10 | Author: Chuck Lever <chuck.lever@oracle.com> | ||
11 | Date: Wed Dec 19 11:00:16 2018 -0500 | ||
12 | |||
13 | SUNRPC: Simplify defining common RPC trace events | ||
14 | |||
15 | Clean up, no functional change is expected. | ||
16 | |||
17 | Signed-off-by: Michael Jeanson <mjeanson@efficios.com> | ||
18 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
19 | |||
20 | Upstream-Status: backport https://github.com/lttng/lttng-modules/commit/d11b568681f87c2df6ecb0516d3f16d153f24bd2 | ||
21 | |||
22 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
23 | --- | ||
24 | instrumentation/events/lttng-module/rpc.h | 99 ++++++++++++++++------- | ||
25 | 1 file changed, 72 insertions(+), 27 deletions(-) | ||
26 | |||
27 | diff --git a/instrumentation/events/lttng-module/rpc.h b/instrumentation/events/lttng-module/rpc.h | ||
28 | index a4ac557..4239280 100644 | ||
29 | --- a/instrumentation/events/lttng-module/rpc.h | ||
30 | +++ b/instrumentation/events/lttng-module/rpc.h | ||
31 | @@ -8,7 +8,32 @@ | ||
32 | #include <linux/sunrpc/sched.h> | ||
33 | #include <linux/sunrpc/clnt.h> | ||
34 | |||
35 | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | ||
36 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)) | ||
37 | +LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, | ||
38 | + | ||
39 | + TP_PROTO(const struct rpc_task *task), | ||
40 | + | ||
41 | + TP_ARGS(task), | ||
42 | + | ||
43 | + TP_FIELDS( | ||
44 | + ctf_integer(unsigned int, task_id, task->tk_pid) | ||
45 | + ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) | ||
46 | + ctf_integer(int, status, task->tk_status) | ||
47 | + ) | ||
48 | +) | ||
49 | + | ||
50 | +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status, | ||
51 | + TP_PROTO(const struct rpc_task *task), | ||
52 | + | ||
53 | + TP_ARGS(task) | ||
54 | +) | ||
55 | + | ||
56 | +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status, | ||
57 | + TP_PROTO(const struct rpc_task *task), | ||
58 | + | ||
59 | + TP_ARGS(task) | ||
60 | +) | ||
61 | +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | ||
62 | LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, | ||
63 | |||
64 | TP_PROTO(struct rpc_task *task), | ||
65 | @@ -21,6 +46,18 @@ LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, | ||
66 | ctf_integer(int, status, task->tk_status) | ||
67 | ) | ||
68 | ) | ||
69 | + | ||
70 | +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status, | ||
71 | + TP_PROTO(struct rpc_task *task), | ||
72 | + | ||
73 | + TP_ARGS(task) | ||
74 | +) | ||
75 | + | ||
76 | +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status, | ||
77 | + TP_PROTO(struct rpc_task *task), | ||
78 | + | ||
79 | + TP_ARGS(task) | ||
80 | +) | ||
81 | #else | ||
82 | LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, | ||
83 | |||
84 | @@ -34,7 +71,6 @@ LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, | ||
85 | ctf_integer(int, status, task->tk_status) | ||
86 | ) | ||
87 | ) | ||
88 | -#endif | ||
89 | |||
90 | LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status, | ||
91 | TP_PROTO(struct rpc_task *task), | ||
92 | @@ -47,8 +83,15 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status, | ||
93 | |||
94 | TP_ARGS(task) | ||
95 | ) | ||
96 | +#endif | ||
97 | |||
98 | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) | ||
99 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)) | ||
100 | +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_connect_status, | ||
101 | + TP_PROTO(const struct rpc_task *task), | ||
102 | + | ||
103 | + TP_ARGS(task) | ||
104 | +) | ||
105 | +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) | ||
106 | LTTNG_TRACEPOINT_EVENT(rpc_connect_status, | ||
107 | TP_PROTO(const struct rpc_task *task), | ||
108 | |||
109 | @@ -60,7 +103,33 @@ LTTNG_TRACEPOINT_EVENT(rpc_connect_status, | ||
110 | ctf_integer(int, status, task->tk_status) | ||
111 | ) | ||
112 | ) | ||
113 | +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | ||
114 | +LTTNG_TRACEPOINT_EVENT(rpc_connect_status, | ||
115 | + TP_PROTO(struct rpc_task *task, int status), | ||
116 | + | ||
117 | + TP_ARGS(task, status), | ||
118 | + | ||
119 | + TP_FIELDS( | ||
120 | + ctf_integer(unsigned int, task_id, task->tk_pid) | ||
121 | + ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) | ||
122 | + ctf_integer(int, status, status) | ||
123 | + ) | ||
124 | +) | ||
125 | +#else | ||
126 | +LTTNG_TRACEPOINT_EVENT(rpc_connect_status, | ||
127 | + TP_PROTO(struct rpc_task *task, int status), | ||
128 | + | ||
129 | + TP_ARGS(task, status), | ||
130 | + | ||
131 | + TP_FIELDS( | ||
132 | + ctf_integer_hex(const struct rpc_task *, task, task) | ||
133 | + ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client) | ||
134 | + ctf_integer(int, status, status) | ||
135 | + ) | ||
136 | +) | ||
137 | +#endif | ||
138 | |||
139 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) | ||
140 | LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running, | ||
141 | |||
142 | TP_PROTO(const struct rpc_task *task, const void *action), | ||
143 | @@ -130,18 +199,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup, | ||
144 | ) | ||
145 | |||
146 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | ||
147 | -LTTNG_TRACEPOINT_EVENT(rpc_connect_status, | ||
148 | - TP_PROTO(struct rpc_task *task, int status), | ||
149 | - | ||
150 | - TP_ARGS(task, status), | ||
151 | - | ||
152 | - TP_FIELDS( | ||
153 | - ctf_integer(unsigned int, task_id, task->tk_pid) | ||
154 | - ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) | ||
155 | - ctf_integer(int, status, status) | ||
156 | - ) | ||
157 | -) | ||
158 | - | ||
159 | LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running, | ||
160 | |||
161 | TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), | ||
162 | @@ -211,18 +268,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup, | ||
163 | ) | ||
164 | |||
165 | #else | ||
166 | -LTTNG_TRACEPOINT_EVENT(rpc_connect_status, | ||
167 | - TP_PROTO(struct rpc_task *task, int status), | ||
168 | - | ||
169 | - TP_ARGS(task, status), | ||
170 | - | ||
171 | - TP_FIELDS( | ||
172 | - ctf_integer_hex(const struct rpc_task *, task, task) | ||
173 | - ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client) | ||
174 | - ctf_integer(int, status, status) | ||
175 | - ) | ||
176 | -) | ||
177 | - | ||
178 | LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running, | ||
179 | |||
180 | TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), | ||
181 | -- | ||
182 | 2.19.1 | ||
183 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0008-Fix-btrfs-Remove-fsid-metadata_fsid-fields-from-btrf.patch b/meta/recipes-kernel/lttng/lttng-modules/0008-Fix-btrfs-Remove-fsid-metadata_fsid-fields-from-btrf.patch new file mode 100644 index 0000000000..5f12989956 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0008-Fix-btrfs-Remove-fsid-metadata_fsid-fields-from-btrf.patch | |||
@@ -0,0 +1,341 @@ | |||
1 | From 8af8245f6f86370d01cc4acaabafb90de45e143f Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Jeanson <mjeanson@efficios.com> | ||
3 | Date: Thu, 10 Jan 2019 14:56:15 -0500 | ||
4 | Subject: [PATCH 8/9] Fix: btrfs: Remove fsid/metadata_fsid fields from | ||
5 | btrfs_info | ||
6 | |||
7 | Introduced in v5.0. | ||
8 | |||
9 | See upstream commit : | ||
10 | |||
11 | commit de37aa513105f864d3c21105bf5542d498f21ca2 | ||
12 | Author: Nikolay Borisov <nborisov@suse.com> | ||
13 | Date: Tue Oct 30 16:43:24 2018 +0200 | ||
14 | |||
15 | btrfs: Remove fsid/metadata_fsid fields from btrfs_info | ||
16 | |||
17 | Currently btrfs_fs_info structure contains a copy of the | ||
18 | fsid/metadata_uuid fields. Same values are also contained in the | ||
19 | btrfs_fs_devices structure which fs_info has a reference to. Let's | ||
20 | reduce duplication by removing the fields from fs_info and always refer | ||
21 | to the ones in fs_devices. No functional changes. | ||
22 | |||
23 | Signed-off-by: Michael Jeanson <mjeanson@efficios.com> | ||
24 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
25 | |||
26 | Upstream-Status: backport https://github.com/lttng/lttng-modules/commit/8af8245f6f86370d01cc4acaabafb90de45e143f | ||
27 | |||
28 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
29 | --- | ||
30 | instrumentation/events/lttng-module/btrfs.h | 100 +++++++++++--------- | ||
31 | 1 file changed, 53 insertions(+), 47 deletions(-) | ||
32 | |||
33 | diff --git a/instrumentation/events/lttng-module/btrfs.h b/instrumentation/events/lttng-module/btrfs.h | ||
34 | index 4dfbf5b..ec45a1e 100644 | ||
35 | --- a/instrumentation/events/lttng-module/btrfs.h | ||
36 | +++ b/instrumentation/events/lttng-module/btrfs.h | ||
37 | @@ -32,6 +32,12 @@ struct extent_state; | ||
38 | |||
39 | #define BTRFS_UUID_SIZE 16 | ||
40 | |||
41 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)) | ||
42 | +#define lttng_fs_info_fsid fs_info->fs_devices->fsid | ||
43 | +#else | ||
44 | +#define lttng_fs_info_fsid fs_info->fsid | ||
45 | +#endif | ||
46 | + | ||
47 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ | ||
48 | LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ | ||
49 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ | ||
50 | @@ -629,7 +635,7 @@ LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group, | ||
51 | TP_ARGS(fs_info, block_group, create), | ||
52 | |||
53 | TP_FIELDS( | ||
54 | - ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE) | ||
55 | + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) | ||
56 | ctf_integer(u64, offset, block_group->key.objectid) | ||
57 | ctf_integer(u64, size, block_group->key.offset) | ||
58 | ctf_integer(u64, flags, block_group->flags) | ||
59 | @@ -647,7 +653,7 @@ LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group, | ||
60 | TP_ARGS(fs_info, block_group, create), | ||
61 | |||
62 | TP_FIELDS( | ||
63 | - ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE) | ||
64 | + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) | ||
65 | ctf_integer(u64, offset, block_group->key.objectid) | ||
66 | ctf_integer(u64, size, block_group->key.offset) | ||
67 | ctf_integer(u64, flags, block_group->flags) | ||
68 | @@ -1015,18 +1021,18 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk, | ||
69 | |||
70 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc, | ||
71 | |||
72 | - TP_PROTO(const struct btrfs_fs_info *info, const struct map_lookup *map, | ||
73 | + TP_PROTO(const struct btrfs_fs_info *fs_info, const struct map_lookup *map, | ||
74 | u64 offset, u64 size), | ||
75 | |||
76 | - TP_ARGS(info, map, offset, size) | ||
77 | + TP_ARGS(fs_info, map, offset, size) | ||
78 | ) | ||
79 | |||
80 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free, | ||
81 | |||
82 | - TP_PROTO(const struct btrfs_fs_info *info, const struct map_lookup *map, | ||
83 | + TP_PROTO(const struct btrfs_fs_info *fs_info, const struct map_lookup *map, | ||
84 | u64 offset, u64 size), | ||
85 | |||
86 | - TP_ARGS(info, map, offset, size) | ||
87 | + TP_ARGS(fs_info, map, offset, size) | ||
88 | ) | ||
89 | |||
90 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | ||
91 | @@ -1050,18 +1056,18 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk, | ||
92 | |||
93 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc, | ||
94 | |||
95 | - TP_PROTO(struct btrfs_fs_info *info, struct map_lookup *map, | ||
96 | + TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map, | ||
97 | u64 offset, u64 size), | ||
98 | |||
99 | - TP_ARGS(info, map, offset, size) | ||
100 | + TP_ARGS(fs_info, map, offset, size) | ||
101 | ) | ||
102 | |||
103 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free, | ||
104 | |||
105 | - TP_PROTO(struct btrfs_fs_info *info, struct map_lookup *map, | ||
106 | + TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map, | ||
107 | u64 offset, u64 size), | ||
108 | |||
109 | - TP_ARGS(info, map, offset, size) | ||
110 | + TP_ARGS(fs_info, map, offset, size) | ||
111 | ) | ||
112 | |||
113 | #elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ | ||
114 | @@ -1192,7 +1198,7 @@ LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation, | ||
115 | TP_ARGS(fs_info, type, val, bytes, reserve), | ||
116 | |||
117 | TP_FIELDS( | ||
118 | - ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE) | ||
119 | + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) | ||
120 | ctf_string(type, type) | ||
121 | ctf_integer(u64, val, val) | ||
122 | ctf_integer(u64, bytes, bytes) | ||
123 | @@ -1208,7 +1214,7 @@ LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation, | ||
124 | TP_ARGS(fs_info, type, val, bytes, reserve), | ||
125 | |||
126 | TP_FIELDS( | ||
127 | - ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE) | ||
128 | + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) | ||
129 | ctf_string(type, type) | ||
130 | ctf_integer(u64, val, val) | ||
131 | ctf_integer(u64, bytes, bytes) | ||
132 | @@ -1221,9 +1227,9 @@ LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation, | ||
133 | |||
134 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, | ||
135 | |||
136 | - TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len), | ||
137 | + TP_PROTO(const struct btrfs_fs_info *fs_info, u64 start, u64 len), | ||
138 | |||
139 | - TP_ARGS(info, start, len), | ||
140 | + TP_ARGS(fs_info, start, len), | ||
141 | |||
142 | TP_FIELDS( | ||
143 | ctf_integer(u64, start, start) | ||
144 | @@ -1233,25 +1239,25 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, | ||
145 | |||
146 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc, | ||
147 | |||
148 | - TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len), | ||
149 | + TP_PROTO(const struct btrfs_fs_info *fs_info, u64 start, u64 len), | ||
150 | |||
151 | - TP_ARGS(info, start, len) | ||
152 | + TP_ARGS(fs_info, start, len) | ||
153 | ) | ||
154 | |||
155 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free, | ||
156 | |||
157 | - TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len), | ||
158 | + TP_PROTO(const struct btrfs_fs_info *fs_info, u64 start, u64 len), | ||
159 | |||
160 | - TP_ARGS(info, start, len) | ||
161 | + TP_ARGS(fs_info, start, len) | ||
162 | ) | ||
163 | |||
164 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | ||
165 | |||
166 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, | ||
167 | |||
168 | - TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len), | ||
169 | + TP_PROTO(struct btrfs_fs_info *fs_info, u64 start, u64 len), | ||
170 | |||
171 | - TP_ARGS(info, start, len), | ||
172 | + TP_ARGS(fs_info, start, len), | ||
173 | |||
174 | TP_FIELDS( | ||
175 | ctf_integer(u64, start, start) | ||
176 | @@ -1261,16 +1267,16 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, | ||
177 | |||
178 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc, | ||
179 | |||
180 | - TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len), | ||
181 | + TP_PROTO(struct btrfs_fs_info *fs_info, u64 start, u64 len), | ||
182 | |||
183 | - TP_ARGS(info, start, len) | ||
184 | + TP_ARGS(fs_info, start, len) | ||
185 | ) | ||
186 | |||
187 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free, | ||
188 | |||
189 | - TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len), | ||
190 | + TP_PROTO(struct btrfs_fs_info *fs_info, u64 start, u64 len), | ||
191 | |||
192 | - TP_ARGS(info, start, len) | ||
193 | + TP_ARGS(fs_info, start, len) | ||
194 | ) | ||
195 | |||
196 | #elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ | ||
197 | @@ -1341,13 +1347,13 @@ LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, | ||
198 | |||
199 | btrfs_find_free_extent, | ||
200 | |||
201 | - TP_PROTO(const struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size, | ||
202 | + TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size, | ||
203 | u64 data), | ||
204 | |||
205 | - TP_ARGS(info, num_bytes, empty_size, data), | ||
206 | + TP_ARGS(fs_info, num_bytes, empty_size, data), | ||
207 | |||
208 | TP_FIELDS( | ||
209 | - ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE) | ||
210 | + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) | ||
211 | ctf_integer(u64, num_bytes, num_bytes) | ||
212 | ctf_integer(u64, empty_size, empty_size) | ||
213 | ctf_integer(u64, data, data) | ||
214 | @@ -1362,7 +1368,7 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, | ||
215 | TP_ARGS(block_group, start, len), | ||
216 | |||
217 | TP_FIELDS( | ||
218 | - ctf_array(u8, fsid, block_group->fs_info->fsid, BTRFS_UUID_SIZE) | ||
219 | + ctf_array(u8, fsid, block_group->lttng_fs_info_fsid, BTRFS_UUID_SIZE) | ||
220 | ctf_integer(u64, bg_objectid, block_group->key.objectid) | ||
221 | ctf_integer(u64, flags, block_group->flags) | ||
222 | ctf_integer(u64, start, start) | ||
223 | @@ -1391,13 +1397,13 @@ LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, | ||
224 | |||
225 | btrfs_find_free_extent, | ||
226 | |||
227 | - TP_PROTO(const struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size, | ||
228 | + TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size, | ||
229 | u64 data), | ||
230 | |||
231 | - TP_ARGS(info, num_bytes, empty_size, data), | ||
232 | + TP_ARGS(fs_info, num_bytes, empty_size, data), | ||
233 | |||
234 | TP_FIELDS( | ||
235 | - ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE) | ||
236 | + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) | ||
237 | ctf_integer(u64, num_bytes, num_bytes) | ||
238 | ctf_integer(u64, empty_size, empty_size) | ||
239 | ctf_integer(u64, data, data) | ||
240 | @@ -1406,14 +1412,14 @@ LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, | ||
241 | |||
242 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, | ||
243 | |||
244 | - TP_PROTO(const struct btrfs_fs_info *info, | ||
245 | + TP_PROTO(const struct btrfs_fs_info *fs_info, | ||
246 | const struct btrfs_block_group_cache *block_group, u64 start, | ||
247 | u64 len), | ||
248 | |||
249 | - TP_ARGS(info, block_group, start, len), | ||
250 | + TP_ARGS(fs_info, block_group, start, len), | ||
251 | |||
252 | TP_FIELDS( | ||
253 | - ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE) | ||
254 | + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) | ||
255 | ctf_integer(u64, bg_objectid, block_group->key.objectid) | ||
256 | ctf_integer(u64, flags, block_group->flags) | ||
257 | ctf_integer(u64, start, start) | ||
258 | @@ -1423,20 +1429,20 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, | ||
259 | |||
260 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent, | ||
261 | |||
262 | - TP_PROTO(const struct btrfs_fs_info *info, | ||
263 | + TP_PROTO(const struct btrfs_fs_info *fs_info, | ||
264 | const struct btrfs_block_group_cache *block_group, u64 start, | ||
265 | u64 len), | ||
266 | |||
267 | - TP_ARGS(info, block_group, start, len) | ||
268 | + TP_ARGS(fs_info, block_group, start, len) | ||
269 | ) | ||
270 | |||
271 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster, | ||
272 | |||
273 | - TP_PROTO(const struct btrfs_fs_info *info, | ||
274 | + TP_PROTO(const struct btrfs_fs_info *fs_info, | ||
275 | const struct btrfs_block_group_cache *block_group, u64 start, | ||
276 | u64 len), | ||
277 | |||
278 | - TP_ARGS(info, block_group, start, len) | ||
279 | + TP_ARGS(fs_info, block_group, start, len) | ||
280 | ) | ||
281 | |||
282 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | ||
283 | @@ -1445,13 +1451,13 @@ LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, | ||
284 | |||
285 | btrfs_find_free_extent, | ||
286 | |||
287 | - TP_PROTO(struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size, | ||
288 | + TP_PROTO(struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size, | ||
289 | u64 data), | ||
290 | |||
291 | - TP_ARGS(info, num_bytes, empty_size, data), | ||
292 | + TP_ARGS(fs_info, num_bytes, empty_size, data), | ||
293 | |||
294 | TP_FIELDS( | ||
295 | - ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE) | ||
296 | + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) | ||
297 | ctf_integer(u64, num_bytes, num_bytes) | ||
298 | ctf_integer(u64, empty_size, empty_size) | ||
299 | ctf_integer(u64, data, data) | ||
300 | @@ -1460,11 +1466,11 @@ LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, | ||
301 | |||
302 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, | ||
303 | |||
304 | - TP_PROTO(struct btrfs_fs_info *info, | ||
305 | + TP_PROTO(struct btrfs_fs_info *fs_info, | ||
306 | struct btrfs_block_group_cache *block_group, u64 start, | ||
307 | u64 len), | ||
308 | |||
309 | - TP_ARGS(info, block_group, start, len), | ||
310 | + TP_ARGS(fs_info, block_group, start, len), | ||
311 | |||
312 | TP_FIELDS( | ||
313 | ctf_integer(u64, bg_objectid, block_group->key.objectid) | ||
314 | @@ -1476,20 +1482,20 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, | ||
315 | |||
316 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent, | ||
317 | |||
318 | - TP_PROTO(struct btrfs_fs_info *info, | ||
319 | + TP_PROTO(struct btrfs_fs_info *fs_info, | ||
320 | struct btrfs_block_group_cache *block_group, u64 start, | ||
321 | u64 len), | ||
322 | |||
323 | - TP_ARGS(info, block_group, start, len) | ||
324 | + TP_ARGS(fs_info, block_group, start, len) | ||
325 | ) | ||
326 | |||
327 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster, | ||
328 | |||
329 | - TP_PROTO(struct btrfs_fs_info *info, | ||
330 | + TP_PROTO(struct btrfs_fs_info *fs_info, | ||
331 | struct btrfs_block_group_cache *block_group, u64 start, | ||
332 | u64 len), | ||
333 | |||
334 | - TP_ARGS(info, block_group, start, len) | ||
335 | + TP_ARGS(fs_info, block_group, start, len) | ||
336 | ) | ||
337 | #elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ | ||
338 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ | ||
339 | -- | ||
340 | 2.19.1 | ||
341 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0009-Cleanup-tp-mempool-Remove-logically-dead-code.patch b/meta/recipes-kernel/lttng/lttng-modules/0009-Cleanup-tp-mempool-Remove-logically-dead-code.patch new file mode 100644 index 0000000000..4ffe488677 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0009-Cleanup-tp-mempool-Remove-logically-dead-code.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | From 416cee8707053a9015dfec8332e12f8c263098e3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
3 | Date: Thu, 14 Feb 2019 11:40:50 -0500 | ||
4 | Subject: [PATCH 9/9] Cleanup: tp mempool: Remove logically dead code | ||
5 | |||
6 | Found by Coverity: | ||
7 | CID 1391045 (#1 of 1): Logically dead code (DEADCODE) | ||
8 | |||
9 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
10 | |||
11 | Upstream-Status: backport https://github.com/lttng/lttng-modules/commit/416cee8707053a9015dfec8332e12f8c263098e3 | ||
12 | |||
13 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
14 | --- | ||
15 | lttng-tp-mempool.c | 11 ++--------- | ||
16 | 1 file changed, 2 insertions(+), 9 deletions(-) | ||
17 | |||
18 | diff --git a/lttng-tp-mempool.c b/lttng-tp-mempool.c | ||
19 | index d984bd4..21e8376 100644 | ||
20 | --- a/lttng-tp-mempool.c | ||
21 | +++ b/lttng-tp-mempool.c | ||
22 | @@ -151,19 +151,12 @@ void lttng_tp_mempool_free(void *ptr) | ||
23 | struct lttng_tp_buf_entry *entry; | ||
24 | struct per_cpu_buf *cpu_buf; | ||
25 | |||
26 | - if (!ptr) { | ||
27 | + if (!ptr) | ||
28 | goto end; | ||
29 | - } | ||
30 | - | ||
31 | entry = container_of(ptr, struct lttng_tp_buf_entry, buf); | ||
32 | - if (!entry) { | ||
33 | - goto end; | ||
34 | - } | ||
35 | - | ||
36 | cpu_buf = per_cpu_ptr(pool, entry->cpu); | ||
37 | - if (!cpu_buf) { | ||
38 | + if (!cpu_buf) | ||
39 | goto end; | ||
40 | - } | ||
41 | /* Add it to the free list. */ | ||
42 | list_add_tail(&entry->list, &cpu_buf->free_list); | ||
43 | |||
44 | -- | ||
45 | 2.19.1 | ||
46 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-modules_2.10.8.bb b/meta/recipes-kernel/lttng/lttng-modules_2.10.8.bb index 92e8c319b6..086254d3d3 100644 --- a/meta/recipes-kernel/lttng/lttng-modules_2.10.8.bb +++ b/meta/recipes-kernel/lttng/lttng-modules_2.10.8.bb | |||
@@ -15,6 +15,15 @@ COMPATIBLE_HOST = '(x86_64|i.86|powerpc|aarch64|mips|nios2|arm).*-linux' | |||
15 | SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2 \ | 15 | SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2 \ |
16 | file://Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch \ | 16 | file://Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch \ |
17 | file://BUILD_RUNTIME_BUG_ON-vs-gcc7.patch \ | 17 | file://BUILD_RUNTIME_BUG_ON-vs-gcc7.patch \ |
18 | file://0001-Fix-signal-Distinguish-between-kernel_siginfo-and-si.patch \ | ||
19 | file://0002-Fix-signal-Remove-SEND_SIG_FORCED-v4.20.patch \ | ||
20 | file://0003-Fix-ext4-adjust-reserved-cluster-count-when-removing.patch \ | ||
21 | file://0004-Fix-timer-instrumentation-for-RHEL-7.6.patch \ | ||
22 | file://0005-Fix-Remove-type-argument-from-access_ok-function-v5..patch \ | ||
23 | file://0006-Fix-Replace-pointer-values-with-task-tk_pid-and-rpc_.patch \ | ||
24 | file://0007-Fix-SUNRPC-Simplify-defining-common-RPC-trace-events.patch \ | ||
25 | file://0008-Fix-btrfs-Remove-fsid-metadata_fsid-fields-from-btrf.patch \ | ||
26 | file://0009-Cleanup-tp-mempool-Remove-logically-dead-code.patch \ | ||
18 | " | 27 | " |
19 | 28 | ||
20 | SRC_URI[md5sum] = "54bd9fca61487bbec1b3fca2f2213c98" | 29 | SRC_URI[md5sum] = "54bd9fca61487bbec1b3fca2f2213c98" |