]> git.pld-linux.org Git - packages/lttng-modules.git/blob - kernel-5.0.patch
- rel 2
[packages/lttng-modules.git] / kernel-5.0.patch
1 From 80bb26003945e96a8ade9c8788dab9b2e08cbc08 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] Fix: Remove 'type' argument from access_ok() function (v5.0)
5
6 See upstream commit :
7
8   commit 96d4f267e40f9509e8a66e2b39e8b95655617693
9   Author: Linus Torvalds <torvalds@linux-foundation.org>
10   Date:   Thu Jan 3 18:57:57 2019 -0800
11
12     Remove 'type' argument from access_ok() function
13
14     Nobody has actually used the type (VERIFY_READ vs VERIFY_WRITE) argument
15     of the user address range verification function since we got rid of the
16     old racy i386-only code to walk page tables by hand.
17
18     It existed because the original 80386 would not honor the write protect
19     bit when in kernel mode, so you had to do COW by hand before doing any
20     user access.  But we haven't supported that in a long time, and these
21     days the 'type' argument is a purely historical artifact.
22
23     A discussion about extending 'user_access_begin()' to do the range
24     checking resulted this patch, because there is no way we're going to
25     move the old VERIFY_xyz interface to that model.  And it's best done at
26     the end of the merge window when I've done most of my merges, so let's
27     just get this done once and for all.
28
29     This patch was mostly done with a sed-script, with manual fix-ups for
30     the cases that weren't of the trivial 'access_ok(VERIFY_xyz' form.
31
32     There were a couple of notable cases:
33
34      - csky still had the old "verify_area()" name as an alias.
35
36      - the iter_iov code had magical hardcoded knowledge of the actual
37        values of VERIFY_{READ,WRITE} (not that they mattered, since nothing
38        really used it)
39
40      - microblaze used the type argument for a debug printout
41
42     but other than those oddities this should be a total no-op patch.
43
44     I tried to fix up all architectures, did fairly extensive grepping for
45     access_ok() uses, and the changes are trivial, but I may have missed
46     something.  Any missed conversion should be trivially fixable, though.
47
48 Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
49 Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
50 ---
51  lib/ringbuffer/backend.h              |  8 ++++----
52  lib/ringbuffer/ring_buffer_iterator.c |  3 ++-
53  lttng-filter-interpreter.c            |  4 ++--
54  probes/lttng-probe-user.c             |  3 ++-
55  wrapper/uaccess.h                     | 28 +++++++++++++++++++++++++++
56  5 files changed, 38 insertions(+), 8 deletions(-)
57  create mode 100644 wrapper/uaccess.h
58
59 diff --git a/lib/ringbuffer/backend.h b/lib/ringbuffer/backend.h
60 index 501fad48..da937f29 100644
61 --- a/lib/ringbuffer/backend.h
62 +++ b/lib/ringbuffer/backend.h
63 @@ -21,7 +21,7 @@
64  #include <linux/list.h>
65  #include <linux/fs.h>
66  #include <linux/mm.h>
67 -#include <linux/uaccess.h>
68 +#include <wrapper/uaccess.h>
69  
70  /* Internal helpers */
71  #include <wrapper/ringbuffer/backend_internal.h>
72 @@ -289,7 +289,7 @@ void lib_ring_buffer_copy_from_user_inatomic(const struct lib_ring_buffer_config
73  
74         set_fs(KERNEL_DS);
75         pagefault_disable();
76 -       if (unlikely(!access_ok(VERIFY_READ, src, len)))
77 +       if (unlikely(!lttng_access_ok(VERIFY_READ, src, len)))
78                 goto fill_buffer;
79  
80         if (likely(pagecpy == len)) {
81 @@ -359,7 +359,7 @@ void lib_ring_buffer_strcpy_from_user_inatomic(const struct lib_ring_buffer_conf
82  
83         set_fs(KERNEL_DS);
84         pagefault_disable();
85 -       if (unlikely(!access_ok(VERIFY_READ, src, len)))
86 +       if (unlikely(!lttng_access_ok(VERIFY_READ, src, len)))
87                 goto fill_buffer;
88  
89         if (likely(pagecpy == len)) {
90 @@ -449,7 +449,7 @@ unsigned long lib_ring_buffer_copy_from_user_check_nofault(void *dest,
91         unsigned long ret;
92         mm_segment_t old_fs;
93  
94 -       if (!access_ok(VERIFY_READ, src, len))
95 +       if (!lttng_access_ok(VERIFY_READ, src, len))
96                 return 1;
97         old_fs = get_fs();
98         set_fs(KERNEL_DS);
99 diff --git a/lib/ringbuffer/ring_buffer_iterator.c b/lib/ringbuffer/ring_buffer_iterator.c
100 index 9efe4919..d25db725 100644
101 --- a/lib/ringbuffer/ring_buffer_iterator.c
102 +++ b/lib/ringbuffer/ring_buffer_iterator.c
103 @@ -11,6 +11,7 @@
104  
105  #include <wrapper/ringbuffer/iterator.h>
106  #include <wrapper/file.h>
107 +#include <wrapper/uaccess.h>
108  #include <linux/jiffies.h>
109  #include <linux/delay.h>
110  #include <linux/module.h>
111 @@ -605,7 +606,7 @@ ssize_t channel_ring_buffer_file_read(struct file *filp,
112         ssize_t len;
113  
114         might_sleep();
115 -       if (!access_ok(VERIFY_WRITE, user_buf, count))
116 +       if (!lttng_access_ok(VERIFY_WRITE, user_buf, count))
117                 return -EFAULT;
118  
119         /* Finish copy of previous record */
120 diff --git a/lttng-filter-interpreter.c b/lttng-filter-interpreter.c
121 index bf695497..3dad6cc6 100644
122 --- a/lttng-filter-interpreter.c
123 +++ b/lttng-filter-interpreter.c
124 @@ -7,7 +7,7 @@
125   * Copyright (C) 2010-2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
126   */
127  
128 -#include <linux/uaccess.h>
129 +#include <wrapper/uaccess.h>
130  #include <wrapper/frame.h>
131  #include <wrapper/types.h>
132  #include <linux/swab.h>
133 @@ -30,7 +30,7 @@ char get_char(struct estack_entry *reg, size_t offset)
134                 char c;
135  
136                 /* Handle invalid access as end of string. */
137 -               if (unlikely(!access_ok(VERIFY_READ,
138 +               if (unlikely(!lttng_access_ok(VERIFY_READ,
139                                 reg->u.s.user_str + offset,
140                                 sizeof(c))))
141                         return '\0';
142 diff --git a/probes/lttng-probe-user.c b/probes/lttng-probe-user.c
143 index 4162a7e4..0d1f95fe 100644
144 --- a/probes/lttng-probe-user.c
145 +++ b/probes/lttng-probe-user.c
146 @@ -7,6 +7,7 @@
147  
148  #include <linux/uaccess.h>
149  #include <linux/module.h>
150 +#include <wrapper/uaccess.h>
151  #include <probes/lttng-probe-user.h>
152  
153  /*
154 @@ -30,7 +31,7 @@ long lttng_strlen_user_inatomic(const char *addr)
155                 char v;
156                 unsigned long ret;
157  
158 -               if (unlikely(!access_ok(VERIFY_READ,
159 +               if (unlikely(!lttng_access_ok(VERIFY_READ,
160                                 (__force const char __user *) addr,
161                                 sizeof(v))))
162                         break;
163 diff --git a/wrapper/uaccess.h b/wrapper/uaccess.h
164 new file mode 100644
165 index 00000000..c56427c5
166 --- /dev/null
167 +++ b/wrapper/uaccess.h
168 @@ -0,0 +1,28 @@
169 +/* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1)
170 + *
171 + * wrapper/uaccess.h
172 + *
173 + * wrapper around linux/uaccess.h.
174 + *
175 + * Copyright (C) 2019 Michael Jeanson <mjeanson@efficios.com>
176 + */
177 +
178 +#ifndef _LTTNG_WRAPPER_UACCESS_H
179 +#define _LTTNG_WRAPPER_UACCESS_H
180 +
181 +#include <linux/uaccess.h>
182 +#include <lttng-kernel-version.h>
183 +
184 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0))
185 +
186 +#define VERIFY_READ    0
187 +#define VERIFY_WRITE   1
188 +#define lttng_access_ok(type, addr, size) access_ok(addr, size)
189 +
190 +#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) */
191 +
192 +#define lttng_access_ok(type, addr, size) access_ok(type, addr, size)
193 +
194 +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) */
195 +
196 +#endif /* _LTTNG_WRAPPER_UACCESS_H */
197 diff --git a/instrumentation/events/lttng-module/btrfs.h b/instrumentation/events/lttng-module/btrfs.h
198 index 4dfbf5b..c548cf2 100644
199 --- a/instrumentation/events/lttng-module/btrfs.h
200 +++ b/instrumentation/events/lttng-module/btrfs.h
201 @@ -1,3 +1,4 @@
202 +/* SPDX-License-Identifier: GPL-2.0 */
203  #undef TRACE_SYSTEM
204  #define TRACE_SYSTEM btrfs
205  
206 @@ -32,6 +33,12 @@ struct extent_state;
207  
208  #define BTRFS_UUID_SIZE 16
209  
210 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0))
211 +#define lttng_fs_info_fsid fs_info->fs_devices->fsid
212 +#else
213 +#define lttng_fs_info_fsid fs_info->fsid
214 +#endif
215 +
216  #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
217         LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
218         LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
219 @@ -279,6 +286,43 @@ LTTNG_TRACEPOINT_EVENT(btrfs_get_extent,
220  
221  #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
222  
223 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0))
224 +LTTNG_TRACEPOINT_EVENT(btrfs_handle_em_exist,
225 +
226 +       TP_PROTO(struct btrfs_fs_info *fs_info,
227 +               const struct extent_map *existing, const struct extent_map *map,
228 +               u64 start, u64 len),
229 +
230 +       TP_ARGS(fs_info, existing, map, start, len),
231 +
232 +       TP_FIELDS(
233 +               ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
234 +               ctf_integer(u64, e_start, existing->start)
235 +               ctf_integer(u64, e_len, existing->len)
236 +               ctf_integer(u64, map_start, map->start)
237 +               ctf_integer(u64, map_len, map->len)
238 +               ctf_integer(u64, start, start)
239 +               ctf_integer(u64, len, len)
240 +       )
241 +)
242 +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
243 +LTTNG_TRACEPOINT_EVENT(btrfs_handle_em_exist,
244 +
245 +       TP_PROTO(const struct extent_map *existing, const struct extent_map *map, u64 start, u64 len),
246 +
247 +       TP_ARGS(existing, map, start, len),
248 +
249 +       TP_FIELDS(
250 +               ctf_integer(u64, e_start, existing->start)
251 +               ctf_integer(u64, e_len, existing->len)
252 +               ctf_integer(u64, map_start, map->start)
253 +               ctf_integer(u64, map_len, map->len)
254 +               ctf_integer(u64, start, start)
255 +               ctf_integer(u64, len, len)
256 +       )
257 +)
258 +#endif
259 +
260  #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
261  LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
262  
263 @@ -629,7 +673,7 @@ LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group,
264         TP_ARGS(fs_info, block_group, create),
265  
266         TP_FIELDS(
267 -               ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
268 +               ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
269                 ctf_integer(u64, offset, block_group->key.objectid)
270                 ctf_integer(u64, size, block_group->key.offset)
271                 ctf_integer(u64, flags, block_group->flags)
272 @@ -647,7 +691,7 @@ LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group,
273         TP_ARGS(fs_info, block_group, create),
274  
275         TP_FIELDS(
276 -               ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
277 +               ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
278                 ctf_integer(u64, offset, block_group->key.objectid)
279                 ctf_integer(u64, size, block_group->key.offset)
280                 ctf_integer(u64, flags, block_group->flags)
281 @@ -658,8 +702,15 @@ LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group,
282  )
283  #endif
284  
285 -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
286 -LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref,
287 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
288 +       LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
289 +       LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
290 +       LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
291 +       LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,103,7,0,0) || \
292 +       LTTNG_SLE_KERNEL_RANGE(4,4,114,94,0,0, 4,4,114,95,0,0) || \
293 +       LTTNG_SLE_KERNEL_RANGE(4,4,120,94,0,0, 4,4,120,95,0,0) || \
294 +       LTTNG_SLE_KERNEL_RANGE(4,4,126,94,0,0, 4,5,0,0,0,0))
295 +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_tree_ref,
296  
297         TP_PROTO(const struct btrfs_fs_info *fs_info,
298                  const struct btrfs_delayed_ref_node *ref,
299 @@ -669,6 +720,7 @@ LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref,
300         TP_ARGS(fs_info, ref, full_ref, action),
301  
302         TP_FIELDS(
303 +               ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
304                 ctf_integer(u64, bytenr, ref->bytenr)
305                 ctf_integer(u64, num_bytes, ref->num_bytes)
306                 ctf_integer(int, action, action)
307 @@ -679,8 +731,36 @@ LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref,
308                 ctf_integer(u64, seq, ref->seq)
309         )
310  )
311 +
312 +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref,
313 +
314 +       add_delayed_tree_ref,
315 +
316 +       btrfs_add_delayed_tree_ref,
317 +
318 +       TP_PROTO(const struct btrfs_fs_info *fs_info,
319 +                const struct btrfs_delayed_ref_node *ref,
320 +                const struct btrfs_delayed_tree_ref *full_ref,
321 +                int action),
322 +
323 +       TP_ARGS(fs_info, ref, full_ref, action)
324 +)
325 +
326 +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref,
327 +
328 +       run_delayed_tree_ref,
329 +
330 +       btrfs_run_delayed_tree_ref,
331 +
332 +       TP_PROTO(const struct btrfs_fs_info *fs_info,
333 +                const struct btrfs_delayed_ref_node *ref,
334 +                const struct btrfs_delayed_tree_ref *full_ref,
335 +                int action),
336 +
337 +       TP_ARGS(fs_info, ref, full_ref, action)
338 +)
339  #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
340 -LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref,
341 +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_tree_ref,
342  
343         TP_PROTO(struct btrfs_fs_info *fs_info,
344                  struct btrfs_delayed_ref_node *ref,
345 @@ -690,6 +770,7 @@ LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref,
346         TP_ARGS(fs_info, ref, full_ref, action),
347  
348         TP_FIELDS(
349 +               ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
350                 ctf_integer(u64, bytenr, ref->bytenr)
351                 ctf_integer(u64, num_bytes, ref->num_bytes)
352                 ctf_integer(int, action, action)
353 @@ -700,7 +781,127 @@ LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref,
354                 ctf_integer(u64, seq, ref->seq)
355         )
356  )
357 -#else
358 +
359 +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref,
360 +
361 +       add_delayed_tree_ref,
362 +
363 +       btrfs_add_delayed_tree_ref,
364 +
365 +       TP_PROTO(struct btrfs_fs_info *fs_info,
366 +                struct btrfs_delayed_ref_node *ref,
367 +                struct btrfs_delayed_tree_ref *full_ref,
368 +                int action),
369 +
370 +       TP_ARGS(fs_info, ref, full_ref, action)
371 +)
372 +
373 +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref,
374 +
375 +       run_delayed_tree_ref,
376 +
377 +       btrfs_run_delayed_tree_ref,
378 +
379 +       TP_PROTO(struct btrfs_fs_info *fs_info,
380 +                struct btrfs_delayed_ref_node *ref,
381 +                struct btrfs_delayed_tree_ref *full_ref,
382 +                int action),
383 +
384 +       TP_ARGS(fs_info, ref, full_ref, action)
385 +)
386 +#elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,92,0,0, 4,5,0,0,0,0))
387 +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_tree_ref,
388 +
389 +       TP_PROTO(const struct btrfs_delayed_ref_node *ref,
390 +                const struct btrfs_delayed_tree_ref *full_ref,
391 +                int action),
392 +
393 +       TP_ARGS(ref, full_ref, action),
394 +
395 +       TP_FIELDS(
396 +               ctf_integer(u64, bytenr, ref->bytenr)
397 +               ctf_integer(u64, num_bytes, ref->num_bytes)
398 +               ctf_integer(int, action, action)
399 +               ctf_integer(u64, parent, full_ref->parent)
400 +               ctf_integer(u64, ref_root, full_ref->root)
401 +               ctf_integer(int, level, full_ref->level)
402 +               ctf_integer(int, type, ref->type)
403 +               ctf_integer(u64, seq, ref->seq)
404 +       )
405 +)
406 +
407 +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref,
408 +
409 +       add_delayed_tree_ref,
410 +
411 +       btrfs_add_delayed_tree_ref,
412 +
413 +       TP_PROTO(const struct btrfs_delayed_ref_node *ref,
414 +                const struct btrfs_delayed_tree_ref *full_ref,
415 +                int action),
416 +
417 +       TP_ARGS(ref, full_ref, action)
418 +)
419 +
420 +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref,
421 +
422 +       run_delayed_tree_ref,
423 +
424 +       btrfs_run_delayed_tree_ref,
425 +
426 +       TP_PROTO(const struct btrfs_delayed_ref_node *ref,
427 +                const struct btrfs_delayed_tree_ref *full_ref,
428 +                int action),
429 +
430 +       TP_ARGS(ref, full_ref, action)
431 +)
432 +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
433 +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_tree_ref,
434 +
435 +       TP_PROTO(struct btrfs_delayed_ref_node *ref,
436 +                struct btrfs_delayed_tree_ref *full_ref,
437 +                int action),
438 +
439 +       TP_ARGS(ref, full_ref, action),
440 +
441 +       TP_FIELDS(
442 +               ctf_integer(u64, bytenr, ref->bytenr)
443 +               ctf_integer(u64, num_bytes, ref->num_bytes)
444 +               ctf_integer(int, action, action)
445 +               ctf_integer(u64, parent, full_ref->parent)
446 +               ctf_integer(u64, ref_root, full_ref->root)
447 +               ctf_integer(int, level, full_ref->level)
448 +               ctf_integer(int, type, ref->type)
449 +               ctf_integer(u64, seq, ref->seq)
450 +       )
451 +)
452 +
453 +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref,
454 +
455 +       add_delayed_tree_ref,
456 +
457 +       btrfs_add_delayed_tree_ref,
458 +
459 +       TP_PROTO(struct btrfs_delayed_ref_node *ref,
460 +                struct btrfs_delayed_tree_ref *full_ref,
461 +                int action),
462 +
463 +       TP_ARGS(ref, full_ref, action)
464 +)
465 +
466 +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref,
467 +
468 +       run_delayed_tree_ref,
469 +
470 +       btrfs_run_delayed_tree_ref,
471 +
472 +       TP_PROTO(struct btrfs_delayed_ref_node *ref,
473 +                struct btrfs_delayed_tree_ref *full_ref,
474 +                int action),
475 +
476 +       TP_ARGS(ref, full_ref, action)
477 +)
478 +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
479  LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref,
480  
481         TP_PROTO(struct btrfs_delayed_ref_node *ref,
482 @@ -717,13 +918,234 @@ LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref,
483                 ctf_integer(u64, ref_root, full_ref->root)
484                 ctf_integer(int, level, full_ref->level)
485                 ctf_integer(int, type, ref->type)
486 -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
487                 ctf_integer(u64, seq, ref->seq)
488 -#endif
489 +       )
490 +)
491 +#else
492 +LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref,
493 +
494 +       TP_PROTO(struct btrfs_delayed_ref_node *ref,
495 +                struct btrfs_delayed_tree_ref *full_ref,
496 +                int action),
497 +
498 +       TP_ARGS(ref, full_ref, action),
499 +
500 +       TP_FIELDS(
501 +               ctf_integer(u64, bytenr, ref->bytenr)
502 +               ctf_integer(u64, num_bytes, ref->num_bytes)
503 +               ctf_integer(int, action, action)
504 +               ctf_integer(u64, parent, full_ref->parent)
505 +               ctf_integer(u64, ref_root, full_ref->root)
506 +               ctf_integer(int, level, full_ref->level)
507 +               ctf_integer(int, type, ref->type)
508         )
509  )
510  #endif
511  
512 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
513 +       LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
514 +       LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
515 +       LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
516 +       LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,103,7,0,0) || \
517 +       LTTNG_SLE_KERNEL_RANGE(4,4,114,94,0,0, 4,4,114,95,0,0) || \
518 +       LTTNG_SLE_KERNEL_RANGE(4,4,120,94,0,0, 4,4,120,95,0,0) || \
519 +       LTTNG_SLE_KERNEL_RANGE(4,4,126,94,0,0, 4,5,0,0,0,0))
520 +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_data_ref,
521 +
522 +       TP_PROTO(const struct btrfs_fs_info *fs_info,
523 +                const struct btrfs_delayed_ref_node *ref,
524 +                const struct btrfs_delayed_data_ref *full_ref,
525 +                int action),
526 +
527 +       TP_ARGS(fs_info, ref, full_ref, action),
528 +
529 +       TP_FIELDS(
530 +               ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
531 +               ctf_integer(u64, bytenr, ref->bytenr)
532 +               ctf_integer(u64, num_bytes, ref->num_bytes)
533 +               ctf_integer(int, action, action)
534 +               ctf_integer(u64, parent, full_ref->parent)
535 +               ctf_integer(u64, ref_root, full_ref->root)
536 +               ctf_integer(u64, owner, full_ref->objectid)
537 +               ctf_integer(u64, offset, full_ref->offset)
538 +               ctf_integer(int, type, ref->type)
539 +               ctf_integer(u64, seq, ref->seq)
540 +       )
541 +)
542 +
543 +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref,
544 +
545 +       add_delayed_data_ref,
546 +
547 +       btrfs_add_delayed_data_ref,
548 +
549 +       TP_PROTO(const struct btrfs_fs_info *fs_info,
550 +                const struct btrfs_delayed_ref_node *ref,
551 +                const struct btrfs_delayed_data_ref *full_ref,
552 +                int action),
553 +
554 +       TP_ARGS(fs_info, ref, full_ref, action)
555 +)
556 +
557 +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref,
558 +
559 +       run_delayed_data_ref,
560 +
561 +       btrfs_run_delayed_data_ref,
562 +
563 +       TP_PROTO(const struct btrfs_fs_info *fs_info,
564 +                const struct btrfs_delayed_ref_node *ref,
565 +                const struct btrfs_delayed_data_ref *full_ref,
566 +                int action),
567 +
568 +       TP_ARGS(fs_info, ref, full_ref, action)
569 +)
570 +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
571 +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_data_ref,
572 +
573 +       TP_PROTO(struct btrfs_fs_info *fs_info,
574 +                struct btrfs_delayed_ref_node *ref,
575 +                struct btrfs_delayed_data_ref *full_ref,
576 +                int action),
577 +
578 +       TP_ARGS(fs_info, ref, full_ref, action),
579 +
580 +       TP_FIELDS(
581 +               ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
582 +               ctf_integer(u64, bytenr, ref->bytenr)
583 +               ctf_integer(u64, num_bytes, ref->num_bytes)
584 +               ctf_integer(int, action, action)
585 +               ctf_integer(u64, parent, full_ref->parent)
586 +               ctf_integer(u64, ref_root, full_ref->root)
587 +               ctf_integer(u64, owner, full_ref->objectid)
588 +               ctf_integer(u64, offset, full_ref->offset)
589 +               ctf_integer(int, type, ref->type)
590 +               ctf_integer(u64, seq, ref->seq)
591 +       )
592 +)
593 +
594 +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref,
595 +
596 +       add_delayed_data_ref,
597 +
598 +       btrfs_add_delayed_data_ref,
599 +
600 +       TP_PROTO(struct btrfs_fs_info *fs_info,
601 +                struct btrfs_delayed_ref_node *ref,
602 +                struct btrfs_delayed_data_ref *full_ref,
603 +                int action),
604 +
605 +       TP_ARGS(fs_info, ref, full_ref, action)
606 +)
607 +
608 +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref,
609 +
610 +       run_delayed_data_ref,
611 +
612 +       btrfs_run_delayed_data_ref,
613 +
614 +       TP_PROTO(struct btrfs_fs_info *fs_info,
615 +                struct btrfs_delayed_ref_node *ref,
616 +                struct btrfs_delayed_data_ref *full_ref,
617 +                int action),
618 +
619 +       TP_ARGS(fs_info, ref, full_ref, action)
620 +)
621 +#elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,92,0,0, 4,5,0,0,0,0))
622 +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_data_ref,
623 +
624 +       TP_PROTO(const struct btrfs_delayed_ref_node *ref,
625 +                const struct btrfs_delayed_data_ref *full_ref,
626 +                int action),
627 +
628 +       TP_ARGS(ref, full_ref, action),
629 +
630 +       TP_FIELDS(
631 +               ctf_integer(u64, bytenr, ref->bytenr)
632 +               ctf_integer(u64, num_bytes, ref->num_bytes)
633 +               ctf_integer(int, action, action)
634 +               ctf_integer(u64, parent, full_ref->parent)
635 +               ctf_integer(u64, ref_root, full_ref->root)
636 +               ctf_integer(u64, owner, full_ref->objectid)
637 +               ctf_integer(u64, offset, full_ref->offset)
638 +               ctf_integer(int, type, ref->type)
639 +               ctf_integer(u64, seq, ref->seq)
640 +       )
641 +)
642 +
643 +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref,
644 +
645 +       add_delayed_data_ref,
646 +
647 +       btrfs_add_delayed_data_ref,
648 +
649 +       TP_PROTO(const struct btrfs_delayed_ref_node *ref,
650 +                const struct btrfs_delayed_data_ref *full_ref,
651 +                int action),
652 +
653 +       TP_ARGS(fs_info, ref, full_ref, action)
654 +)
655 +
656 +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref,
657 +
658 +       run_delayed_data_ref,
659 +
660 +       btrfs_run_delayed_data_ref,
661 +
662 +       TP_PROTO(const struct btrfs_delayed_ref_node *ref,
663 +                const struct btrfs_delayed_data_ref *full_ref,
664 +                int action),
665 +
666 +       TP_ARGS(fs_info, ref, full_ref, action)
667 +)
668 +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
669 +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_data_ref,
670 +
671 +       TP_PROTO(struct btrfs_delayed_ref_node *ref,
672 +                struct btrfs_delayed_data_ref *full_ref,
673 +                int action),
674 +
675 +       TP_ARGS(ref, full_ref, action),
676 +
677 +       TP_FIELDS(
678 +               ctf_integer(u64, bytenr, ref->bytenr)
679 +               ctf_integer(u64, num_bytes, ref->num_bytes)
680 +               ctf_integer(int, action, action)
681 +               ctf_integer(u64, parent, full_ref->parent)
682 +               ctf_integer(u64, ref_root, full_ref->root)
683 +               ctf_integer(u64, owner, full_ref->objectid)
684 +               ctf_integer(u64, offset, full_ref->offset)
685 +               ctf_integer(int, type, ref->type)
686 +               ctf_integer(u64, seq, ref->seq)
687 +       )
688 +)
689 +
690 +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref,
691 +
692 +       add_delayed_data_ref,
693 +
694 +       btrfs_add_delayed_data_ref,
695 +
696 +       TP_PROTO(struct btrfs_delayed_ref_node *ref,
697 +                struct btrfs_delayed_data_ref *full_ref,
698 +                int action),
699 +
700 +       TP_ARGS(fs_info, ref, full_ref, action)
701 +)
702 +
703 +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref,
704 +
705 +       run_delayed_data_ref,
706 +
707 +       btrfs_run_delayed_data_ref,
708 +
709 +       TP_PROTO(struct btrfs_delayed_ref_node *ref,
710 +                struct btrfs_delayed_data_ref *full_ref,
711 +                int action),
712 +
713 +       TP_ARGS(fs_info, ref, full_ref, action)
714 +)
715 +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
716  LTTNG_TRACEPOINT_EVENT(btrfs_delayed_data_ref,
717  
718         TP_PROTO(struct btrfs_delayed_ref_node *ref,
719 @@ -741,11 +1163,30 @@ LTTNG_TRACEPOINT_EVENT(btrfs_delayed_data_ref,
720                 ctf_integer(u64, owner, full_ref->objectid)
721                 ctf_integer(u64, offset, full_ref->offset)
722                 ctf_integer(int, type, ref->type)
723 -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
724                 ctf_integer(u64, seq, ref->seq)
725 -#endif
726         )
727  )
728 +#else
729 +LTTNG_TRACEPOINT_EVENT(btrfs_delayed_data_ref,
730 +
731 +       TP_PROTO(struct btrfs_delayed_ref_node *ref,
732 +                struct btrfs_delayed_data_ref *full_ref,
733 +                int action),
734 +
735 +       TP_ARGS(ref, full_ref, action),
736 +
737 +       TP_FIELDS(
738 +               ctf_integer(u64, bytenr, ref->bytenr)
739 +               ctf_integer(u64, num_bytes, ref->num_bytes)
740 +               ctf_integer(int, action, action)
741 +               ctf_integer(u64, parent, full_ref->parent)
742 +               ctf_integer(u64, ref_root, full_ref->root)
743 +               ctf_integer(u64, owner, full_ref->objectid)
744 +               ctf_integer(u64, offset, full_ref->offset)
745 +               ctf_integer(int, type, ref->type)
746 +       )
747 +)
748 +#endif
749  
750  #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0))
751  LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head,
752 @@ -1015,18 +1456,18 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk,
753  
754  LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk,  btrfs_chunk_alloc,
755  
756 -       TP_PROTO(const struct btrfs_fs_info *info, const struct map_lookup *map,
757 +       TP_PROTO(const struct btrfs_fs_info *fs_info, const struct map_lookup *map,
758                  u64 offset, u64 size),
759  
760 -       TP_ARGS(info, map, offset, size)
761 +       TP_ARGS(fs_info, map, offset, size)
762  )
763  
764  LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk,  btrfs_chunk_free,
765  
766 -       TP_PROTO(const struct btrfs_fs_info *info, const struct map_lookup *map,
767 +       TP_PROTO(const struct btrfs_fs_info *fs_info, const struct map_lookup *map,
768                  u64 offset, u64 size),
769  
770 -       TP_ARGS(info, map, offset, size)
771 +       TP_ARGS(fs_info, map, offset, size)
772  )
773  
774  #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
775 @@ -1050,18 +1491,18 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk,
776  
777  LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk,  btrfs_chunk_alloc,
778  
779 -       TP_PROTO(struct btrfs_fs_info *info, struct map_lookup *map,
780 +       TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map,
781                  u64 offset, u64 size),
782  
783 -       TP_ARGS(info, map, offset, size)
784 +       TP_ARGS(fs_info, map, offset, size)
785  )
786  
787  LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk,  btrfs_chunk_free,
788  
789 -       TP_PROTO(struct btrfs_fs_info *info, struct map_lookup *map,
790 +       TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map,
791                  u64 offset, u64 size),
792  
793 -       TP_ARGS(info, map, offset, size)
794 +       TP_ARGS(fs_info, map, offset, size)
795  )
796  
797  #elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
798 @@ -1192,7 +1633,7 @@ LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation,
799         TP_ARGS(fs_info, type, val, bytes, reserve),
800  
801         TP_FIELDS(
802 -               ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
803 +               ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
804                 ctf_string(type, type)
805                 ctf_integer(u64, val, val)
806                 ctf_integer(u64, bytes, bytes)
807 @@ -1208,7 +1649,7 @@ LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation,
808         TP_ARGS(fs_info, type, val, bytes, reserve),
809  
810         TP_FIELDS(
811 -               ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
812 +               ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
813                 ctf_string(type, type)
814                 ctf_integer(u64, val, val)
815                 ctf_integer(u64, bytes, bytes)
816 @@ -1221,9 +1662,9 @@ LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation,
817  
818  LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent,
819  
820 -       TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len),
821 +       TP_PROTO(const struct btrfs_fs_info *fs_info, u64 start, u64 len),
822  
823 -       TP_ARGS(info, start, len),
824 +       TP_ARGS(fs_info, start, len),
825  
826         TP_FIELDS(
827                 ctf_integer(u64, start, start)
828 @@ -1233,25 +1674,25 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent,
829  
830  LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent,  btrfs_reserved_extent_alloc,
831  
832 -       TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len),
833 +       TP_PROTO(const struct btrfs_fs_info *fs_info, u64 start, u64 len),
834  
835 -       TP_ARGS(info, start, len)
836 +       TP_ARGS(fs_info, start, len)
837  )
838  
839  LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent,  btrfs_reserved_extent_free,
840  
841 -       TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len),
842 +       TP_PROTO(const struct btrfs_fs_info *fs_info, u64 start, u64 len),
843  
844 -       TP_ARGS(info, start, len)
845 +       TP_ARGS(fs_info, start, len)
846  )
847  
848  #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
849  
850  LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent,
851  
852 -       TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len),
853 +       TP_PROTO(struct btrfs_fs_info *fs_info, u64 start, u64 len),
854  
855 -       TP_ARGS(info, start, len),
856 +       TP_ARGS(fs_info, start, len),
857  
858         TP_FIELDS(
859                 ctf_integer(u64, start, start)
860 @@ -1261,16 +1702,16 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent,
861  
862  LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent,  btrfs_reserved_extent_alloc,
863  
864 -       TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len),
865 +       TP_PROTO(struct btrfs_fs_info *fs_info, u64 start, u64 len),
866  
867 -       TP_ARGS(info, start, len)
868 +       TP_ARGS(fs_info, start, len)
869  )
870  
871  LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent,  btrfs_reserved_extent_free,
872  
873 -       TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len),
874 +       TP_PROTO(struct btrfs_fs_info *fs_info, u64 start, u64 len),
875  
876 -       TP_ARGS(info, start, len)
877 +       TP_ARGS(fs_info, start, len)
878  )
879  
880  #elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
881 @@ -1341,13 +1782,13 @@ LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
882  
883         btrfs_find_free_extent,
884  
885 -       TP_PROTO(const struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size,
886 +       TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size,
887                  u64 data),
888  
889 -       TP_ARGS(info, num_bytes, empty_size, data),
890 +       TP_ARGS(fs_info, num_bytes, empty_size, data),
891  
892         TP_FIELDS(
893 -               ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE)
894 +               ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
895                 ctf_integer(u64, num_bytes, num_bytes)
896                 ctf_integer(u64, empty_size, empty_size)
897                 ctf_integer(u64, data, data)
898 @@ -1362,7 +1803,7 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
899         TP_ARGS(block_group, start, len),
900  
901         TP_FIELDS(
902 -               ctf_array(u8, fsid, block_group->fs_info->fsid, BTRFS_UUID_SIZE)
903 +               ctf_array(u8, fsid, block_group->lttng_fs_info_fsid, BTRFS_UUID_SIZE)
904                 ctf_integer(u64, bg_objectid, block_group->key.objectid)
905                 ctf_integer(u64, flags, block_group->flags)
906                 ctf_integer(u64, start, start)
907 @@ -1391,13 +1832,13 @@ LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
908  
909         btrfs_find_free_extent,
910  
911 -       TP_PROTO(const struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size,
912 +       TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size,
913                  u64 data),
914  
915 -       TP_ARGS(info, num_bytes, empty_size, data),
916 +       TP_ARGS(fs_info, num_bytes, empty_size, data),
917  
918         TP_FIELDS(
919 -               ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE)
920 +               ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
921                 ctf_integer(u64, num_bytes, num_bytes)
922                 ctf_integer(u64, empty_size, empty_size)
923                 ctf_integer(u64, data, data)
924 @@ -1406,14 +1847,14 @@ LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
925  
926  LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
927  
928 -       TP_PROTO(const struct btrfs_fs_info *info,
929 +       TP_PROTO(const struct btrfs_fs_info *fs_info,
930                  const struct btrfs_block_group_cache *block_group, u64 start,
931                  u64 len),
932  
933 -       TP_ARGS(info, block_group, start, len),
934 +       TP_ARGS(fs_info, block_group, start, len),
935  
936         TP_FIELDS(
937 -               ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE)
938 +               ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
939                 ctf_integer(u64, bg_objectid, block_group->key.objectid)
940                 ctf_integer(u64, flags, block_group->flags)
941                 ctf_integer(u64, start, start)
942 @@ -1423,20 +1864,20 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
943  
944  LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent,
945  
946 -       TP_PROTO(const struct btrfs_fs_info *info,
947 +       TP_PROTO(const struct btrfs_fs_info *fs_info,
948                  const struct btrfs_block_group_cache *block_group, u64 start,
949                  u64 len),
950  
951 -       TP_ARGS(info, block_group, start, len)
952 +       TP_ARGS(fs_info, block_group, start, len)
953  )
954  
955  LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
956  
957 -       TP_PROTO(const struct btrfs_fs_info *info,
958 +       TP_PROTO(const struct btrfs_fs_info *fs_info,
959                  const struct btrfs_block_group_cache *block_group, u64 start,
960                  u64 len),
961  
962 -       TP_ARGS(info, block_group, start, len)
963 +       TP_ARGS(fs_info, block_group, start, len)
964  )
965  
966  #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
967 @@ -1445,13 +1886,13 @@ LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
968  
969         btrfs_find_free_extent,
970  
971 -       TP_PROTO(struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size,
972 +       TP_PROTO(struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size,
973                  u64 data),
974  
975 -       TP_ARGS(info, num_bytes, empty_size, data),
976 +       TP_ARGS(fs_info, num_bytes, empty_size, data),
977  
978         TP_FIELDS(
979 -               ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE)
980 +               ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
981                 ctf_integer(u64, num_bytes, num_bytes)
982                 ctf_integer(u64, empty_size, empty_size)
983                 ctf_integer(u64, data, data)
984 @@ -1460,11 +1901,11 @@ LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
985  
986  LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
987  
988 -       TP_PROTO(struct btrfs_fs_info *info,
989 +       TP_PROTO(struct btrfs_fs_info *fs_info,
990                  struct btrfs_block_group_cache *block_group, u64 start,
991                  u64 len),
992  
993 -       TP_ARGS(info, block_group, start, len),
994 +       TP_ARGS(fs_info, block_group, start, len),
995  
996         TP_FIELDS(
997                 ctf_integer(u64, bg_objectid, block_group->key.objectid)
998 @@ -1476,20 +1917,20 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
999  
1000  LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent,
1001  
1002 -       TP_PROTO(struct btrfs_fs_info *info,
1003 +       TP_PROTO(struct btrfs_fs_info *fs_info,
1004                  struct btrfs_block_group_cache *block_group, u64 start,
1005                  u64 len),
1006  
1007 -       TP_ARGS(info, block_group, start, len)
1008 +       TP_ARGS(fs_info, block_group, start, len)
1009  )
1010  
1011  LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
1012  
1013 -       TP_PROTO(struct btrfs_fs_info *info,
1014 +       TP_PROTO(struct btrfs_fs_info *fs_info,
1015                  struct btrfs_block_group_cache *block_group, u64 start,
1016                  u64 len),
1017  
1018 -       TP_ARGS(info, block_group, start, len)
1019 +       TP_ARGS(fs_info, block_group, start, len)
1020  )
1021  #elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
1022         LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
1023 diff --git a/instrumentation/events/lttng-module/rpc.h b/instrumentation/events/lttng-module/rpc.h
1024 index b9e45fe..3798e8e 100644
1025 --- a/instrumentation/events/lttng-module/rpc.h
1026 +++ b/instrumentation/events/lttng-module/rpc.h
1027 @@ -1,3 +1,4 @@
1028 +/* SPDX-License-Identifier: GPL-2.0 */
1029  #undef TRACE_SYSTEM
1030  #define TRACE_SYSTEM rpc
1031  
1032 @@ -8,6 +9,57 @@
1033  #include <linux/sunrpc/sched.h>
1034  #include <linux/sunrpc/clnt.h>
1035  
1036 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0))
1037 +LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status,
1038 +
1039 +       TP_PROTO(const struct rpc_task *task),
1040 +
1041 +       TP_ARGS(task),
1042 +
1043 +       TP_FIELDS(
1044 +               ctf_integer(unsigned int, task_id, task->tk_pid)
1045 +               ctf_integer(unsigned int, client_id, task->tk_client->cl_clid)
1046 +               ctf_integer(int, status, task->tk_status)
1047 +       )
1048 +)
1049 +
1050 +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status,
1051 +       TP_PROTO(const struct rpc_task *task),
1052 +
1053 +       TP_ARGS(task)
1054 +)
1055 +
1056 +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status,
1057 +       TP_PROTO(const struct rpc_task *task),
1058 +
1059 +       TP_ARGS(task)
1060 +)
1061 +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
1062 +LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status,
1063 +
1064 +       TP_PROTO(struct rpc_task *task),
1065 +
1066 +       TP_ARGS(task),
1067 +
1068 +       TP_FIELDS(
1069 +               ctf_integer(unsigned int, task_id, task->tk_pid)
1070 +               ctf_integer(unsigned int, client_id, task->tk_client->cl_clid)
1071 +               ctf_integer(int, status, task->tk_status)
1072 +       )
1073 +)
1074 +
1075 +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status,
1076 +       TP_PROTO(struct rpc_task *task),
1077 +
1078 +       TP_ARGS(task)
1079 +)
1080 +
1081 +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status,
1082 +       TP_PROTO(struct rpc_task *task),
1083 +
1084 +       TP_ARGS(task)
1085 +)
1086 +#else
1087  LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status,
1088  
1089         TP_PROTO(struct rpc_task *task),
1090 @@ -32,20 +84,53 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status,
1091  
1092         TP_ARGS(task)
1093  )
1094 +#endif
1095  
1096 -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
1097 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0))
1098 +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_connect_status,
1099 +       TP_PROTO(const struct rpc_task *task),
1100 +
1101 +       TP_ARGS(task)
1102 +)
1103 +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
1104  LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
1105         TP_PROTO(const struct rpc_task *task),
1106  
1107         TP_ARGS(task),
1108  
1109 +       TP_FIELDS(
1110 +               ctf_integer(unsigned int, task_id, task->tk_pid)
1111 +               ctf_integer(unsigned int, client_id, task->tk_client->cl_clid)
1112 +               ctf_integer(int, status, task->tk_status)
1113 +       )
1114 +)
1115 +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
1116 +LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
1117 +       TP_PROTO(struct rpc_task *task, int status),
1118 +
1119 +       TP_ARGS(task, status),
1120 +
1121 +       TP_FIELDS(
1122 +               ctf_integer(unsigned int, task_id, task->tk_pid)
1123 +               ctf_integer(unsigned int, client_id, task->tk_client->cl_clid)
1124 +               ctf_integer(int, status, status)
1125 +       )
1126 +)
1127 +#else
1128 +LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
1129 +       TP_PROTO(struct rpc_task *task, int status),
1130 +
1131 +       TP_ARGS(task, status),
1132 +
1133         TP_FIELDS(
1134                 ctf_integer_hex(const struct rpc_task *, task, task)
1135                 ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client)
1136 -               ctf_integer(int, status, task->tk_status)
1137 +               ctf_integer(int, status, status)
1138         )
1139  )
1140 +#endif
1141  
1142 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
1143  LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running,
1144  
1145         TP_PROTO(const struct rpc_task *task, const void *action),
1146 @@ -53,8 +138,8 @@ LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running,
1147         TP_ARGS(task, action),
1148  
1149         TP_FIELDS(
1150 -               ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client)
1151 -               ctf_integer_hex(const struct rpc_task *, task, task)
1152 +               ctf_integer(unsigned int, task_id, task->tk_pid)
1153 +               ctf_integer(unsigned int, client_id, task->tk_client->cl_clid)
1154                 ctf_integer_hex(const void *, action, action)
1155                 ctf_integer(unsigned long, runstate, task->tk_runstate)
1156                 ctf_integer(int, status, task->tk_status)
1157 @@ -90,8 +175,8 @@ LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued,
1158         TP_ARGS(task, q),
1159  
1160         TP_FIELDS(
1161 -               ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client)
1162 -               ctf_integer_hex(const struct rpc_task *, task, task)
1163 +               ctf_integer(unsigned int, task_id, task->tk_pid)
1164 +               ctf_integer(unsigned int, client_id, task->tk_client->cl_clid)
1165                 ctf_integer(unsigned long, timeout, task->tk_timeout)
1166                 ctf_integer(unsigned long, runstate, task->tk_runstate)
1167                 ctf_integer(int, status, task->tk_status)
1168 @@ -114,19 +199,76 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup,
1169         TP_ARGS(task, q)
1170  )
1171  
1172 -#else
1173 -LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
1174 -       TP_PROTO(struct rpc_task *task, int status),
1175 +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
1176 +LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running,
1177  
1178 -       TP_ARGS(task, status),
1179 +       TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
1180 +
1181 +       TP_ARGS(clnt, task, action),
1182  
1183         TP_FIELDS(
1184 -               ctf_integer_hex(const struct rpc_task *, task, task)
1185 -               ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client)
1186 -               ctf_integer(int, status, status)
1187 +               ctf_integer(unsigned int, task_id, task->tk_pid)
1188 +               ctf_integer(unsigned int, client_id, task->tk_client->cl_clid)
1189 +               ctf_integer_hex(const void *, action, action)
1190 +               ctf_integer(unsigned long, runstate, task->tk_runstate)
1191 +               ctf_integer(int, status, task->tk_status)
1192 +               ctf_integer(unsigned short, flags, task->tk_flags)
1193 +       )
1194 +)
1195 +
1196 +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_begin,
1197 +
1198 +       TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
1199 +
1200 +       TP_ARGS(clnt, task, action)
1201 +)
1202 +
1203 +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_run_action,
1204 +
1205 +       TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
1206 +
1207 +       TP_ARGS(clnt, task, action)
1208 +)
1209 +
1210 +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_complete,
1211 +
1212 +       TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
1213 +
1214 +       TP_ARGS(clnt, task, action)
1215 +)
1216 +
1217 +LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued,
1218 +
1219 +       TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
1220 +
1221 +       TP_ARGS(clnt, task, q),
1222 +
1223 +       TP_FIELDS(
1224 +               ctf_integer(unsigned int, task_id, task->tk_pid)
1225 +               ctf_integer(unsigned int, client_id, task->tk_client->cl_clid)
1226 +               ctf_integer(unsigned long, timeout, task->tk_timeout)
1227 +               ctf_integer(unsigned long, runstate, task->tk_runstate)
1228 +               ctf_integer(int, status, task->tk_status)
1229 +               ctf_integer(unsigned short, flags, task->tk_flags)
1230 +               ctf_string(q_name, rpc_qname(q))
1231         )
1232  )
1233  
1234 +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_sleep,
1235 +
1236 +       TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
1237 +
1238 +       TP_ARGS(clnt, task, q)
1239 +)
1240 +
1241 +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup,
1242 +
1243 +       TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
1244 +
1245 +       TP_ARGS(clnt, task, q)
1246 +)
1247 +
1248 +#else
1249  LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running,
1250  
1251         TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
This page took 0.291436 seconds and 3 git commands to generate.