1 diff --git a/.gitattributes b/.gitattributes
3 index 00000000..7839355a
7 +.gitattributes export-ignore
8 +.gitignore export-ignore
9 +.gitreview export-ignore
10 diff --git a/instrumentation/events/lttng-module/arch/x86/kvm/mmutrace.h b/instrumentation/events/lttng-module/arch/x86/kvm/mmutrace.h
11 index e5470400..cdf0609f 100644
12 --- a/instrumentation/events/lttng-module/arch/x86/kvm/mmutrace.h
13 +++ b/instrumentation/events/lttng-module/arch/x86/kvm/mmutrace.h
14 @@ -163,7 +163,25 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(kvm_mmu_page_class, kvm_mmu_prepare_zap_page,
18 -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0))
19 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0))
21 +LTTNG_TRACEPOINT_EVENT_MAP(
24 + kvm_mmu_mark_mmio_spte,
26 + TP_PROTO(u64 *sptep, gfn_t gfn, u64 spte),
27 + TP_ARGS(sptep, gfn, spte),
30 + ctf_integer_hex(void *, sptep, sptep)
31 + ctf_integer(gfn_t, gfn, gfn)
32 + ctf_integer(unsigned, access, spte & ACC_ALL)
33 + ctf_integer(unsigned int, gen, get_mmio_spte_generation(spte))
37 +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0))
39 LTTNG_TRACEPOINT_EVENT_MAP(
41 @@ -215,7 +233,27 @@ LTTNG_TRACEPOINT_EVENT_MAP(
45 -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) || \
46 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0))
47 +LTTNG_TRACEPOINT_EVENT_MAP(
50 + kvm_mmu_fast_page_fault,
52 + TP_PROTO(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa, u32 error_code,
53 + u64 *sptep, u64 old_spte, int ret),
54 + TP_ARGS(vcpu, cr2_or_gpa, error_code, sptep, old_spte, ret),
57 + ctf_integer(int, vcpu_id, vcpu->vcpu_id)
58 + ctf_integer(gpa_t, cr2_or_gpa, cr2_or_gpa)
59 + ctf_integer(u32, error_code, error_code)
60 + ctf_integer_hex(u64 *, sptep, sptep)
61 + ctf_integer(u64, old_spte, old_spte)
62 + ctf_integer(u64, new_spte, *sptep)
63 + ctf_integer(int, ret, ret)
66 +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) || \
67 LTTNG_KERNEL_RANGE(4,19,103, 4,20,0) || \
68 LTTNG_KERNEL_RANGE(5,4,19, 5,5,0) || \
69 LTTNG_KERNEL_RANGE(5,5,3, 5,6,0) || \
70 diff --git a/instrumentation/events/lttng-module/arch/x86/kvm/trace.h b/instrumentation/events/lttng-module/arch/x86/kvm/trace.h
71 index 4416ae02..0917b51f 100644
72 --- a/instrumentation/events/lttng-module/arch/x86/kvm/trace.h
73 +++ b/instrumentation/events/lttng-module/arch/x86/kvm/trace.h
74 @@ -115,6 +115,37 @@ LTTNG_TRACEPOINT_EVENT_MAP(kvm_apic, kvm_x86_apic,
76 * Tracepoint for kvm guest exit:
78 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0))
79 +LTTNG_TRACEPOINT_EVENT_CODE_MAP(kvm_exit, kvm_x86_exit,
80 + TP_PROTO(unsigned int exit_reason, struct kvm_vcpu *vcpu, u32 isa),
81 + TP_ARGS(exit_reason, vcpu, isa),
85 + u32 intr_info, error_code;
89 + kvm_x86_ops.get_exit_info(vcpu, &tp_locvar->info1,
91 + &tp_locvar->intr_info,
92 + &tp_locvar->error_code);
96 + ctf_integer(unsigned int, exit_reason, exit_reason)
97 + ctf_integer(unsigned long, guest_rip, kvm_rip_read(vcpu))
98 + ctf_integer(u32, isa, isa)
99 + ctf_integer(u64, info1, tp_locvar->info1)
100 + ctf_integer(u64, info2, tp_locvar->info2)
101 + ctf_integer(u32, intr_info, tp_locvar->intr_info)
102 + ctf_integer(u32, error_code, tp_locvar->error_code)
103 + ctf_integer(unsigned int, vcpu_id, vcpu->vcpu_id)
108 +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0))
109 LTTNG_TRACEPOINT_EVENT_CODE_MAP(kvm_exit, kvm_x86_exit,
110 TP_PROTO(unsigned int exit_reason, struct kvm_vcpu *vcpu, u32 isa),
111 TP_ARGS(exit_reason, vcpu, isa),
112 @@ -124,13 +155,32 @@ LTTNG_TRACEPOINT_EVENT_CODE_MAP(kvm_exit, kvm_x86_exit,
116 -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0))
117 kvm_x86_ops.get_exit_info(vcpu, &tp_locvar->info1,
122 + ctf_integer(unsigned int, exit_reason, exit_reason)
123 + ctf_integer(unsigned long, guest_rip, kvm_rip_read(vcpu))
124 + ctf_integer(u32, isa, isa)
125 + ctf_integer(u64, info1, tp_locvar->info1)
126 + ctf_integer(u64, info2, tp_locvar->info2)
132 +LTTNG_TRACEPOINT_EVENT_CODE_MAP(kvm_exit, kvm_x86_exit,
133 + TP_PROTO(unsigned int exit_reason, struct kvm_vcpu *vcpu, u32 isa),
134 + TP_ARGS(exit_reason, vcpu, isa),
141 kvm_x86_ops->get_exit_info(vcpu, &tp_locvar->info1,
147 @@ -143,6 +193,7 @@ LTTNG_TRACEPOINT_EVENT_CODE_MAP(kvm_exit, kvm_x86_exit,
154 * Tracepoint for kvm interrupt injection:
155 diff --git a/instrumentation/events/lttng-module/btrfs.h b/instrumentation/events/lttng-module/btrfs.h
156 index 7b290085..efe7af96 100644
157 --- a/instrumentation/events/lttng-module/btrfs.h
158 +++ b/instrumentation/events/lttng-module/btrfs.h
159 @@ -346,7 +346,29 @@ LTTNG_TRACEPOINT_EVENT(btrfs_handle_em_exist,
163 -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
164 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0))
165 +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
167 + TP_PROTO(const struct btrfs_inode *inode,
168 + const struct btrfs_ordered_extent *ordered),
170 + TP_ARGS(inode, ordered),
173 + ctf_array(u8, fsid, inode->root->lttng_fs_info_fsid, BTRFS_UUID_SIZE)
174 + ctf_integer(ino_t, ino, btrfs_ino(inode))
175 + ctf_integer(u64, file_offset, ordered->file_offset)
176 + ctf_integer(u64, start, ordered->disk_bytenr)
177 + ctf_integer(u64, len, ordered->num_bytes)
178 + ctf_integer(u64, disk_len, ordered->disk_num_bytes)
179 + ctf_integer(u64, bytes_left, ordered->bytes_left)
180 + ctf_integer(unsigned long, flags, ordered->flags)
181 + ctf_integer(int, compress_type, ordered->compress_type)
182 + ctf_integer(int, refs, refcount_read(&ordered->refs))
183 + ctf_integer(u64, root_objectid, inode->root->root_key.objectid)
186 +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
187 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
189 TP_PROTO(const struct inode *inode,
190 @@ -458,7 +480,39 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
194 -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
195 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0))
196 +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_add,
198 + TP_PROTO(const struct btrfs_inode *inode,
199 + const struct btrfs_ordered_extent *ordered),
201 + TP_ARGS(inode, ordered)
204 +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_remove,
206 + TP_PROTO(const struct btrfs_inode *inode,
207 + const struct btrfs_ordered_extent *ordered),
209 + TP_ARGS(inode, ordered)
212 +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_start,
214 + TP_PROTO(const struct btrfs_inode *inode,
215 + const struct btrfs_ordered_extent *ordered),
217 + TP_ARGS(inode, ordered)
220 +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_put,
222 + TP_PROTO(const struct btrfs_inode *inode,
223 + const struct btrfs_ordered_extent *ordered),
225 + TP_ARGS(inode, ordered)
227 +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
228 LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
229 LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
230 LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
231 @@ -494,7 +548,41 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_put,
233 TP_ARGS(inode, ordered)
236 +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_add,
238 + TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
240 + TP_ARGS(inode, ordered)
243 +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_remove,
245 + TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
247 + TP_ARGS(inode, ordered)
250 +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_start,
252 + TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
254 + TP_ARGS(inode, ordered)
257 +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_put,
259 + TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
261 + TP_ARGS(inode, ordered)
265 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
266 + LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
267 + LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
268 + LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
269 + LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
270 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__writepage,
272 TP_PROTO(const struct page *page, const struct inode *inode,
273 @@ -563,34 +651,6 @@ LTTNG_TRACEPOINT_EVENT(btrfs_sync_file,
277 -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_add,
279 - TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
281 - TP_ARGS(inode, ordered)
284 -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_remove,
286 - TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
288 - TP_ARGS(inode, ordered)
291 -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_start,
293 - TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
295 - TP_ARGS(inode, ordered)
298 -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_put,
300 - TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
302 - TP_ARGS(inode, ordered)
305 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__writepage,
307 TP_PROTO(struct page *page, struct inode *inode,
308 @@ -1856,7 +1916,48 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_f
310 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
312 -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0))
313 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0) || \
314 + LTTNG_KERNEL_RANGE(5,9,5, 5,10,0) || \
315 + LTTNG_KERNEL_RANGE(5,4,78, 5,5,0))
316 +LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
318 + btrfs_find_free_extent,
320 + TP_PROTO(const struct btrfs_root *root, u64 num_bytes, u64 empty_size,
323 + TP_ARGS(root, num_bytes, empty_size, data),
326 + ctf_array(u8, fsid, root->lttng_fs_info_fsid, BTRFS_UUID_SIZE)
327 + ctf_integer(u64, root_objectid, root->root_key.objectid)
328 + ctf_integer(u64, num_bytes, num_bytes)
329 + ctf_integer(u64, empty_size, empty_size)
330 + ctf_integer(u64, data, data)
334 +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0))
336 +LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
338 + btrfs_find_free_extent,
340 + TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size,
343 + TP_ARGS(fs_info, num_bytes, empty_size, data),
346 + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
347 + ctf_integer(u64, num_bytes, num_bytes)
348 + ctf_integer(u64, empty_size, empty_size)
349 + ctf_integer(u64, data, data)
353 +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0))
355 LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
357 btrfs_find_free_extent,
358 @@ -1874,6 +1975,86 @@ LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
362 +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
364 +LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
366 + btrfs_find_free_extent,
368 + TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size,
371 + TP_ARGS(fs_info, num_bytes, empty_size, data),
374 + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
375 + ctf_integer(u64, num_bytes, num_bytes)
376 + ctf_integer(u64, empty_size, empty_size)
377 + ctf_integer(u64, data, data)
381 +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
383 +LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
385 + btrfs_find_free_extent,
387 + TP_PROTO(struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size,
390 + TP_ARGS(fs_info, num_bytes, empty_size, data),
393 + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
394 + ctf_integer(u64, num_bytes, num_bytes)
395 + ctf_integer(u64, empty_size, empty_size)
396 + ctf_integer(u64, data, data)
400 +#elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
401 + LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
402 + LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
403 + LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
405 +LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
407 + btrfs_find_free_extent,
409 + TP_PROTO(const struct btrfs_root *root, u64 num_bytes, u64 empty_size,
412 + TP_ARGS(root, num_bytes, empty_size, data),
415 + ctf_integer(u64, root_objectid, root->root_key.objectid)
416 + ctf_integer(u64, num_bytes, num_bytes)
417 + ctf_integer(u64, empty_size, empty_size)
418 + ctf_integer(u64, data, data)
421 +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
423 +LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
425 + btrfs_find_free_extent,
427 + TP_PROTO(struct btrfs_root *root, u64 num_bytes, u64 empty_size,
430 + TP_ARGS(root, num_bytes, empty_size, data),
433 + ctf_integer(u64, root_objectid, root->root_key.objectid)
434 + ctf_integer(u64, num_bytes, num_bytes)
435 + ctf_integer(u64, empty_size, empty_size)
436 + ctf_integer(u64, data, data)
441 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0))
442 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
444 TP_PROTO(const struct btrfs_block_group *block_group, u64 start,
445 @@ -1907,22 +2088,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_clus
448 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0))
449 -LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
451 - btrfs_find_free_extent,
453 - TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size,
456 - TP_ARGS(fs_info, num_bytes, empty_size, data),
459 - ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
460 - ctf_integer(u64, num_bytes, num_bytes)
461 - ctf_integer(u64, empty_size, empty_size)
462 - ctf_integer(u64, data, data)
466 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
468 @@ -1957,22 +2122,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_clus
471 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
472 -LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
474 - btrfs_find_free_extent,
476 - TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size,
479 - TP_ARGS(fs_info, num_bytes, empty_size, data),
482 - ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
483 - ctf_integer(u64, num_bytes, num_bytes)
484 - ctf_integer(u64, empty_size, empty_size)
485 - ctf_integer(u64, data, data)
489 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
491 @@ -2011,23 +2160,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_clus
493 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
495 -LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
497 - btrfs_find_free_extent,
499 - TP_PROTO(struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size,
502 - TP_ARGS(fs_info, num_bytes, empty_size, data),
505 - ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
506 - ctf_integer(u64, num_bytes, num_bytes)
507 - ctf_integer(u64, empty_size, empty_size)
508 - ctf_integer(u64, data, data)
512 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
514 TP_PROTO(struct btrfs_fs_info *fs_info,
515 @@ -2066,23 +2198,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_clus
516 LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
517 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
519 -LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
521 - btrfs_find_free_extent,
523 - TP_PROTO(const struct btrfs_root *root, u64 num_bytes, u64 empty_size,
526 - TP_ARGS(root, num_bytes, empty_size, data),
529 - ctf_integer(u64, root_objectid, root->root_key.objectid)
530 - ctf_integer(u64, num_bytes, num_bytes)
531 - ctf_integer(u64, empty_size, empty_size)
532 - ctf_integer(u64, data, data)
536 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
538 TP_PROTO(const struct btrfs_root *root,
539 @@ -2120,23 +2235,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_clus
541 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
543 -LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
545 - btrfs_find_free_extent,
547 - TP_PROTO(struct btrfs_root *root, u64 num_bytes, u64 empty_size,
550 - TP_ARGS(root, num_bytes, empty_size, data),
553 - ctf_integer(u64, root_objectid, root->root_key.objectid)
554 - ctf_integer(u64, num_bytes, num_bytes)
555 - ctf_integer(u64, empty_size, empty_size)
556 - ctf_integer(u64, data, data)
560 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
562 TP_PROTO(struct btrfs_root *root,
563 diff --git a/instrumentation/events/lttng-module/ext4.h b/instrumentation/events/lttng-module/ext4.h
564 index b172c8d9..6e74abad 100644
565 --- a/instrumentation/events/lttng-module/ext4.h
566 +++ b/instrumentation/events/lttng-module/ext4.h
567 @@ -1274,6 +1274,18 @@ LTTNG_TRACEPOINT_EVENT(ext4_ext_load_extent,
571 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0))
572 +LTTNG_TRACEPOINT_EVENT(ext4_load_inode,
573 + TP_PROTO(struct super_block *sb, unsigned long ino),
578 + ctf_integer(dev_t, dev, sb->s_dev)
579 + ctf_integer(ino_t, ino, ino)
583 LTTNG_TRACEPOINT_EVENT(ext4_load_inode,
584 TP_PROTO(struct inode *inode),
586 @@ -1284,6 +1296,7 @@ LTTNG_TRACEPOINT_EVENT(ext4_load_inode,
587 ctf_integer(ino_t, ino, inode->i_ino)
592 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0))
594 @@ -1895,6 +1908,34 @@ LTTNG_TRACEPOINT_EVENT(ext4_es_shrink_exit,
598 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0))
599 +LTTNG_TRACEPOINT_EVENT(ext4_fc_replay_scan,
600 + TP_PROTO(struct super_block *sb, int error, int off),
602 + TP_ARGS(sb, error, off),
605 + ctf_integer(dev_t, dev, sb->s_dev)
606 + ctf_integer(int, error, error)
607 + ctf_integer(int, off, off)
611 +LTTNG_TRACEPOINT_EVENT(ext4_fc_replay,
612 + TP_PROTO(struct super_block *sb, int tag, int ino, int priv1, int priv2),
614 + TP_ARGS(sb, tag, ino, priv1, priv2),
617 + ctf_integer(dev_t, dev, sb->s_dev)
618 + ctf_integer(int, tag, tag)
619 + ctf_integer(int, ino, ino)
620 + ctf_integer(int, priv1, priv1)
621 + ctf_integer(int, priv2, priv2)
626 #endif /* LTTNG_TRACE_EXT4_H */
628 /* This part must be outside protection */
629 diff --git a/lttng-events.h b/lttng-events.h
630 index d4d99766..e47c1478 100644
634 #include <linux/kref.h>
635 #include <lttng-cpuhotplug.h>
636 #include <linux/uuid.h>
637 +#include <linux/irq_work.h>
638 #include <wrapper/uprobes.h>
639 #include <lttng-tracer.h>
640 #include <lttng-abi.h>
641 diff --git a/lttng-filter-interpreter.c b/lttng-filter-interpreter.c
642 index 21169f01..5d572437 100644
643 --- a/lttng-filter-interpreter.c
644 +++ b/lttng-filter-interpreter.c
648 #include <wrapper/uaccess.h>
649 -#include <wrapper/frame.h>
650 +#include <wrapper/objtool.h>
651 #include <wrapper/types.h>
652 #include <linux/swab.h>
654 diff --git a/lttng-statedump-impl.c b/lttng-statedump-impl.c
655 index a6fa71a5..cf803a73 100644
656 --- a/lttng-statedump-impl.c
657 +++ b/lttng-statedump-impl.c
659 #define LTTNG_INSTRUMENTATION
660 #include <instrumentation/events/lttng-module/lttng-statedump.h>
662 -DEFINE_TRACE(lttng_statedump_block_device);
663 -DEFINE_TRACE(lttng_statedump_end);
664 -DEFINE_TRACE(lttng_statedump_interrupt);
665 -DEFINE_TRACE(lttng_statedump_file_descriptor);
666 -DEFINE_TRACE(lttng_statedump_start);
667 -DEFINE_TRACE(lttng_statedump_process_state);
668 -DEFINE_TRACE(lttng_statedump_process_pid_ns);
669 +LTTNG_DEFINE_TRACE(lttng_statedump_block_device,
670 + TP_PROTO(struct lttng_session *session,
671 + dev_t dev, const char *diskname),
672 + TP_ARGS(session, dev, diskname));
674 +LTTNG_DEFINE_TRACE(lttng_statedump_end,
675 + TP_PROTO(struct lttng_session *session),
678 +LTTNG_DEFINE_TRACE(lttng_statedump_interrupt,
679 + TP_PROTO(struct lttng_session *session,
680 + unsigned int irq, const char *chip_name,
681 + struct irqaction *action),
682 + TP_ARGS(session, irq, chip_name, action));
684 +LTTNG_DEFINE_TRACE(lttng_statedump_file_descriptor,
685 + TP_PROTO(struct lttng_session *session,
686 + struct files_struct *files,
687 + int fd, const char *filename,
688 + unsigned int flags, fmode_t fmode),
689 + TP_ARGS(session, files, fd, filename, flags, fmode));
691 +LTTNG_DEFINE_TRACE(lttng_statedump_start,
692 + TP_PROTO(struct lttng_session *session),
695 +LTTNG_DEFINE_TRACE(lttng_statedump_process_state,
696 + TP_PROTO(struct lttng_session *session,
697 + struct task_struct *p,
698 + int type, int mode, int submode, int status,
699 + struct files_struct *files),
700 + TP_ARGS(session, p, type, mode, submode, status, files));
702 +LTTNG_DEFINE_TRACE(lttng_statedump_process_pid_ns,
703 + TP_PROTO(struct lttng_session *session,
704 + struct task_struct *p,
705 + struct pid_namespace *pid_ns),
706 + TP_ARGS(session, p, pid_ns));
708 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0))
709 -DEFINE_TRACE(lttng_statedump_process_cgroup_ns);
710 +LTTNG_DEFINE_TRACE(lttng_statedump_process_cgroup_ns,
711 + TP_PROTO(struct lttng_session *session,
712 + struct task_struct *p,
713 + struct cgroup_namespace *cgroup_ns),
714 + TP_ARGS(session, p, cgroup_ns));
716 -DEFINE_TRACE(lttng_statedump_process_ipc_ns);
718 +LTTNG_DEFINE_TRACE(lttng_statedump_process_ipc_ns,
719 + TP_PROTO(struct lttng_session *session,
720 + struct task_struct *p,
721 + struct ipc_namespace *ipc_ns),
722 + TP_ARGS(session, p, ipc_ns));
724 #ifndef LTTNG_MNT_NS_MISSING_HEADER
725 -DEFINE_TRACE(lttng_statedump_process_mnt_ns);
726 +LTTNG_DEFINE_TRACE(lttng_statedump_process_mnt_ns,
727 + TP_PROTO(struct lttng_session *session,
728 + struct task_struct *p,
729 + struct mnt_namespace *mnt_ns),
730 + TP_ARGS(session, p, mnt_ns));
732 -DEFINE_TRACE(lttng_statedump_process_net_ns);
733 -DEFINE_TRACE(lttng_statedump_process_user_ns);
734 -DEFINE_TRACE(lttng_statedump_process_uts_ns);
735 -DEFINE_TRACE(lttng_statedump_network_interface);
737 +LTTNG_DEFINE_TRACE(lttng_statedump_process_net_ns,
738 + TP_PROTO(struct lttng_session *session,
739 + struct task_struct *p,
740 + struct net *net_ns),
741 + TP_ARGS(session, p, net_ns));
743 +LTTNG_DEFINE_TRACE(lttng_statedump_process_user_ns,
744 + TP_PROTO(struct lttng_session *session,
745 + struct task_struct *p,
746 + struct user_namespace *user_ns),
747 + TP_ARGS(session, p, user_ns));
749 +LTTNG_DEFINE_TRACE(lttng_statedump_process_uts_ns,
750 + TP_PROTO(struct lttng_session *session,
751 + struct task_struct *p,
752 + struct uts_namespace *uts_ns),
753 + TP_ARGS(session, p, uts_ns));
755 +LTTNG_DEFINE_TRACE(lttng_statedump_network_interface,
756 + TP_PROTO(struct lttng_session *session,
757 + struct net_device *dev, struct in_ifaddr *ifa),
758 + TP_ARGS(session, dev, ifa));
760 #ifdef LTTNG_HAVE_STATEDUMP_CPU_TOPOLOGY
761 -DEFINE_TRACE(lttng_statedump_cpu_topology);
762 +LTTNG_DEFINE_TRACE(lttng_statedump_cpu_topology,
763 + TP_PROTO(struct lttng_session *session, struct cpuinfo_x86 *c),
764 + TP_ARGS(session, c));
767 struct lttng_fd_ctx {
768 diff --git a/lttng-syscalls.c b/lttng-syscalls.c
769 index 49c0d81b..b43dd570 100644
770 --- a/lttng-syscalls.c
771 +++ b/lttng-syscalls.c
772 @@ -719,7 +719,7 @@ int fill_table(const struct trace_syscall_entry *table, size_t table_len,
773 ev.u.syscall.abi = LTTNG_KERNEL_SYSCALL_ABI_COMPAT;
776 - strncpy(ev.name, desc->name, LTTNG_KERNEL_SYM_NAME_LEN);
777 + strncpy(ev.name, desc->name, LTTNG_KERNEL_SYM_NAME_LEN - 1);
778 ev.name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0';
779 ev.instrumentation = LTTNG_KERNEL_SYSCALL;
780 chan_table[i] = _lttng_event_create(chan, &ev, filter,
781 diff --git a/lttng-tracker-id.c b/lttng-tracker-id.c
782 index 9a4b98b2..327ae346 100644
783 --- a/lttng-tracker-id.c
784 +++ b/lttng-tracker-id.c
785 @@ -75,6 +75,7 @@ int lttng_id_tracker_add(struct lttng_id_tracker *lf, int id)
786 struct lttng_id_tracker_rcu *p = lf->p;
787 uint32_t hash = hash_32(id, 32);
788 bool allocated = false;
792 p = lttng_id_tracker_rcu_create();
793 @@ -84,18 +85,28 @@ int lttng_id_tracker_add(struct lttng_id_tracker *lf, int id)
795 head = &p->id_hash[hash & (LTTNG_ID_TABLE_SIZE - 1)];
796 lttng_hlist_for_each_entry(e, head, hlist) {
804 e = kmalloc(sizeof(struct lttng_id_hash_node), GFP_KERNEL);
812 hlist_add_head_rcu(&e->hlist, head);
814 rcu_assign_pointer(lf->p, p);
826 diff --git a/probes/lttng-probe-kvm-x86-mmu.c b/probes/lttng-probe-kvm-x86-mmu.c
827 index 8f981865..5043c776 100644
828 --- a/probes/lttng-probe-kvm-x86-mmu.c
829 +++ b/probes/lttng-probe-kvm-x86-mmu.c
831 #include <../../arch/x86/kvm/mmutrace.h>
834 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0))
835 +#include <../arch/x86/kvm/mmu.h>
836 +#include <../arch/x86/kvm/mmu/spte.h>
839 #undef TRACE_INCLUDE_PATH
840 #undef TRACE_INCLUDE_FILE
842 diff --git a/probes/lttng.c b/probes/lttng.c
843 index 05bc1388..7ddaa69f 100644
849 #include <linux/module.h>
850 -#include <linux/tracepoint.h>
851 +#include <wrapper/tracepoint.h>
852 #include <linux/uaccess.h>
853 #include <linux/gfp.h>
854 #include <linux/fs.h>
856 #define LTTNG_LOGGER_COUNT_MAX 1024
857 #define LTTNG_LOGGER_FILE "lttng-logger"
859 -DEFINE_TRACE(lttng_logger);
860 +LTTNG_DEFINE_TRACE(lttng_logger,
861 + PARAMS(const char __user *text, size_t len),
865 static struct proc_dir_entry *lttng_logger_dentry;
867 diff --git a/scripts/maintainer/do-release.sh b/scripts/maintainer/do-release.sh
869 index 00000000..5e94e136
871 +++ b/scripts/maintainer/do-release.sh
878 +# invoke with do-release 2.N.M, or 2.N.M-rcXX
880 +# Default maintainer values
881 +SRCDIR="${HOME}/git/lttng-modules"
882 +# The output files are created in ${HOME}/stable/
883 +OUTPUTDIR="${HOME}/stable"
888 + echo "Usage: do-release.sh [OPTION]... RELEASE"
890 + echo "Mandatory arguments to long options are mandatory for short options too."
891 + echo " -s, --srcdir DIR source directory"
892 + echo " -o, --outputdir DIR output directory, must exist"
893 + echo " -n, --no-sign don't GPG sign the output archive"
894 + echo " -v, --verbose verbose command output"
898 +while [[ $# -gt 0 ]]
923 + # Catch unknown arguments
935 +set -- "${POS_ARGS[@]}"
939 +if [ x"${REL}" = x"" ]; then
944 +echo "Doing LTTng modules release ${REL}"
945 +echo " Source dir: ${SRCDIR}"
946 +echo " Output dir: ${OUTPUTDIR}"
947 +echo " GPG sign: ${SIGN}"
949 +# Make sure the output directory exists
950 +if [ ! -d "${OUTPUTDIR}" ]; then
951 + echo "Output directory '${OUTPUTDIR}' doesn't exist."
955 +# Make sure the source directory is a git repository
956 +if [ ! -r "${SRCDIR}/.git/config" ]; then
957 + echo "Source directory '${SRCDIR}' isn't a git repository."
961 +# Set the git repo directory for all further git commands
962 +export GIT_DIR="${SRCDIR}/.git/"
964 +# Check if the release tag exists
965 +if ! git rev-parse "refs/tags/v${REL}" >/dev/null 2>&1; then
966 + echo "Release tag 'v${REL}' doesn't exist."
970 +# Generate the compressed tar archive, the git attributes from the tag will be used.
971 +git archive $VERBOSE --format=tar --prefix="lttng-modules-${REL}/" "v${REL}" | bzip2 > "${OUTPUTDIR}/lttng-modules-${REL}.tar.bz2"
973 +pushd "${OUTPUTDIR}" >/dev/null
974 +# Generate the hashes
975 +md5sum "lttng-modules-${REL}.tar.bz2" > "lttng-modules-${REL}.tar.bz2.md5"
976 +sha256sum "lttng-modules-${REL}.tar.bz2" > "lttng-modules-${REL}.tar.bz2.sha256"
978 +if [ "x${SIGN}" = "xyes" ]; then
979 + # Sign with the default key
980 + gpg --armor -b "lttng-modules-${REL}.tar.bz2"
983 diff --git a/tests/probes/lttng-test.c b/tests/probes/lttng-test.c
984 index b450e7d7..a4fa0645 100644
985 --- a/tests/probes/lttng-test.c
986 +++ b/tests/probes/lttng-test.c
988 #define LTTNG_INSTRUMENTATION
989 #include <instrumentation/events/lttng-module/lttng-test.h>
991 -DEFINE_TRACE(lttng_test_filter_event);
992 +LTTNG_DEFINE_TRACE(lttng_test_filter_event,
993 + PARAMS(int anint, int netint, long *values,
994 + char *text, size_t textlen,
995 + char *etext, uint32_t * net_values),
996 + PARAMS(anint, netint, values, text, textlen, etext, net_values)
999 #define LTTNG_TEST_FILTER_EVENT_FILE "lttng-test-filter-event"
1001 diff --git a/wrapper/frame.h b/wrapper/objtool.h
1002 similarity index 50%
1003 rename from wrapper/frame.h
1004 rename to wrapper/objtool.h
1005 index 6e6dc811..3b997cae 100644
1006 --- a/wrapper/frame.h
1007 +++ b/wrapper/objtool.h
1009 -/* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1)
1010 +/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
1013 + * wrapper/objtool.h
1015 * Copyright (C) 2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
1018 -#ifndef _LTTNG_WRAPPER_FRAME_H
1019 -#define _LTTNG_WRAPPER_FRAME_H
1020 +#ifndef _LTTNG_WRAPPER_OBJTOOL_H
1021 +#define _LTTNG_WRAPPER_OBJTOOL_H
1023 #include <linux/version.h>
1025 -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0))
1027 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0))
1028 +#include <linux/objtool.h>
1029 +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0))
1030 #include <linux/frame.h>
1034 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0))
1036 #define LTTNG_STACK_FRAME_NON_STANDARD(func) \
1037 STACK_FRAME_NON_STANDARD(func)
1042 -#endif /* _LTTNG_WRAPPER_FRAME_H */
1043 +#endif /* _LTTNG_WRAPPER_OBJTOOL_H */
1044 diff --git a/wrapper/tracepoint.h b/wrapper/tracepoint.h
1045 index c4ba0123..bc19d8c1 100644
1046 --- a/wrapper/tracepoint.h
1047 +++ b/wrapper/tracepoint.h
1049 #include <linux/tracepoint.h>
1050 #include <linux/module.h>
1052 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0))
1053 +#define LTTNG_DEFINE_TRACE(name, proto, args) \
1054 + DEFINE_TRACE(name, PARAMS(proto), PARAMS(args))
1056 +#define LTTNG_DEFINE_TRACE(name, proto, args) \
1057 + DEFINE_TRACE(name)
1060 #ifndef HAVE_KABI_2635_TRACEPOINT
1062 #define kabi_2635_tracepoint_probe_register tracepoint_probe_register