Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package lttng-modules for openSUSE:Factory checked in at 2024-02-15 21:01:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/lttng-modules (Old) and /work/SRC/openSUSE:Factory/.lttng-modules.new.1815 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lttng-modules" Thu Feb 15 21:01:47 2024 rev:9 rq:1146909 version:2.13.11 Changes: -------- --- /work/SRC/openSUSE:Factory/lttng-modules/lttng-modules.changes 2023-05-27 20:38:17.542891710 +0200 +++ /work/SRC/openSUSE:Factory/.lttng-modules.new.1815/lttng-modules.changes 2024-02-15 21:02:56.893385493 +0100 @@ -1,0 +2,41 @@ +Thu Feb 15 16:20:28 UTC 2024 - Tony Jones <to...@suse.com> + +- Update to version 2.13.11 to allow package inclusion into SLE-Micro 6.0: + + Changes (2.13.11): + Fix: Include linux/sched/rt.h for kernels v3.9 to v3.14 + Fix: Disable IBT around indirect function calls + Inline implementation of task_prio() + Fix: prio context NULL pointer exception + Fix: MODULE_IMPORT_NS is introduced in kernel 5.4 + Android: Import VFS namespace for android common kernel + Fix: get_file_rcu is missing in kernels < 4.1 + Fix: lookup_fd_rcu replaced by lookup_fdget_rcu in linux 6.7.0-rc1 + Fix: mm, vmscan signatures changed in linux 6.7.0-rc1 + Fix: phys_proc_id and cpu_core_id moved in linux 6.7.0-rc1 + Fix build for RHEL 8.8 with linux 4.18.0-477.10.1+ + Fix: bytecode validator: oops during validation of immediate string + Fix: lttng-probe-kvm-x86-mmu build with linux 6.6 + Fix: built-in lttng with kernel >= v6.1 + Fix: ubuntu kinetic kernel range for jdb2 + + Changes (2.13.10): + Fix: sessiond: incorrect use of exclusions array leads to crash + Tests fix: test_callstack: output of addr2line incorrectly parsed + Fix: sessiond: silent kernel notifier registration error + Fix: sessiond: size-based notification occasionally not triggered + Fix: adding a user space probe fails on thumb functions + Fix: Tests that assume CPU 0 is present + Fix: Wrong assumption about possible CPUs + Tests: fix: parse-callback reports missing addr2line + Fix: lttng remove-trigger -h fails + Tests: snapshot tests complain that nothing is output + Tests: Test snapshot maximum size correctly + Tests: Add get_possible_cpus_count utility + Fix: ini parser: truncation of value name + Fix: truncated len in lttng_event_rule_user_tracepoint_serialize() + Tests: remove leftover debug printing in test_add_trigger_cli + +- Drop patch lttng-modules-2.13.9-linux-6.3.patch (upstream) + +------------------------------------------------------------------- Old: ---- lttng-modules-2.13.9-linux-6.3.patch lttng-modules-2.13.9.tar.bz2 lttng-modules-2.13.9.tar.bz2.asc New: ---- lttng-modules-2.13.11.tar.bz2 lttng-modules-2.13.11.tar.bz2.asc BETA DEBUG BEGIN: Old: - Drop patch lttng-modules-2.13.9-linux-6.3.patch (upstream) BETA DEBUG END: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ lttng-modules.spec ++++++ --- /var/tmp/diff_new_pack.Uiy8KA/_old 2024-02-15 21:02:57.321400960 +0100 +++ /var/tmp/diff_new_pack.Uiy8KA/_new 2024-02-15 21:02:57.321400960 +0100 @@ -1,7 +1,7 @@ # # spec file for package lttng-modules # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: lttng-modules -Version: 2.13.9 +Version: 2.13.11 Release: 0 Summary: Licensing information for package lttng-modules License: GPL-2.0-only AND LGPL-2.1-only AND MIT @@ -28,8 +28,6 @@ Source2: %{name}.keyring Source3: %{name}-preamble Source4: Module.supported -# PATCH-FIX-UPSTREAM lttng-modules-2.13.9-linux-6.3.patch -- Linux 6.3 compatibility. -Patch0: lttng-modules-2.13.9-linux-6.3.patch BuildRequires: %{kernel_module_package_buildreqs} ExclusiveArch: %ix86 x86_64 armv7l aarch64 riscv64 ppc64 ppc64le ++++++ lttng-modules-2.13.9.tar.bz2 -> lttng-modules-2.13.11.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/ChangeLog new/lttng-modules-2.13.11/ChangeLog --- old/lttng-modules-2.13.9/ChangeLog 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/ChangeLog 2024-01-10 21:35:48.000000000 +0100 @@ -1,3 +1,29 @@ +2024-01-10 (National Houseplant Appreciation Day) LTTng modules 2.13.11 + * Fix: Include linux/sched/rt.h for kernels v3.9 to v3.14 + * Fix: Disable IBT around indirect function calls + * Inline implementation of task_prio() + * Fix: prio context NULL pointer exception + * Fix: MODULE_IMPORT_NS is introduced in kernel 5.4 + * Android: Import VFS namespace for android common kernel + * Fix: get_file_rcu is missing in kernels < 4.1 + * fix: lookup_fd_rcu replaced by lookup_fdget_rcu in linux 6.7.0-rc1 + * fix: mm, vmscan signatures changed in linux 6.7.0-rc1 + * fix: phys_proc_id and cpu_core_id moved in linux 6.7.0-rc1 + * Fix build for RHEL 8.8 with linux 4.18.0-477.10.1+ + * Fix: bytecode validator: oops during validation of immediate string + * fix: lttng-probe-kvm-x86-mmu build with linux 6.6 + * fix: built-in lttng with kernel >= v6.1 + * fix: ubuntu kinetic kernel range for jdb2 + +2023-06-07 (National VCR Day) LTTng modules 2.13.10 + * Add support for RHEL 9.1 + * Add support for RHEL 9.0 + * fix: kallsyms wrapper on CONFIG_PPC64_ELF_ABI_V1 + * fix: net: add location to trace_consume_skb() (v6.3) + * fix: btrfs: pass find_free_extent_ctl to allocator tracepoints (v6.3) + * fix: uuid: Decouple guid_t and uuid_le types and respective macros (v6.3) + * fix: mm: introduce vma->vm_flags wrapper functions (v6.3) + 2023-03-03 (Canadian Bacon Day) LTTng modules 2.13.9 * fix: jbd2: use the correct print format (v5.4.229) * fix: jbd2 upper bound for v5.10.163 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/include/instrumentation/events/block.h new/lttng-modules-2.13.11/include/instrumentation/events/block.h --- old/lttng-modules-2.13.9/include/instrumentation/events/block.h 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/include/instrumentation/events/block.h 2024-01-10 21:35:48.000000000 +0100 @@ -66,7 +66,8 @@ #define lttng_bio_op(bio) bio_op(bio) #define lttng_bio_rw(bio) ((bio)->bi_opf) -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0)) +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0) \ + || LTTNG_RHEL_KERNEL_RANGE(5,14,0,162,0,0, 5,15,0,0,0,0)) #ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM #define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \ ctf_enum(block_rq_type, type, rwbs, \ @@ -342,7 +343,8 @@ ) #endif -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0)) +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0) \ + || LTTNG_RHEL_KERNEL_RANGE(5,14,0,162,0,0, 5,15,0,0,0,0)) /** * block_rq_requeue - place block IO request back on a queue * @rq: block IO operation request @@ -438,7 +440,8 @@ * do for the request. If @rq->bio is non-NULL then there is * additional work required to complete the request. */ -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0)) +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0) \ + || LTTNG_RHEL_KERNEL_RANGE(5,14,0,162,0,0, 5,15,0,0,0,0)) LTTNG_TRACEPOINT_EVENT(block_rq_complete, TP_PROTO(struct request *rq, blk_status_t error, unsigned int nr_bytes), @@ -455,7 +458,8 @@ lttng_req_op(rq), lttng_req_rw(rq), nr_bytes) ) ) -#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,16,0)) +#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,16,0) \ + || LTTNG_RHEL_KERNEL_RANGE(5,14,0,70,0,0, 5,15,0,0,0,0)) LTTNG_TRACEPOINT_EVENT(block_rq_complete, TP_PROTO(struct request *rq, blk_status_t error, unsigned int nr_bytes), @@ -594,7 +598,8 @@ #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,15,0)) */ -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0)) +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0) \ + || LTTNG_RHEL_KERNEL_RANGE(5,14,0,162,0,0, 5,15,0,0,0,0)) LTTNG_TRACEPOINT_EVENT_CLASS(block_rq, TP_PROTO(struct request *rq), @@ -1614,7 +1619,8 @@ ) #endif -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0)) +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0) \ + || LTTNG_RHEL_KERNEL_RANGE(5,14,0,162,0,0, 5,15,0,0,0,0)) /** * block_rq_remap - map request for a block operation request * @rq: block IO operation request diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/include/instrumentation/events/btrfs.h new/lttng-modules-2.13.11/include/instrumentation/events/btrfs.h --- old/lttng-modules-2.13.9/include/instrumentation/events/btrfs.h 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/include/instrumentation/events/btrfs.h 2024-01-10 21:35:48.000000000 +0100 @@ -13,6 +13,10 @@ #include <../fs/btrfs/accessors.h> #endif +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,3,0)) +#include <../fs/btrfs/extent-tree.h> +#endif + #ifndef _TRACE_BTRFS_DEF_ #define _TRACE_BTRFS_DEF_ struct btrfs_root; @@ -1963,7 +1967,26 @@ #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,10,0) || \ +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,3,0)) +LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, + + btrfs_find_free_extent, + + TP_PROTO(const struct btrfs_root *root, + const struct find_free_extent_ctl *ffe_ctl), + + TP_ARGS(root, ffe_ctl), + + TP_FIELDS( + ctf_array(u8, fsid, root->lttng_fs_info_fsid, BTRFS_UUID_SIZE) + ctf_integer(u64, root_objectid, root->root_key.objectid) + ctf_integer(u64, num_bytes, ffe_ctl->num_bytes) + ctf_integer(u64, empty_size, ffe_ctl->empty_size) + ctf_integer(u64, flags, ffe_ctl->flags) + ) +) + +#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,10,0) || \ LTTNG_KERNEL_RANGE(5,9,5, 5,10,0) || \ LTTNG_KERNEL_RANGE(5,4,78, 5,5,0) || \ LTTNG_UBUNTU_KERNEL_RANGE(5,8,18,44, 5,9,0,0)) @@ -2102,7 +2125,40 @@ ) #endif -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,5,0)) +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,3,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, + + TP_PROTO(const struct btrfs_block_group *block_group, + const struct find_free_extent_ctl *ffe_ctl), + + TP_ARGS(block_group, ffe_ctl), + + TP_FIELDS( + ctf_array(u8, fsid, block_group->lttng_fs_info_fsid, BTRFS_UUID_SIZE) + ctf_integer(u64, bg_objectid, block_group->start) + ctf_integer(u64, flags, block_group->flags) + ctf_integer(u64, start, ffe_ctl->search_start) + ctf_integer(u64, len, ffe_ctl->num_bytes) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent, + + TP_PROTO(const struct btrfs_block_group *block_group, + const struct find_free_extent_ctl *ffe_ctl), + + TP_ARGS(block_group, ffe_ctl) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster, + + TP_PROTO(const struct btrfs_block_group *block_group, + const struct find_free_extent_ctl *ffe_ctl), + + TP_ARGS(block_group, ffe_ctl) +) + +#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,5,0)) LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, TP_PROTO(const struct btrfs_block_group *block_group, u64 start, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/include/instrumentation/events/jbd2.h new/lttng-modules-2.13.11/include/instrumentation/events/jbd2.h --- old/lttng-modules-2.13.9/include/instrumentation/events/jbd2.h 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/include/instrumentation/events/jbd2.h 2024-01-10 21:35:48.000000000 +0100 @@ -146,7 +146,9 @@ || LTTNG_KERNEL_RANGE(5,10,163, 5,11,0) \ || LTTNG_KERNEL_RANGE(5,15,87, 5,16,0) \ || LTTNG_KERNEL_RANGE(6,0,18, 6,1,0) \ - || LTTNG_KERNEL_RANGE(6,1,4, 6,2,0)) + || LTTNG_KERNEL_RANGE(6,1,4, 6,2,0) \ + || LTTNG_UBUNTU_KERNEL_RANGE(5,19,17,42, 5,19,18,0) \ + || LTTNG_UBUNTU_KERNEL_RANGE(5,19,7,1024, 5,19,8,0)) LTTNG_TRACEPOINT_EVENT(jbd2_run_stats, TP_PROTO(dev_t dev, tid_t tid, struct transaction_run_stats_s *stats), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/include/instrumentation/events/lttng-statedump.h new/lttng-modules-2.13.11/include/instrumentation/events/lttng-statedump.h --- old/lttng-modules-2.13.9/include/instrumentation/events/lttng-statedump.h 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/include/instrumentation/events/lttng-statedump.h 2024-01-10 21:35:48.000000000 +0100 @@ -266,6 +266,23 @@ #define LTTNG_HAVE_STATEDUMP_CPU_TOPOLOGY +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,7,0)) +LTTNG_TRACEPOINT_EVENT(lttng_statedump_cpu_topology, + TP_PROTO(struct lttng_kernel_session *session, struct cpuinfo_x86 *c), + TP_ARGS(session, c), + TP_FIELDS( + ctf_string(architecture, "x86") + ctf_integer(uint16_t, cpu_id, c->cpu_index) + ctf_string(vendor, c->x86_vendor_id[0] ? c->x86_vendor_id : "unknown") + ctf_integer(uint8_t, family, c->x86) + ctf_integer(uint8_t, model, c->x86_model) + ctf_string(model_name, c->x86_model_id[0] ? c->x86_model_id : "unknown") + ctf_integer(uint16_t, physical_id, c->topo.pkg_id) + ctf_integer(uint16_t, core_id, c->topo.core_id) + ctf_integer(uint16_t, cores, c->booted_cores) + ) +) +#else LTTNG_TRACEPOINT_EVENT(lttng_statedump_cpu_topology, TP_PROTO(struct lttng_kernel_session *session, struct cpuinfo_x86 *c), TP_ARGS(session, c), @@ -281,6 +298,8 @@ ctf_integer(uint16_t, cores, c->booted_cores) ) ) +#endif /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,7,0) */ + #endif /* CONFIG_X86_32 || CONFIG_X86_64 */ #endif /* LTTNG_TRACE_LTTNG_STATEDUMP_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/include/instrumentation/events/mm_vmscan.h new/lttng-modules-2.13.11/include/instrumentation/events/mm_vmscan.h --- old/lttng-modules-2.13.9/include/instrumentation/events/mm_vmscan.h 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/include/instrumentation/events/mm_vmscan.h 2024-01-10 21:35:48.000000000 +0100 @@ -369,7 +369,33 @@ ) #endif -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,7,0)) +LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_isolate, + + TP_PROTO(int classzone_idx, + int order, + unsigned long nr_requested, + unsigned long nr_scanned, + unsigned long nr_skipped, + unsigned long nr_taken, + int lru + ), + + TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_skipped, + nr_taken, lru + ), + + TP_FIELDS( + ctf_integer(int, classzone_idx, classzone_idx) + ctf_integer(int, order, order) + ctf_integer(unsigned long, nr_requested, nr_requested) + ctf_integer(unsigned long, nr_scanned, nr_scanned) + ctf_integer(unsigned long, nr_skipped, nr_skipped) + ctf_integer(unsigned long, nr_taken, nr_taken) + ctf_integer(int, lru, lru) + ) +) +#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_isolate, TP_PROTO(int classzone_idx, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/include/instrumentation/events/sched.h new/lttng-modules-2.13.11/include/instrumentation/events/sched.h --- old/lttng-modules-2.13.9/include/instrumentation/events/sched.h 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/include/instrumentation/events/sched.h 2024-01-10 21:35:48.000000000 +0100 @@ -20,7 +20,8 @@ #ifndef _TRACE_SCHED_DEF_ #define _TRACE_SCHED_DEF_ -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0)) +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0) \ + || LTTNG_RHEL_KERNEL_RANGE(5,14,0,162,0,0, 5,15,0,0,0,0)) static inline long __trace_sched_switch_state(bool preempt, unsigned int prev_state, @@ -352,7 +353,8 @@ * Tracepoint for task switches, performed by the scheduler: */ -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0)) +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0) \ + || LTTNG_RHEL_KERNEL_RANGE(5,14,0,162,0,0, 5,15,0,0,0,0)) LTTNG_TRACEPOINT_EVENT(sched_switch, TP_PROTO(bool preempt, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/include/instrumentation/events/skb.h new/lttng-modules-2.13.11/include/instrumentation/events/skb.h --- old/lttng-modules-2.13.9/include/instrumentation/events/skb.h 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/include/instrumentation/events/skb.h 2024-01-10 21:35:48.000000000 +0100 @@ -14,8 +14,8 @@ * Tracepoint for free an sk_buff: */ #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0) \ - || LTTNG_KERNEL_RANGE(5,15,58, 5,16,0)) - + || LTTNG_KERNEL_RANGE(5,15,58, 5,16,0) \ + || LTTNG_RHEL_KERNEL_RANGE(4,18,0,477,10,1, 4,19,0,0,0,0)) LTTNG_TRACEPOINT_ENUM(skb_drop_reason, TP_ENUM_VALUES( ctf_enum_value("NOT_SPECIFIED", SKB_DROP_REASON_NOT_SPECIFIED) @@ -27,7 +27,23 @@ ctf_enum_value("MAX", SKB_DROP_REASON_MAX) ) ) +#elif (LTTNG_RHEL_KERNEL_RANGE(5,14,0,70,0,0, 5,15,0,0,0,0)) +LTTNG_TRACEPOINT_ENUM(skb_drop_reason, + TP_ENUM_VALUES( + ctf_enum_value("NOT_SPECIFIED", SKB_DROP_REASON_NOT_SPECIFIED) + ctf_enum_value("NO_SOCKET", SKB_DROP_REASON_NO_SOCKET) + ctf_enum_value("PKT_TOO_SMALL", SKB_DROP_REASON_PKT_TOO_SMALL) + ctf_enum_value("TCP_CSUM", SKB_DROP_REASON_TCP_CSUM) + ctf_enum_value("UDP_CSUM", SKB_DROP_REASON_UDP_CSUM) + ctf_enum_value("MAX", SKB_DROP_REASON_MAX) + ) +) +#endif +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0) \ + || LTTNG_KERNEL_RANGE(5,15,58, 5,16,0) \ + || LTTNG_RHEL_KERNEL_RANGE(5,14,0,70,0,0, 5,15,0,0,0,0) \ + || LTTNG_RHEL_KERNEL_RANGE(4,18,0,477,10,1, 4,19,0,0,0,0)) LTTNG_TRACEPOINT_EVENT_MAP(kfree_skb, skb_kfree, @@ -61,6 +77,21 @@ ) #endif +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,3,0)) +LTTNG_TRACEPOINT_EVENT_MAP(consume_skb, + + skb_consume, + + TP_PROTO(struct sk_buff *skb, void *location), + + TP_ARGS(skb, location), + + TP_FIELDS( + ctf_integer_hex(void *, skbaddr, skb) + ctf_integer_hex(void *, location, location) + ) +) +#else LTTNG_TRACEPOINT_EVENT_MAP(consume_skb, skb_consume, @@ -73,6 +104,7 @@ ctf_integer_hex(void *, skbaddr, skb) ) ) +#endif LTTNG_TRACEPOINT_EVENT(skb_copy_datagram_iovec, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/include/lttng/abi.h new/lttng-modules-2.13.11/include/lttng/abi.h --- old/lttng-modules-2.13.9/include/lttng/abi.h 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/include/lttng/abi.h 2024-01-10 21:35:48.000000000 +0100 @@ -325,7 +325,7 @@ uint32_t len; uint32_t reloc_offset; uint64_t seqnum; - char data[0]; + char data[]; } __attribute__((packed)); #define LTTNG_KERNEL_ABI_CAPTURE_BYTECODE_MAX_LEN 65536 @@ -333,7 +333,7 @@ uint32_t len; uint32_t reloc_offset; uint64_t seqnum; - char data[0]; + char data[]; } __attribute__((packed)); enum lttng_kernel_abi_tracker_type { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/include/lttng/bytecode.h new/lttng-modules-2.13.11/include/lttng/bytecode.h --- old/lttng-modules-2.13.9/include/lttng/bytecode.h 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/include/lttng/bytecode.h 2024-01-10 21:35:48.000000000 +0100 @@ -40,10 +40,6 @@ double v; } __attribute__((packed)); -struct literal_string { - char string[0]; -} __attribute__((packed)); - enum bytecode_op { BYTECODE_OP_UNKNOWN = 0, @@ -196,7 +192,7 @@ struct load_op { bytecode_opcode_t op; - char data[0]; + char data[]; /* data to load. Size known by enum filter_opcode and null-term char. */ } __attribute__((packed)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/include/lttng/events-internal.h new/lttng-modules-2.13.11/include/lttng/events-internal.h --- old/lttng-modules-2.13.9/include/lttng/events-internal.h 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/include/lttng/events-internal.h 2024-01-10 21:35:48.000000000 +0100 @@ -9,6 +9,7 @@ #define _LTTNG_EVENTS_INTERNAL_H #include <wrapper/compiler_attributes.h> +#include <wrapper/uuid.h> #include <lttng/events.h> @@ -289,7 +290,7 @@ atomic_t producing; /* Metadata being produced (incomplete) */ struct kref refcount; /* Metadata cache usage */ struct list_head metadata_stream; /* Metadata stream list */ - uuid_le uuid; /* Trace session unique ID (copy) */ + guid_t uuid; /* Trace session unique ID (copy) */ struct mutex lock; /* Produce/consume lock */ uint64_t version; /* Current version of the metadata */ }; @@ -463,7 +464,7 @@ struct list_head events; /* Event list head */ struct list_head list; /* Session list */ unsigned int free_chan_id; /* Next chan ID to allocate */ - uuid_le uuid; /* Trace session unique ID */ + guid_t uuid; /* Trace session unique ID */ struct lttng_metadata_cache *metadata_cache; unsigned int metadata_dumped:1, tstate:1; /* Transient enable state */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/include/lttng/lttng-bytecode.h new/lttng-modules-2.13.11/include/lttng/lttng-bytecode.h --- old/lttng-modules-2.13.9/include/lttng/lttng-bytecode.h 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/include/lttng/lttng-bytecode.h 2024-01-10 21:35:48.000000000 +0100 @@ -42,7 +42,7 @@ size_t data_alloc_len; char *data; uint16_t len; - char code[0]; + char code[]; }; enum entry_type { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/include/lttng/tracer.h new/lttng-modules-2.13.11/include/lttng/tracer.h --- old/lttng-modules-2.13.9/include/lttng/tracer.h 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/include/lttng/tracer.h 2024-01-10 21:35:48.000000000 +0100 @@ -28,7 +28,7 @@ #define LTTNG_MODULES_MAJOR_VERSION 2 #define LTTNG_MODULES_MINOR_VERSION 13 -#define LTTNG_MODULES_PATCHLEVEL_VERSION 9 +#define LTTNG_MODULES_PATCHLEVEL_VERSION 11 #define LTTNG_MODULES_EXTRAVERSION "" #define LTTNG_VERSION_NAME "Nordicité" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/include/wrapper/fdtable.h new/lttng-modules-2.13.11/include/wrapper/fdtable.h --- old/lttng-modules-2.13.9/include/wrapper/fdtable.h 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/include/wrapper/fdtable.h 2024-01-10 21:35:48.000000000 +0100 @@ -12,17 +12,42 @@ #include <linux/fdtable.h> #include <linux/sched.h> -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0)) +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,7,0)) static inline -struct file *lttng_lookup_fd_rcu(unsigned int fd) +struct file *lttng_lookup_fdget_rcu(unsigned int fd) { - return lookup_fd_rcu(fd); + return lookup_fdget_rcu(fd); +} + +#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0)) +static inline +struct file *lttng_lookup_fdget_rcu(unsigned int fd) +{ + struct file* file = lookup_fd_rcu(fd); + + if (unlikely(!file || !get_file_rcu(file))) + return NULL; + return file; +} +#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,1,0)) +static inline +struct file *lttng_lookup_fdget_rcu(unsigned int fd) +{ + struct file* file = fcheck(fd); + + if (unlikely(!file || !get_file_rcu(file))) + return NULL; + return file; } #else static inline -struct file *lttng_lookup_fd_rcu(unsigned int fd) +struct file *lttng_lookup_fdget_rcu(unsigned int fd) { - return fcheck(fd); + struct file* file = fcheck(fd); + + if (unlikely(!file || !atomic_long_inc_not_zero(&file->f_count))) + return NULL; + return file; } #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/include/wrapper/genhd.h new/lttng-modules-2.13.11/include/wrapper/genhd.h --- old/lttng-modules-2.13.9/include/wrapper/genhd.h 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/include/wrapper/genhd.h 2024-01-10 21:35:48.000000000 +0100 @@ -12,13 +12,15 @@ #ifndef _LTTNG_WRAPPER_GENHD_H #define _LTTNG_WRAPPER_GENHD_H -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0)) +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0) \ + || LTTNG_RHEL_KERNEL_RANGE(5,14,0,162,0,0, 5,15,0,0,0,0)) #include <linux/blkdev.h> #else #include <linux/genhd.h> #endif -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0)) +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0) \ + || LTTNG_RHEL_KERNEL_RANGE(5,14,0,162,0,0, 5,15,0,0,0,0)) #define LTTNG_GENHD_FL_HIDDEN GENHD_FL_HIDDEN #else #define LTTNG_GENHD_FL_HIDDEN GENHD_FL_SUPPRESS_PARTITION_INFO diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/include/wrapper/ibt.h new/lttng-modules-2.13.11/include/wrapper/ibt.h --- old/lttng-modules-2.13.9/include/wrapper/ibt.h 1970-01-01 01:00:00.000000000 +0100 +++ new/lttng-modules-2.13.11/include/wrapper/ibt.h 2024-01-10 21:35:48.000000000 +0100 @@ -0,0 +1,59 @@ +/* SPDX-License-Identifier: (GPL-2.0-only) + * + * wrapper/ibt.h + * + * Copyright (C) 2024 Mathieu Desnoyers <mathieu.desnoy...@efficios.com> + */ + +#ifndef _LTTNG_WRAPPER_IBT_H +#define _LTTNG_WRAPPER_IBT_H + +struct irq_ibt_state { + u64 msr; + unsigned long flags; +}; + +/* + * Save (disable) and restore interrupts around MSR bit change and indirect + * function call to make sure this thread is not migrated to another CPU which + * would not have the MSR bit cleared. + */ + +#ifdef CONFIG_X86_KERNEL_IBT +# include <asm/cpufeature.h> +# include <asm/msr.h> +static inline __attribute__((always_inline)) +struct irq_ibt_state wrapper_irq_ibt_save(void) +{ + struct irq_ibt_state state = { 0, 0 }; + u64 msr; + + if (!cpu_feature_enabled(X86_FEATURE_IBT)) + goto end; + local_irq_save(state.flags); + rdmsrl(MSR_IA32_S_CET, msr); + wrmsrl(MSR_IA32_S_CET, msr & ~CET_ENDBR_EN); + state.msr = msr; +end: + return state; +} + +static inline __attribute__((always_inline)) +void wrapper_irq_ibt_restore(struct irq_ibt_state state) +{ + u64 msr; + + if (!cpu_feature_enabled(X86_FEATURE_IBT)) + return; + rdmsrl(MSR_IA32_S_CET, msr); + msr &= ~CET_ENDBR_EN; + msr |= (state.msr & CET_ENDBR_EN); + wrmsrl(MSR_IA32_S_CET, msr); + local_irq_restore(state.flags); +} +#else +static inline struct irq_ibt_state wrapper_irq_ibt_save(void) { struct irq_ibt_state state = { 0, 0 }; return state; } +static inline void wrapper_irq_ibt_restore(struct irq_ibt_state state) { } +#endif + +#endif /* _LTTNG_WRAPPER_IBT_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/include/wrapper/kallsyms.h new/lttng-modules-2.13.11/include/wrapper/kallsyms.h --- old/lttng-modules-2.13.9/include/wrapper/kallsyms.h 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/include/wrapper/kallsyms.h 2024-01-10 21:35:48.000000000 +0100 @@ -16,6 +16,8 @@ #include <linux/kallsyms.h> #include <lttng/kernel-version.h> +#include <wrapper/ibt.h> + /* CONFIG_PPC64_ELF_ABI_V1/V2 were introduced in v5.19 */ #if defined(CONFIG_PPC64_ELF_ABI_V2) || (defined(CONFIG_PPC64) && defined(CONFIG_CPU_LITTLE_ENDIAN)) #define LTTNG_CONFIG_PPC64_ELF_ABI_V2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/include/wrapper/mm.h new/lttng-modules-2.13.11/include/wrapper/mm.h --- old/lttng-modules-2.13.9/include/wrapper/mm.h 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/include/wrapper/mm.h 2024-01-10 21:35:48.000000000 +0100 @@ -13,6 +13,22 @@ #include <lttng/kernel-version.h> +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,3,0)) +static inline +void wrapper_vm_flags_set(struct vm_area_struct *vma, + vm_flags_t flags) +{ + vm_flags_set(vma, flags); +} +#else +static inline +void wrapper_vm_flags_set(struct vm_area_struct *vma, + vm_flags_t flags) +{ + vma->vm_flags |= flags; +} +#endif + #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,6,0) \ || LTTNG_UBUNTU_KERNEL_RANGE(4,4,25,44, 4,5,0,0)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/scripts/built-in.sh new/lttng-modules-2.13.11/scripts/built-in.sh --- old/lttng-modules-2.13.9/scripts/built-in.sh 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/scripts/built-in.sh 2024-01-10 21:35:48.000000000 +0100 @@ -16,7 +16,13 @@ # Graft ourself to the kernel build system echo 'source "lttng/src/Kconfig"' >> "${KERNEL_DIR}/Kconfig" -sed -i 's#+= kernel/#+= kernel/ lttng/#' "${KERNEL_DIR}/Makefile" + +# In kernel v6.1, subdirectories were moved to Kbuild +if grep -qE '^obj-y[[:space:]]+\+= kernel/' "${KERNEL_DIR}/Kbuild"; then + echo 'obj-y += lttng/' >> "${KERNEL_DIR}/Kbuild" +else + sed -i 's#+= kernel/#+= kernel/ lttng/#' "${KERNEL_DIR}/Makefile" +fi echo >&2 echo " $0: done." >&2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/src/lib/ringbuffer/ring_buffer_mmap.c new/lttng-modules-2.13.11/src/lib/ringbuffer/ring_buffer_mmap.c --- old/lttng-modules-2.13.9/src/lib/ringbuffer/ring_buffer_mmap.c 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/src/lib/ringbuffer/ring_buffer_mmap.c 2024-01-10 21:35:48.000000000 +0100 @@ -17,6 +17,8 @@ #include <ringbuffer/frontend.h> #include <ringbuffer/vfs.h> +#include <wrapper/mm.h> + /* * fault() vm_op implementation for ring buffer file mapping. */ @@ -113,7 +115,7 @@ return -EINVAL; vma->vm_ops = &lib_ring_buffer_mmap_ops; - vma->vm_flags |= VM_DONTEXPAND; + wrapper_vm_flags_set(vma, VM_DONTEXPAND); vma->vm_private_data = buf; return 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/src/lttng-context-callstack-legacy-impl.h new/lttng-modules-2.13.11/src/lttng-context-callstack-legacy-impl.h --- old/lttng-modules-2.13.9/src/lttng-context-callstack-legacy-impl.h 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/src/lttng-context-callstack-legacy-impl.h 2024-01-10 21:35:48.000000000 +0100 @@ -150,6 +150,7 @@ struct field_data *fdata = (struct field_data *) priv; size_t orig_offset = offset; int cpu = smp_processor_id(); + struct irq_ibt_state irq_ibt_state; /* do not write data if no space is available */ trace = stack_trace_context(fdata, cpu); @@ -165,7 +166,9 @@ ++per_cpu(callstack_user_nesting, cpu); /* do the real work and reserve space */ + irq_ibt_state = wrapper_irq_ibt_save(); cs_types[fdata->mode].save_func(trace); + wrapper_irq_ibt_restore(irq_ibt_state); if (fdata->mode == CALLSTACK_USER) per_cpu(callstack_user_nesting, cpu)--; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/src/lttng-context-callstack-stackwalk-impl.h new/lttng-modules-2.13.11/src/lttng-context-callstack-stackwalk-impl.h --- old/lttng-modules-2.13.9/src/lttng-context-callstack-stackwalk-impl.h 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/src/lttng-context-callstack-stackwalk-impl.h 2024-01-10 21:35:48.000000000 +0100 @@ -152,6 +152,7 @@ struct field_data *fdata = (struct field_data *) priv; size_t orig_offset = offset; int cpu = smp_processor_id(); + struct irq_ibt_state irq_ibt_state; /* do not write data if no space is available */ trace = stack_trace_context(fdata, cpu); @@ -166,14 +167,18 @@ switch (fdata->mode) { case CALLSTACK_KERNEL: /* do the real work and reserve space */ + irq_ibt_state = wrapper_irq_ibt_save(); trace->nr_entries = save_func_kernel(trace->entries, MAX_ENTRIES, 0); + wrapper_irq_ibt_restore(irq_ibt_state); break; case CALLSTACK_USER: ++per_cpu(callstack_user_nesting, cpu); /* do the real work and reserve space */ + irq_ibt_state = wrapper_irq_ibt_save(); trace->nr_entries = save_func_user(trace->entries, MAX_ENTRIES); + wrapper_irq_ibt_restore(irq_ibt_state); per_cpu(callstack_user_nesting, cpu)--; break; default: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/src/lttng-context-prio.c new/lttng-modules-2.13.11/src/lttng-context-prio.c --- old/lttng-modules-2.13.9/src/lttng-context-prio.c 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/src/lttng-context-prio.c 2024-01-10 21:35:48.000000000 +0100 @@ -14,33 +14,28 @@ #include <lttng/events-internal.h> #include <ringbuffer/frontend_types.h> #include <wrapper/vmalloc.h> -#include <wrapper/kallsyms.h> #include <lttng/tracer.h> +#include <lttng/kernel-version.h> -static -int (*wrapper_task_prio_sym)(struct task_struct *t); - -int wrapper_task_prio_init(void) -{ - wrapper_task_prio_sym = (void *) kallsyms_lookup_funcptr("task_prio"); - if (!wrapper_task_prio_sym) { - printk(KERN_WARNING "LTTng: task_prio symbol lookup failed.\n"); - return -EINVAL; - } - return 0; -} +/* + * From kernel v3.0 to v3.8, MAX_RT_PRIO is defined in linux/sched.h. + * From kernel v3.9 to v3.14, MAX_RT_PRIO is defined in linux/sched/rt.h, + * which is not included by linux/sched.h (hence this work-around). + * From kernel v3.15 onwards, MAX_RT_PRIO is defined in linux/sched/prio.h, + * which is included by linux/sched.h. + */ +#if LTTNG_KERNEL_RANGE(3,9,0, 3,15,0) +# include <linux/sched/rt.h> +#endif /* - * Canary function to check for 'task_prio()' at compile time. - * - * From 'include/linux/sched.h': - * - * extern int task_prio(const struct task_struct *p); + * task_prio() has been implemented as p->prio - MAX_RT_PRIO since at + * least kernel v3.0. */ -__attribute__((unused)) static -int __canary__task_prio(const struct task_struct *p) +static +int wrapper_task_prio(struct task_struct *p) { - return task_prio(p); + return p->prio - MAX_RT_PRIO; } static @@ -60,7 +55,7 @@ { int prio; - prio = wrapper_task_prio_sym(current); + prio = wrapper_task_prio(current); chan->ops->event_write(ctx, &prio, sizeof(prio), lttng_alignof(prio)); } @@ -69,7 +64,7 @@ struct lttng_kernel_probe_ctx *lttng_probe_ctx, struct lttng_ctx_value *value) { - value->u.s64 = wrapper_task_prio_sym(current); + value->u.s64 = wrapper_task_prio(current); } static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/src/lttng-events.c new/lttng-modules-2.13.11/src/lttng-events.c --- old/lttng-modules-2.13.9/src/lttng-events.c 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/src/lttng-events.c 2024-01-10 21:35:48.000000000 +0100 @@ -49,7 +49,8 @@ #include <ringbuffer/frontend.h> #include <wrapper/time.h> -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,16,0)) +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,16,0) \ + || LTTNG_RHEL_KERNEL_RANGE(5,14,0,162,0,0, 5,15,0,0,0,0)) #include <linux/stdarg.h> #else #include <stdarg.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/src/lttng-tracepoint.c new/lttng-modules-2.13.11/src/lttng-tracepoint.c --- old/lttng-modules-2.13.9/src/lttng-tracepoint.c 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/src/lttng-tracepoint.c 2024-01-10 21:35:48.000000000 +0100 @@ -41,7 +41,7 @@ struct tracepoint *tp; int refcount; struct list_head probes; - char name[0]; + char name[]; }; struct lttng_tp_probe { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/src/probes/Kbuild new/lttng-modules-2.13.11/src/probes/Kbuild --- old/lttng-modules-2.13.9/src/probes/Kbuild 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/src/probes/Kbuild 2024-01-10 21:35:48.000000000 +0100 @@ -67,7 +67,8 @@ ifeq ($(kvm_dep_emulate_check),ok) CFLAGS_lttng-probe-kvm-x86.o += -I$(srctree)/virt/kvm \ -I$(srctree)/arch/x86/kvm - CFLAGS_lttng-probe-kvm-x86-mmu.o += -I$(srctree)/virt/kvm + CFLAGS_lttng-probe-kvm-x86-mmu.o += -I$(srctree)/virt/kvm \ + -I$(srctree)/arch/x86/kvm obj-$(CONFIG_LTTNG) += lttng-probe-kvm-x86.o obj-$(CONFIG_LTTNG) += lttng-probe-kvm-x86-mmu.o else # ($(kvm_dep_emulate_check),ok) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/src/probes/lttng-uprobes.c new/lttng-modules-2.13.11/src/probes/lttng-uprobes.c --- old/lttng-modules-2.13.9/src/probes/lttng-uprobes.c 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/src/probes/lttng-uprobes.c 2024-01-10 21:35:48.000000000 +0100 @@ -10,6 +10,7 @@ */ #include <wrapper/fdtable.h> +#include <linux/file.h> #include <linux/list.h> #include <linux/module.h> #include <linux/namei.h> @@ -180,7 +181,7 @@ * Returns the file backing the given fd. Needs to be done inside an RCU * critical section. */ - file = lttng_lookup_fd_rcu(fd); + file = lttng_lookup_fdget_rcu(fd); if (file == NULL) { printk(KERN_WARNING "LTTng: Cannot access file backing the fd(%d)\n", fd); inode = NULL; @@ -191,8 +192,11 @@ inode = igrab(file->f_path.dentry->d_inode); if (inode == NULL) printk(KERN_WARNING "LTTng: Cannot grab a reference on the inode.\n"); + error: rcu_read_unlock(); + if (file) + fput(file); return inode; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/src/wrapper/irqdesc.c new/lttng-modules-2.13.11/src/wrapper/irqdesc.c --- old/lttng-modules-2.13.9/src/wrapper/irqdesc.c 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/src/wrapper/irqdesc.c 2024-01-10 21:35:48.000000000 +0100 @@ -30,7 +30,13 @@ if (!irq_to_desc_sym) irq_to_desc_sym = (void *) kallsyms_lookup_funcptr("irq_to_desc"); if (irq_to_desc_sym) { - return irq_to_desc_sym(irq); + struct irq_ibt_state irq_ibt_state; + struct irq_desc *ret; + + irq_ibt_state = wrapper_irq_ibt_save(); + ret = irq_to_desc_sym(irq); + wrapper_irq_ibt_restore(irq_ibt_state); + return ret; } else { printk_once(KERN_WARNING "LTTng: irq_to_desc symbol lookup failed.\n"); return NULL; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/src/wrapper/kallsyms.c new/lttng-modules-2.13.11/src/wrapper/kallsyms.c --- old/lttng-modules-2.13.9/src/wrapper/kallsyms.c 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/src/wrapper/kallsyms.c 2024-01-10 21:35:48.000000000 +0100 @@ -20,6 +20,25 @@ # error "LTTng-modules requires CONFIG_KPROBES on kernels >= 5.7.0" #endif +#ifdef LTTNG_CONFIG_PPC64_ELF_ABI_V1 +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0)) +#include <asm/elf.h> + +#define LTTNG_FUNC_DESC_TYPE struct func_desc +#define LTTNG_FUNC_DESC_ADDR_NAME addr + +#else + +#include <asm/types.h> + +#define LTTNG_FUNC_DESC_TYPE func_descr_t +#define LTTNG_FUNC_DESC_ADDR_NAME entry +#endif + +static +LTTNG_FUNC_DESC_TYPE kallsyms_lookup_name_func_desc; +#endif + static unsigned long (*kallsyms_lookup_name_sym)(const char *name); @@ -56,6 +75,16 @@ #ifdef LTTNG_CONFIG_PPC64_ELF_ABI_V2 /* Substract 4 bytes to get what we originally want */ addr = (unsigned long)(((char *)probe.addr) - 4); +#elif defined(LTTNG_CONFIG_PPC64_ELF_ABI_V1) + /* + * Build a function descriptor from the address of + * 'kallsyms_lookup_name' returned by kprobe and the toc of + * 'sprint_symbol' which is in the same compile unit and exported. I + * hate this on so many levels but it works. + */ + kallsyms_lookup_name_func_desc.LTTNG_FUNC_DESC_ADDR_NAME = (unsigned long) probe.addr; + kallsyms_lookup_name_func_desc.toc = ((LTTNG_FUNC_DESC_TYPE *) &sprint_symbol)->toc; + addr = (unsigned long) &kallsyms_lookup_name_func_desc; #else addr = (unsigned long)probe.addr; #endif @@ -74,9 +103,15 @@ if (!kallsyms_lookup_name_sym) { kallsyms_lookup_name_sym = (void *)do_get_kallsyms(); } - if (kallsyms_lookup_name_sym) - return kallsyms_lookup_name_sym(name); - else { + if (kallsyms_lookup_name_sym) { + struct irq_ibt_state irq_ibt_state; + unsigned long ret; + + irq_ibt_state = wrapper_irq_ibt_save(); + ret = kallsyms_lookup_name_sym(name); + wrapper_irq_ibt_restore(irq_ibt_state); + return ret; + } else { printk_once(KERN_WARNING "LTTng: requires kallsyms_lookup_name\n"); return 0; } @@ -84,3 +119,7 @@ EXPORT_SYMBOL_GPL(wrapper_kallsyms_lookup_name); #endif + +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,4,0) && defined(CONFIG_ANDROID)) +MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver); +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.9/src/wrapper/page_alloc.c new/lttng-modules-2.13.11/src/wrapper/page_alloc.c --- old/lttng-modules-2.13.9/src/wrapper/page_alloc.c 2023-03-03 16:39:24.000000000 +0100 +++ new/lttng-modules-2.13.11/src/wrapper/page_alloc.c 2024-01-10 21:35:48.000000000 +0100 @@ -37,7 +37,13 @@ { WARN_ON_ONCE(!get_pfnblock_flags_mask_sym); if (get_pfnblock_flags_mask_sym) { - return get_pfnblock_flags_mask_sym(page, pfn, end_bitidx, mask); + struct irq_ibt_state irq_ibt_state; + unsigned long ret; + + irq_ibt_state = wrapper_irq_ibt_save(); + ret = get_pfnblock_flags_mask_sym(page, pfn, end_bitidx, mask); + wrapper_irq_ibt_restore(irq_ibt_state); + return ret; } else { return -ENOSYS; }