summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/lttng/lttng-modules
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/lttng/lttng-modules')
-rw-r--r--recipes-kernel/lttng/lttng-modules/0001-Fix-mm-create-the-new-vm_fault_t-type-v5.1.patch66
-rw-r--r--recipes-kernel/lttng/lttng-modules/0002-Fix-rcu-Remove-wrapper-definitions-for-obsolete-RCU..patch48
-rw-r--r--recipes-kernel/lttng/lttng-modules/0003-Fix-pipe-stop-using-can_merge-v5.1.patch43
-rw-r--r--recipes-kernel/lttng/lttng-modules/0004-Fix-Revert-KVM-MMU-show-mmu_valid_gen.-v5.1.patch52
-rw-r--r--recipes-kernel/lttng/lttng-modules/0005-Fix-Remove-start-and-number-from-syscall_get_argumen.patch260
5 files changed, 469 insertions, 0 deletions
diff --git a/recipes-kernel/lttng/lttng-modules/0001-Fix-mm-create-the-new-vm_fault_t-type-v5.1.patch b/recipes-kernel/lttng/lttng-modules/0001-Fix-mm-create-the-new-vm_fault_t-type-v5.1.patch
new file mode 100644
index 00000000..12e32e84
--- /dev/null
+++ b/recipes-kernel/lttng/lttng-modules/0001-Fix-mm-create-the-new-vm_fault_t-type-v5.1.patch
@@ -0,0 +1,66 @@
1From 55026979d71852aa2cf5e19bb4adb2db98affd1e Mon Sep 17 00:00:00 2001
2From: Michael Jeanson <mjeanson@efficios.com>
3Date: Mon, 18 Mar 2019 16:20:32 -0400
4Subject: [PATCH 1/5] Fix: mm: create the new vm_fault_t type (v5.1)
5
6See upstream commit:
7
8 commit 3d3539018d2cbd12e5af4a132636ee7fd8d43ef0
9 Author: Souptick Joarder <jrdr.linux@gmail.com>
10 Date: Thu Mar 7 16:31:14 2019 -0800
11
12 mm: create the new vm_fault_t type
13
14 Page fault handlers are supposed to return VM_FAULT codes, but some
15 drivers/file systems mistakenly return error numbers. Now that all
16 drivers/file systems have been converted to use the vm_fault_t return
17 type, change the type definition to no longer be compatible with 'int'.
18 By making it an unsigned int, the function prototype becomes
19 incompatible with a function which returns int. Sparse will detect any
20 attempts to return a value which is not a VM_FAULT code.
21
22 VM_FAULT_SET_HINDEX and VM_FAULT_GET_HINDEX values are changed to avoid
23 conflict with other VM_FAULT codes.
24
25Upstream-Status: Backport [http://git.lttng.org/?p=lttng-modules.git;a=commit;h=2ca0c84f0b4a915c555a0b83102d94ac941619ca]
26
27Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
28Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
29---
30 lib/ringbuffer/ring_buffer_mmap.c | 12 +++++++++++-
31 1 file changed, 11 insertions(+), 1 deletion(-)
32
33diff --git a/lib/ringbuffer/ring_buffer_mmap.c b/lib/ringbuffer/ring_buffer_mmap.c
34index 4b1b7b3..6592a82 100644
35--- a/lib/ringbuffer/ring_buffer_mmap.c
36+++ b/lib/ringbuffer/ring_buffer_mmap.c
37@@ -32,7 +32,11 @@
38 /*
39 * fault() vm_op implementation for ring buffer file mapping.
40 */
41+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0))
42+static vm_fault_t lib_ring_buffer_fault_compat(struct vm_area_struct *vma, struct vm_fault *vmf)
43+#else
44 static int lib_ring_buffer_fault_compat(struct vm_area_struct *vma, struct vm_fault *vmf)
45+#endif
46 {
47 struct lib_ring_buffer *buf = vma->vm_private_data;
48 struct channel *chan = buf->backend.chan;
49@@ -65,7 +69,13 @@ static int lib_ring_buffer_fault_compat(struct vm_area_struct *vma, struct vm_fa
50 return 0;
51 }
52
53-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
54+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0))
55+static vm_fault_t lib_ring_buffer_fault(struct vm_fault *vmf)
56+{
57+ struct vm_area_struct *vma = vmf->vma;
58+ return lib_ring_buffer_fault_compat(vma, vmf);
59+}
60+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
61 static int lib_ring_buffer_fault(struct vm_fault *vmf)
62 {
63 struct vm_area_struct *vma = vmf->vma;
64--
652.17.0
66
diff --git a/recipes-kernel/lttng/lttng-modules/0002-Fix-rcu-Remove-wrapper-definitions-for-obsolete-RCU..patch b/recipes-kernel/lttng/lttng-modules/0002-Fix-rcu-Remove-wrapper-definitions-for-obsolete-RCU..patch
new file mode 100644
index 00000000..9d7fcf21
--- /dev/null
+++ b/recipes-kernel/lttng/lttng-modules/0002-Fix-rcu-Remove-wrapper-definitions-for-obsolete-RCU..patch
@@ -0,0 +1,48 @@
1From 68f073a5cdd89f905cb39895f5c2f160a6585672 Mon Sep 17 00:00:00 2001
2From: Michael Jeanson <mjeanson@efficios.com>
3Date: Mon, 18 Mar 2019 16:20:33 -0400
4Subject: [PATCH 2/5] Fix: rcu: Remove wrapper definitions for obsolete RCU...
5 (v5.1)
6
7See upstream commit :
8
9commit 6ba7d681aca22e53385bdb35b1d7662e61905760
10Author: Paul E. McKenney <paulmck@linux.ibm.com>
11Date: Wed Jan 9 15:22:03 2019 -0800
12
13 rcu: Remove wrapper definitions for obsolete RCU update functions
14
15 None of synchronize_rcu_bh, synchronize_rcu_bh_expedited, call_rcu_bh,
16 rcu_barrier_bh, synchronize_sched, synchronize_sched_expedited,
17 call_rcu_sched, rcu_barrier_sched, get_state_synchronize_sched, and
18 cond_synchronize_sched are actually used. This commit therefore removes
19 their trivial wrapper-function definitions.
20
21Upstream-Status: Backport [http://git.lttng.org/?p=lttng-modules.git;a=commit;h=92da05ce1f73488a57e7fd79e9c03113cefdb76f]
22
23Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
24Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
25---
26 lttng-events.c | 5 +++++
27 1 file changed, 5 insertions(+)
28
29diff --git a/lttng-events.c b/lttng-events.c
30index 47431ca..3481bd4 100644
31--- a/lttng-events.c
32+++ b/lttng-events.c
33@@ -89,7 +89,12 @@ int _lttng_field_statedump(struct lttng_session *session,
34
35 void synchronize_trace(void)
36 {
37+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0))
38+ synchronize_rcu();
39+#else
40 synchronize_sched();
41+#endif
42+
43 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
44 #ifdef CONFIG_PREEMPT_RT_FULL
45 synchronize_rcu();
46--
472.17.0
48
diff --git a/recipes-kernel/lttng/lttng-modules/0003-Fix-pipe-stop-using-can_merge-v5.1.patch b/recipes-kernel/lttng/lttng-modules/0003-Fix-pipe-stop-using-can_merge-v5.1.patch
new file mode 100644
index 00000000..bc028537
--- /dev/null
+++ b/recipes-kernel/lttng/lttng-modules/0003-Fix-pipe-stop-using-can_merge-v5.1.patch
@@ -0,0 +1,43 @@
1From 9a203973ad3cbefb67a6032fd66e746d19b2d1c3 Mon Sep 17 00:00:00 2001
2From: Michael Jeanson <mjeanson@efficios.com>
3Date: Mon, 18 Mar 2019 16:20:34 -0400
4Subject: [PATCH 3/5] Fix: pipe: stop using ->can_merge (v5.1)
5
6See upstream commit:
7
8 commit 01e7187b41191376cee8bea8de9f907b001e87b4
9 Author: Jann Horn <jannh@google.com>
10 Date: Wed Jan 23 15:19:18 2019 +0100
11
12 pipe: stop using ->can_merge
13
14 Al Viro pointed out that since there is only one pipe buffer type to which
15 new data can be appended, it isn't necessary to have a ->can_merge field in
16 struct pipe_buf_operations, we can just check for a magic type.
17
18Upstream-Status: Backport [http://git.lttng.org/?p=lttng-modules.git;a=commit;h=d6cd2c9598a06f0ba1ba885bbe754e8836528310]
19
20Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
21Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
22Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
23---
24 lib/ringbuffer/ring_buffer_splice.c | 2 ++
25 1 file changed, 2 insertions(+)
26
27diff --git a/lib/ringbuffer/ring_buffer_splice.c b/lib/ringbuffer/ring_buffer_splice.c
28index 8d14666..93cad29 100644
29--- a/lib/ringbuffer/ring_buffer_splice.c
30+++ b/lib/ringbuffer/ring_buffer_splice.c
31@@ -56,7 +56,9 @@ static void lib_ring_buffer_pipe_buf_release(struct pipe_inode_info *pipe,
32 }
33
34 static const struct pipe_buf_operations ring_buffer_pipe_buf_ops = {
35+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,1,0))
36 .can_merge = 0,
37+#endif
38 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0))
39 .map = generic_pipe_buf_map,
40 .unmap = generic_pipe_buf_unmap,
41--
422.17.0
43
diff --git a/recipes-kernel/lttng/lttng-modules/0004-Fix-Revert-KVM-MMU-show-mmu_valid_gen.-v5.1.patch b/recipes-kernel/lttng/lttng-modules/0004-Fix-Revert-KVM-MMU-show-mmu_valid_gen.-v5.1.patch
new file mode 100644
index 00000000..0e0ab765
--- /dev/null
+++ b/recipes-kernel/lttng/lttng-modules/0004-Fix-Revert-KVM-MMU-show-mmu_valid_gen.-v5.1.patch
@@ -0,0 +1,52 @@
1From f65f074de41fcc2c176397d54947f5ae2104671b Mon Sep 17 00:00:00 2001
2From: Michael Jeanson <mjeanson@efficios.com>
3Date: Mon, 18 Mar 2019 16:20:35 -0400
4Subject: [PATCH 4/5] Fix: Revert "KVM: MMU: show mmu_valid_gen..." (v5.1)
5
6See upstream commit :
7
8 commit b59c4830ca185ba0e9f9e046fb1cd10a4a92627a
9 Author: Sean Christopherson <sean.j.christopherson@intel.com>
10 Date: Tue Feb 5 13:01:30 2019 -0800
11
12 Revert "KVM: MMU: show mmu_valid_gen in shadow page related tracepoints"
13
14 ...as part of removing x86 KVM's fast invalidate mechanism, i.e. this
15 is one part of a revert all patches from the series that introduced the
16 mechanism[1].
17
18 This reverts commit 2248b023219251908aedda0621251cffc548f258.
19
20Upstream-Status: Backport [http://git.lttng.org/?p=lttng-modules.git;a=commit;h=8a88382fb09bbeda443044ee8cdb8f92040636bc]
21
22Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
23Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
24Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
25---
26 .../events/lttng-module/arch/x86/kvm/mmutrace.h | 10 +++++++++-
27 1 file changed, 9 insertions(+), 1 deletion(-)
28
29diff --git a/instrumentation/events/lttng-module/arch/x86/kvm/mmutrace.h b/instrumentation/events/lttng-module/arch/x86/kvm/mmutrace.h
30index e3f7abd..71e8b34 100644
31--- a/instrumentation/events/lttng-module/arch/x86/kvm/mmutrace.h
32+++ b/instrumentation/events/lttng-module/arch/x86/kvm/mmutrace.h
33@@ -13,7 +13,15 @@
34 #undef TRACE_SYSTEM
35 #define TRACE_SYSTEM kvm_mmu
36
37-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0))
38+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0))
39+
40+#define LTTNG_KVM_MMU_PAGE_FIELDS \
41+ ctf_integer(__u64, gfn, (sp)->gfn) \
42+ ctf_integer(__u32, role, (sp)->role.word) \
43+ ctf_integer(__u32, root_count, (sp)->root_count) \
44+ ctf_integer(bool, unsync, (sp)->unsync)
45+
46+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0))
47
48 #define LTTNG_KVM_MMU_PAGE_FIELDS \
49 ctf_integer(unsigned long, mmu_valid_gen, (sp)->mmu_valid_gen) \
50--
512.17.0
52
diff --git a/recipes-kernel/lttng/lttng-modules/0005-Fix-Remove-start-and-number-from-syscall_get_argumen.patch b/recipes-kernel/lttng/lttng-modules/0005-Fix-Remove-start-and-number-from-syscall_get_argumen.patch
new file mode 100644
index 00000000..53583aba
--- /dev/null
+++ b/recipes-kernel/lttng/lttng-modules/0005-Fix-Remove-start-and-number-from-syscall_get_argumen.patch
@@ -0,0 +1,260 @@
1From bd3fb656df0fedb0f87d1ef3690260a1d4b135e5 Mon Sep 17 00:00:00 2001
2From: Michael Jeanson <mjeanson@efficios.com>
3Date: Tue, 9 Apr 2019 14:12:41 -0400
4Subject: [PATCH 5/5] Fix: Remove start and number from syscall_get_arguments()
5 args (v5.1)
6
7 commit b35f549df1d7520d37ba1e6d4a8d4df6bd52d136
8 Author: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
9 Date: Mon Nov 7 16:26:37 2016 -0500
10
11 syscalls: Remove start and number from syscall_get_arguments() args
12
13 At Linux Plumbers, Andy Lutomirski approached me and pointed out that the
14 function call syscall_get_arguments() implemented in x86 was horribly
15 written and not optimized for the standard case of passing in 0 and 6 for
16 the starting index and the number of system calls to get. When looking at
17 all the users of this function, I discovered that all instances pass in only
18 0 and 6 for these arguments. Instead of having this function handle
19 different cases that are never used, simply rewrite it to return the first 6
20 arguments of a system call.
21
22 This should help out the performance of tracing system calls by ptrace,
23 ftrace and perf.
24
25 Link: http://lkml.kernel.org/r/20161107213233.754809394@goodmis.org
26
27Upstream-Status: Backport [http://git.lttng.org/?p=lttng-modules.git;a=commit;h=1b7b9c650ebb94358365512199559b0ece3e657c]
28
29Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
30Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
31Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
32---
33 lttng-syscalls.c | 57 ++++++++++++++++++++++++-----------------------
34 wrapper/syscall.h | 34 ++++++++++++++++++++++++++++
35 2 files changed, 63 insertions(+), 28 deletions(-)
36 create mode 100644 wrapper/syscall.h
37
38diff --git a/lttng-syscalls.c b/lttng-syscalls.c
39index 0b980a1..c9dc275 100644
40--- a/lttng-syscalls.c
41+++ b/lttng-syscalls.c
42@@ -38,6 +38,7 @@
43 #include <wrapper/tracepoint.h>
44 #include <wrapper/file.h>
45 #include <wrapper/rcu.h>
46+#include <wrapper/syscall.h>
47 #include <lttng-events.h>
48
49 #ifndef CONFIG_COMPAT
50@@ -374,9 +375,9 @@ struct lttng_syscall_filter {
51 static void syscall_entry_unknown(struct lttng_event *event,
52 struct pt_regs *regs, unsigned int id)
53 {
54- unsigned long args[UNKNOWN_SYSCALL_NRARGS];
55+ unsigned long args[LTTNG_SYSCALL_NR_ARGS];
56
57- syscall_get_arguments(current, regs, 0, UNKNOWN_SYSCALL_NRARGS, args);
58+ lttng_syscall_get_arguments(current, regs, args);
59 if (unlikely(in_compat_syscall()))
60 __event_probe__compat_syscall_entry_unknown(event, id, args);
61 else
62@@ -445,9 +446,9 @@ void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
63 case 1:
64 {
65 void (*fptr)(void *__data, unsigned long arg0) = entry->func;
66- unsigned long args[1];
67+ unsigned long args[LTTNG_SYSCALL_NR_ARGS];
68
69- syscall_get_arguments(current, regs, 0, entry->nrargs, args);
70+ lttng_syscall_get_arguments(current, regs, args);
71 fptr(event, args[0]);
72 break;
73 }
74@@ -456,9 +457,9 @@ void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
75 void (*fptr)(void *__data,
76 unsigned long arg0,
77 unsigned long arg1) = entry->func;
78- unsigned long args[2];
79+ unsigned long args[LTTNG_SYSCALL_NR_ARGS];
80
81- syscall_get_arguments(current, regs, 0, entry->nrargs, args);
82+ lttng_syscall_get_arguments(current, regs, args);
83 fptr(event, args[0], args[1]);
84 break;
85 }
86@@ -468,9 +469,9 @@ void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
87 unsigned long arg0,
88 unsigned long arg1,
89 unsigned long arg2) = entry->func;
90- unsigned long args[3];
91+ unsigned long args[LTTNG_SYSCALL_NR_ARGS];
92
93- syscall_get_arguments(current, regs, 0, entry->nrargs, args);
94+ lttng_syscall_get_arguments(current, regs, args);
95 fptr(event, args[0], args[1], args[2]);
96 break;
97 }
98@@ -481,9 +482,9 @@ void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
99 unsigned long arg1,
100 unsigned long arg2,
101 unsigned long arg3) = entry->func;
102- unsigned long args[4];
103+ unsigned long args[LTTNG_SYSCALL_NR_ARGS];
104
105- syscall_get_arguments(current, regs, 0, entry->nrargs, args);
106+ lttng_syscall_get_arguments(current, regs, args);
107 fptr(event, args[0], args[1], args[2], args[3]);
108 break;
109 }
110@@ -495,9 +496,9 @@ void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
111 unsigned long arg2,
112 unsigned long arg3,
113 unsigned long arg4) = entry->func;
114- unsigned long args[5];
115+ unsigned long args[LTTNG_SYSCALL_NR_ARGS];
116
117- syscall_get_arguments(current, regs, 0, entry->nrargs, args);
118+ lttng_syscall_get_arguments(current, regs, args);
119 fptr(event, args[0], args[1], args[2], args[3], args[4]);
120 break;
121 }
122@@ -510,9 +511,9 @@ void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
123 unsigned long arg3,
124 unsigned long arg4,
125 unsigned long arg5) = entry->func;
126- unsigned long args[6];
127+ unsigned long args[LTTNG_SYSCALL_NR_ARGS];
128
129- syscall_get_arguments(current, regs, 0, entry->nrargs, args);
130+ lttng_syscall_get_arguments(current, regs, args);
131 fptr(event, args[0], args[1], args[2],
132 args[3], args[4], args[5]);
133 break;
134@@ -525,9 +526,9 @@ void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
135 static void syscall_exit_unknown(struct lttng_event *event,
136 struct pt_regs *regs, int id, long ret)
137 {
138- unsigned long args[UNKNOWN_SYSCALL_NRARGS];
139+ unsigned long args[LTTNG_SYSCALL_NR_ARGS];
140
141- syscall_get_arguments(current, regs, 0, UNKNOWN_SYSCALL_NRARGS, args);
142+ lttng_syscall_get_arguments(current, regs, args);
143 if (unlikely(in_compat_syscall()))
144 __event_probe__compat_syscall_exit_unknown(event, id, ret,
145 args);
146@@ -601,9 +602,9 @@ void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
147 void (*fptr)(void *__data,
148 long ret,
149 unsigned long arg0) = entry->func;
150- unsigned long args[1];
151+ unsigned long args[LTTNG_SYSCALL_NR_ARGS];
152
153- syscall_get_arguments(current, regs, 0, entry->nrargs, args);
154+ lttng_syscall_get_arguments(current, regs, args);
155 fptr(event, ret, args[0]);
156 break;
157 }
158@@ -613,9 +614,9 @@ void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
159 long ret,
160 unsigned long arg0,
161 unsigned long arg1) = entry->func;
162- unsigned long args[2];
163+ unsigned long args[LTTNG_SYSCALL_NR_ARGS];
164
165- syscall_get_arguments(current, regs, 0, entry->nrargs, args);
166+ lttng_syscall_get_arguments(current, regs, args);
167 fptr(event, ret, args[0], args[1]);
168 break;
169 }
170@@ -626,9 +627,9 @@ void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
171 unsigned long arg0,
172 unsigned long arg1,
173 unsigned long arg2) = entry->func;
174- unsigned long args[3];
175+ unsigned long args[LTTNG_SYSCALL_NR_ARGS];
176
177- syscall_get_arguments(current, regs, 0, entry->nrargs, args);
178+ lttng_syscall_get_arguments(current, regs, args);
179 fptr(event, ret, args[0], args[1], args[2]);
180 break;
181 }
182@@ -640,9 +641,9 @@ void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
183 unsigned long arg1,
184 unsigned long arg2,
185 unsigned long arg3) = entry->func;
186- unsigned long args[4];
187+ unsigned long args[LTTNG_SYSCALL_NR_ARGS];
188
189- syscall_get_arguments(current, regs, 0, entry->nrargs, args);
190+ lttng_syscall_get_arguments(current, regs, args);
191 fptr(event, ret, args[0], args[1], args[2], args[3]);
192 break;
193 }
194@@ -655,9 +656,9 @@ void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
195 unsigned long arg2,
196 unsigned long arg3,
197 unsigned long arg4) = entry->func;
198- unsigned long args[5];
199+ unsigned long args[LTTNG_SYSCALL_NR_ARGS];
200
201- syscall_get_arguments(current, regs, 0, entry->nrargs, args);
202+ lttng_syscall_get_arguments(current, regs, args);
203 fptr(event, ret, args[0], args[1], args[2], args[3], args[4]);
204 break;
205 }
206@@ -671,9 +672,9 @@ void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
207 unsigned long arg3,
208 unsigned long arg4,
209 unsigned long arg5) = entry->func;
210- unsigned long args[6];
211+ unsigned long args[LTTNG_SYSCALL_NR_ARGS];
212
213- syscall_get_arguments(current, regs, 0, entry->nrargs, args);
214+ lttng_syscall_get_arguments(current, regs, args);
215 fptr(event, ret, args[0], args[1], args[2],
216 args[3], args[4], args[5]);
217 break;
218diff --git a/wrapper/syscall.h b/wrapper/syscall.h
219new file mode 100644
220index 0000000..8715f0c
221--- /dev/null
222+++ b/wrapper/syscall.h
223@@ -0,0 +1,34 @@
224+/* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1)
225+ *
226+ * wrapper/syscall.h
227+ *
228+ * wrapper around asm/syscall.h.
229+ *
230+ * Copyright (C) 2019 Michael Jeanson <mjeanson@efficios.com>
231+ */
232+
233+#ifndef _LTTNG_WRAPPER_SYSCALL_H
234+#define _LTTNG_WRAPPER_SYSCALL_H
235+
236+#include <asm/syscall.h>
237+#include <lttng-kernel-version.h>
238+
239+#define LTTNG_SYSCALL_NR_ARGS 6
240+
241+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0))
242+
243+#define lttng_syscall_get_arguments(task, regs, args) \
244+ syscall_get_arguments(task, regs, args)
245+
246+#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0) */
247+
248+static inline
249+void lttng_syscall_get_arguments(struct task_struct *task,
250+ struct pt_regs *regs, unsigned long *args)
251+{
252+ syscall_get_arguments(task, regs, 0, LTTNG_SYSCALL_NR_ARGS, args);
253+}
254+
255+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0) */
256+
257+#endif /* _LTTNG_WRAPPER_SYSCALL_H */
258--
2592.17.0
260