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 2022-06-04 23:27:06 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/lttng-modules (Old) and /work/SRC/openSUSE:Factory/.lttng-modules.new.1548 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lttng-modules" Sat Jun 4 23:27:06 2022 rev:4 rq:980677 version:2.13.4 Changes: -------- --- /work/SRC/openSUSE:Factory/lttng-modules/lttng-modules.changes 2022-05-19 22:49:46.238369543 +0200 +++ /work/SRC/openSUSE:Factory/.lttng-modules.new.1548/lttng-modules.changes 2022-06-04 23:27:11.648765412 +0200 @@ -1,0 +2,25 @@ +Fri Jun 3 20:12:25 UTC 2022 - Alexei Sorokin <[email protected]> + +- Update to version 2.13.4: + * Fix: event notifier: racy use of last subbuffer record. + * Fix: bytecode interpreter context_get_index() leaves byte + order uninitialised. + * Fix: "random" tracepoints removed in stable kernels. + * Fix: random: remove unused tracepoints (v5.10, v5.15). + * Fix: sched/tracing: Append prev_state to tp args instead + (v5.18). + * Fix: mm: compaction: cleanup the compaction trace events + (v5.18). + * Fix: scsi: core: Remove <scsi/scsi_request.h> (v5.18). + * Fix: kprobes: Use rethook for kretprobe if possible (v5.18). + * Fix: random: remove unused tracepoints (v5.18). + * Fix: scsi: block: Remove REQ_OP_WRITE_SAME support (v5.18). + * Fix: block: remove genhd.h (v5.18). + * Fix: sched/tracing: Don't re-read p->state when emitting + sched_switch event (v5.18). + * Fix: KVM: x86: Unexport kvm_x86_ops (v5.18). + * Fix: do not warn on unknown counter ioctl. + * Fix: tracepoint event: allow same provider and event name. + * Fix: compaction migratepages event name. + +------------------------------------------------------------------- @@ -534 +558,0 @@ - Old: ---- lttng-modules-2.13.3.tar.bz2 lttng-modules-2.13.3.tar.bz2.asc New: ---- lttng-modules-2.13.4.tar.bz2 lttng-modules-2.13.4.tar.bz2.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ lttng-modules.spec ++++++ --- /var/tmp/diff_new_pack.EGwPWf/_old 2022-06-04 23:27:12.736766511 +0200 +++ /var/tmp/diff_new_pack.EGwPWf/_new 2022-06-04 23:27:12.744766520 +0200 @@ -17,7 +17,7 @@ Name: lttng-modules -Version: 2.13.3 +Version: 2.13.4 Release: 0 Summary: Licensing information for package lttng-modules License: GPL-2.0-only AND LGPL-2.1-only AND MIT ++++++ lttng-modules-2.13.3.tar.bz2 -> lttng-modules-2.13.4.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.3/ChangeLog new/lttng-modules-2.13.4/ChangeLog --- old/lttng-modules-2.13.3/ChangeLog 2022-03-25 19:06:26.000000000 +0100 +++ new/lttng-modules-2.13.4/ChangeLog 2022-06-03 21:00:26.000000000 +0200 @@ -1,3 +1,21 @@ +2022-06-03 (National Repeat Day) (National Repeat Day) LTTng modules 2.13.4 + * Fix: event notifier: racy use of last subbuffer record + * Fix: bytecode interpreter context_get_index() leaves byte order uninitialized + * fix: 'random' tracepoints removed in stable kernels + * fix: random: remove unused tracepoints (v5.10, v5.15) + * fix: sched/tracing: Append prev_state to tp args instead (v5.18) + * fix: mm: compaction: cleanup the compaction trace events (v5.18) + * fix: scsi: core: Remove <scsi/scsi_request.h> (v5.18) + * fix: kprobes: Use rethook for kretprobe if possible (v5.18) + * fix: random: remove unused tracepoints (v5.18) + * fix: scsi: block: Remove REQ_OP_WRITE_SAME support (v5.18) + * fix: block: remove genhd.h (v5.18) + * fix: sched/tracing: Don't re-read p->state when emitting sched_switch event (v5.18) + * fix: KVM: x86: Unexport kvm_x86_ops (v5.18) + * Fix: do not warn on unknown counter ioctl + * Fix: tracepoint event: allow same provider and event name + * Fix: compaction migratepages event name + 2022-03-25 (National Waffle Day) LTTng modules 2.13.3 * Document expected ISO8601 time formats in ABI header * Fix: lttng ABI: lttng_counter_ioctl() tainted scalar diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.3/include/instrumentation/events/arch/x86/kvm/trace.h new/lttng-modules-2.13.4/include/instrumentation/events/arch/x86/kvm/trace.h --- old/lttng-modules-2.13.3/include/instrumentation/events/arch/x86/kvm/trace.h 2022-03-25 19:06:26.000000000 +0100 +++ new/lttng-modules-2.13.4/include/instrumentation/events/arch/x86/kvm/trace.h 2022-06-03 21:00:26.000000000 +0200 @@ -9,6 +9,7 @@ #include <asm/clocksource.h> #endif #include <lttng/kernel-version.h> +#include <wrapper/kvm-x86.h> #include <../arch/x86/kvm/lapic.h> #include <../arch/x86/kvm/kvm_cache_regs.h> @@ -115,7 +116,40 @@ /* * Tracepoint for kvm guest exit: */ -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,16,0)) +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0)) +LTTNG_TRACEPOINT_EVENT_CODE_MAP(kvm_exit, kvm_x86_exit, + TP_PROTO(struct kvm_vcpu *vcpu, u32 isa), + TP_ARGS(vcpu, isa), + + TP_locvar( + u32 exit_reason; + u64 info1, info2; + u32 intr_info, error_code; + ), + + TP_code_pre( + lttng_kvm_x86_get_exit_info(vcpu, + &tp_locvar->exit_reason, + &tp_locvar->info1, + &tp_locvar->info2, + &tp_locvar->intr_info, + &tp_locvar->error_code); + ), + + TP_FIELDS( + ctf_integer(unsigned int, exit_reason, tp_locvar->exit_reason) + ctf_integer(unsigned long, guest_rip, kvm_rip_read(vcpu)) + ctf_integer(u32, isa, isa) + ctf_integer(u64, info1, tp_locvar->info1) + ctf_integer(u64, info2, tp_locvar->info2) + ctf_integer(u32, intr_info, tp_locvar->intr_info) + ctf_integer(u32, error_code, tp_locvar->error_code) + ctf_integer(unsigned int, vcpu_id, vcpu->vcpu_id) + ), + + TP_code_post() +) +#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,16,0)) LTTNG_TRACEPOINT_EVENT_CODE_MAP(kvm_exit, kvm_x86_exit, TP_PROTO(struct kvm_vcpu *vcpu, u32 isa), TP_ARGS(vcpu, isa), @@ -535,7 +569,7 @@ vcpu->arch.emulate_ctxt.fetch.data) ctf_array(__u8, insn, vcpu->arch.emulate_ctxt.fetch.data, 15) ctf_integer(__u8, flags, kei_decode_mode(vcpu->arch.emulate_ctxt.mode)) -#else +#elif (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(5,18,0)) ctf_integer(__u64, rip, vcpu->arch.emulate_ctxt->_eip - (vcpu->arch.emulate_ctxt->fetch.ptr - vcpu->arch.emulate_ctxt->fetch.data)) @@ -543,6 +577,15 @@ ctf_integer(__u8, len, vcpu->arch.emulate_ctxt->fetch.ptr - vcpu->arch.emulate_ctxt->fetch.data) ctf_array(__u8, insn, vcpu->arch.emulate_ctxt->fetch.data, 15) + ctf_integer(__u8, flags, kei_decode_mode(vcpu->arch.emulate_ctxt->mode)) +#else + ctf_integer(__u64, rip, vcpu->arch.emulate_ctxt->_eip - + (vcpu->arch.emulate_ctxt->fetch.ptr - + vcpu->arch.emulate_ctxt->fetch.data)) + ctf_integer(__u32, csbase, lttng_kvm_x86_get_segment_base(vcpu, VCPU_SREG_CS)) + ctf_integer(__u8, len, vcpu->arch.emulate_ctxt->fetch.ptr - + vcpu->arch.emulate_ctxt->fetch.data) + ctf_array(__u8, insn, vcpu->arch.emulate_ctxt->fetch.data, 15) ctf_integer(__u8, flags, kei_decode_mode(vcpu->arch.emulate_ctxt->mode)) #endif ctf_integer(__u8, failed, failed) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.3/include/instrumentation/events/block.h new/lttng-modules-2.13.4/include/instrumentation/events/block.h --- old/lttng-modules-2.13.3/include/instrumentation/events/block.h 2022-03-25 19:06:26.000000000 +0100 +++ new/lttng-modules-2.13.4/include/instrumentation/events/block.h 2022-06-03 21:00:26.000000000 +0200 @@ -11,9 +11,9 @@ #include <linux/trace_seq.h> #include <lttng/kernel-version.h> -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) +#if LTTNG_KERNEL_RANGE(4,11,0, 5,18,0) #include <scsi/scsi_request.h> -#endif /* (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) */ +#endif /* LTTNG_KERNEL_RANGE(4,11,0, 5,18,0) */ #ifndef _TRACE_BLOCK_DEF_ #define _TRACE_BLOCK_DEF_ @@ -66,6 +66,37 @@ #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)) +#ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM +#define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \ + ctf_enum(block_rq_type, type, rwbs, \ + ( (op) == REQ_OP_WRITE ? RWBS_FLAG_WRITE : \ + ( (op) == REQ_OP_DISCARD ? RWBS_FLAG_DISCARD : \ + ( (op) == REQ_OP_SECURE_ERASE ? (RWBS_FLAG_DISCARD | RWBS_FLAG_SECURE) : \ + ( (op) == REQ_OP_FLUSH ? RWBS_FLAG_FLUSH : \ + ( (op) == REQ_OP_READ ? RWBS_FLAG_READ : \ + ( 0 )))))) \ + | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \ + | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \ + | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \ + | ((rw) & REQ_PREFLUSH ? RWBS_FLAG_PREFLUSH : 0) \ + | ((rw) & REQ_FUA ? RWBS_FLAG_FUA : 0)) +#else +#define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \ + ctf_integer(type, rwbs, \ + ( (op) == REQ_OP_WRITE ? RWBS_FLAG_WRITE : \ + ( (op) == REQ_OP_DISCARD ? RWBS_FLAG_DISCARD : \ + ( (op) == REQ_OP_SECURE_ERASE ? (RWBS_FLAG_DISCARD | RWBS_FLAG_SECURE) : \ + ( (op) == REQ_OP_FLUSH ? RWBS_FLAG_FLUSH : \ + ( (op) == REQ_OP_READ ? RWBS_FLAG_READ : \ + ( 0 )))))) \ + | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \ + | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \ + | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \ + | ((rw) & REQ_PREFLUSH ? RWBS_FLAG_PREFLUSH : 0) \ + | ((rw) & REQ_FUA ? RWBS_FLAG_FUA : 0)) +#endif /* CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM */ +#else #ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM #define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \ ctf_enum(block_rq_type, type, rwbs, \ @@ -95,6 +126,7 @@ | ((rw) & REQ_PREFLUSH ? RWBS_FLAG_PREFLUSH : 0) \ | ((rw) & REQ_FUA ? RWBS_FLAG_FUA : 0)) #endif /* CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM */ +#endif #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.3/include/instrumentation/events/compaction.h new/lttng-modules-2.13.4/include/instrumentation/events/compaction.h --- old/lttng-modules-2.13.3/include/instrumentation/events/compaction.h 2022-03-25 19:06:26.000000000 +0100 +++ new/lttng-modules-2.13.4/include/instrumentation/events/compaction.h 2022-06-03 21:00:26.000000000 +0200 @@ -97,8 +97,25 @@ #endif /* #else #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,0,0) */ -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0)) -LTTNG_TRACEPOINT_EVENT(mm_compaction_migratepages, +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0)) +LTTNG_TRACEPOINT_EVENT_MAP(mm_compaction_migratepages, + + compaction_migratepages, + + TP_PROTO(struct compact_control *cc, + unsigned int nr_succeeded), + + TP_ARGS(cc, nr_succeeded), + + TP_FIELDS( + ctf_integer(unsigned long, nr_migrated, nr_succeeded) + ctf_integer(unsigned long, nr_failed, cc->nr_migratepages - nr_succeeded) + ) +) +#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0)) +LTTNG_TRACEPOINT_EVENT_MAP(mm_compaction_migratepages, + + compaction_migratepages, TP_PROTO(unsigned long nr_all, unsigned int nr_succeeded), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.3/include/instrumentation/events/sched.h new/lttng-modules-2.13.4/include/instrumentation/events/sched.h --- old/lttng-modules-2.13.3/include/instrumentation/events/sched.h 2022-03-25 19:06:26.000000000 +0100 +++ new/lttng-modules-2.13.4/include/instrumentation/events/sched.h 2022-06-03 21:00:26.000000000 +0200 @@ -20,7 +20,37 @@ #ifndef _TRACE_SCHED_DEF_ #define _TRACE_SCHED_DEF_ -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0)) +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0)) + +static inline long __trace_sched_switch_state(bool preempt, + unsigned int prev_state, + struct task_struct *p) +{ + unsigned int state; + +#ifdef CONFIG_SCHED_DEBUG + BUG_ON(p != current); +#endif /* CONFIG_SCHED_DEBUG */ + + /* + * Preemption ignores task state, therefore preempted tasks are always + * RUNNING (we will not have dequeued if state != RUNNING). + */ + if (preempt) + return TASK_REPORT_MAX; + + /* + * task_state_index() uses fls() and returns a value from 0-8 range. + * Decrement it by 1 (except TASK_RUNNING state i.e 0) before using + * it for left shift operation to get the correct task->state + * mapping. + */ + state = __task_state_index(prev_state, p->exit_state); + + return state ? (1 << (state - 1)) : state; +} + +#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0)) static inline long __trace_sched_switch_state(bool preempt, struct task_struct *p) { @@ -321,43 +351,81 @@ /* * Tracepoint for task switches, performed by the scheduler: */ + +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0)) LTTNG_TRACEPOINT_EVENT(sched_switch, -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,4,0)) TP_PROTO(bool preempt, - struct task_struct *prev, - struct task_struct *next), + struct task_struct *prev, + struct task_struct *next, + unsigned int prev_state), - TP_ARGS(preempt, prev, next), + TP_ARGS(preempt, prev, next, prev_state), + + TP_FIELDS( + ctf_array_text(char, prev_comm, prev->comm, TASK_COMM_LEN) + ctf_integer(pid_t, prev_tid, prev->pid) + ctf_integer(int, prev_prio, prev->prio - MAX_RT_PRIO) +#ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM + ctf_enum(task_state, long, prev_state, __trace_sched_switch_state(preempt, prev_state, prev)) #else - TP_PROTO(struct task_struct *prev, + ctf_integer(long, prev_state, __trace_sched_switch_state(preempt, prev_state, prev)) +#endif + ctf_array_text(char, next_comm, next->comm, TASK_COMM_LEN) + ctf_integer(pid_t, next_tid, next->pid) + ctf_integer(int, next_prio, next->prio - MAX_RT_PRIO) + ) +) + +#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,4,0)) + +LTTNG_TRACEPOINT_EVENT(sched_switch, + + TP_PROTO(bool preempt, + struct task_struct *prev, struct task_struct *next), - TP_ARGS(prev, next), -#endif /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,4,0)) */ + TP_ARGS(preempt, prev, next), TP_FIELDS( ctf_array_text(char, prev_comm, prev->comm, TASK_COMM_LEN) ctf_integer(pid_t, prev_tid, prev->pid) ctf_integer(int, prev_prio, prev->prio - MAX_RT_PRIO) -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,4,0)) #ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM ctf_enum(task_state, long, prev_state, __trace_sched_switch_state(preempt, prev)) #else ctf_integer(long, prev_state, __trace_sched_switch_state(preempt, prev)) #endif + ctf_array_text(char, next_comm, next->comm, TASK_COMM_LEN) + ctf_integer(pid_t, next_tid, next->pid) + ctf_integer(int, next_prio, next->prio - MAX_RT_PRIO) + ) +) + #else + +LTTNG_TRACEPOINT_EVENT(sched_switch, + + TP_PROTO(struct task_struct *prev, + struct task_struct *next), + + TP_ARGS(prev, next), + + TP_FIELDS( + ctf_array_text(char, prev_comm, prev->comm, TASK_COMM_LEN) + ctf_integer(pid_t, prev_tid, prev->pid) + ctf_integer(int, prev_prio, prev->prio - MAX_RT_PRIO) #ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM ctf_enum(task_state, long, prev_state, __trace_sched_switch_state(prev)) #else ctf_integer(long, prev_state, __trace_sched_switch_state(prev)) #endif -#endif ctf_array_text(char, next_comm, next->comm, TASK_COMM_LEN) ctf_integer(pid_t, next_tid, next->pid) ctf_integer(int, next_prio, next->prio - MAX_RT_PRIO) ) ) +#endif /* * Tracepoint for a task being migrated: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.3/include/lttng/tracepoint-event-impl.h new/lttng-modules-2.13.4/include/lttng/tracepoint-event-impl.h --- old/lttng-modules-2.13.3/include/lttng/tracepoint-event-impl.h 2022-03-25 19:06:26.000000000 +0100 +++ new/lttng-modules-2.13.4/include/lttng/tracepoint-event-impl.h 2022-06-03 21:00:26.000000000 +0200 @@ -1255,7 +1255,7 @@ #define TP_ID1(_token, _system) _token##_system #define TP_ID(_token, _system) TP_ID1(_token, _system) -static const struct lttng_kernel_event_desc * const TP_ID(__event_desc___, TRACE_SYSTEM)[] = { +static const struct lttng_kernel_event_desc * const TP_ID(__provider_event_desc___, TRACE_SYSTEM)[] = { #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) }; @@ -1274,8 +1274,8 @@ /* non-const because list head will be modified when registered. */ static __used struct lttng_kernel_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = { .provider_name = __stringify(TRACE_SYSTEM), - .event_desc = TP_ID(__event_desc___, TRACE_SYSTEM), - .nr_events = ARRAY_SIZE(TP_ID(__event_desc___, TRACE_SYSTEM)), + .event_desc = TP_ID(__provider_event_desc___, TRACE_SYSTEM), + .nr_events = ARRAY_SIZE(TP_ID(__provider_event_desc___, TRACE_SYSTEM)), .head = { NULL, NULL }, .lazy_init_head = { NULL, NULL }, .lazy = 0, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.3/include/lttng/tracer.h new/lttng-modules-2.13.4/include/lttng/tracer.h --- old/lttng-modules-2.13.3/include/lttng/tracer.h 2022-03-25 19:06:26.000000000 +0100 +++ new/lttng-modules-2.13.4/include/lttng/tracer.h 2022-06-03 21:00:26.000000000 +0200 @@ -28,7 +28,7 @@ #define LTTNG_MODULES_MAJOR_VERSION 2 #define LTTNG_MODULES_MINOR_VERSION 13 -#define LTTNG_MODULES_PATCHLEVEL_VERSION 3 +#define LTTNG_MODULES_PATCHLEVEL_VERSION 4 #define LTTNG_MODULES_EXTRAVERSION "" #define LTTNG_VERSION_NAME "Nordicit??" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.3/include/wrapper/genhd.h new/lttng-modules-2.13.4/include/wrapper/genhd.h --- old/lttng-modules-2.13.3/include/wrapper/genhd.h 2022-03-25 19:06:26.000000000 +0100 +++ new/lttng-modules-2.13.4/include/wrapper/genhd.h 2022-06-03 21:00:26.000000000 +0200 @@ -12,7 +12,11 @@ #ifndef _LTTNG_WRAPPER_GENHD_H #define _LTTNG_WRAPPER_GENHD_H +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0)) +#include <linux/blkdev.h> +#else #include <linux/genhd.h> +#endif #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0)) #define LTTNG_GENHD_FL_HIDDEN GENHD_FL_HIDDEN diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.3/include/wrapper/kprobes.h new/lttng-modules-2.13.4/include/wrapper/kprobes.h --- old/lttng-modules-2.13.3/include/wrapper/kprobes.h 2022-03-25 19:06:26.000000000 +0100 +++ new/lttng-modules-2.13.4/include/wrapper/kprobes.h 2022-06-03 21:00:26.000000000 +0200 @@ -29,4 +29,21 @@ #endif /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0) */ + +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0)) +static inline +unsigned long lttng_get_kretprobe_retaddr(struct kretprobe_instance *ri) +{ + return get_kretprobe_retaddr(ri); +} + +#else + +static inline +unsigned long lttng_get_kretprobe_retaddr(struct kretprobe_instance *ri) +{ + return (unsigned long) ri->ret_addr; +} +#endif + #endif /* _LTTNG_WRAPPER_KPROBES_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.3/include/wrapper/kvm-x86.h new/lttng-modules-2.13.4/include/wrapper/kvm-x86.h --- old/lttng-modules-2.13.3/include/wrapper/kvm-x86.h 1970-01-01 01:00:00.000000000 +0100 +++ new/lttng-modules-2.13.4/include/wrapper/kvm-x86.h 2022-06-03 21:00:26.000000000 +0200 @@ -0,0 +1,72 @@ +/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only) + * + * wrapper/kvm-x86.h + * + * Copyright (C) 2022 Michael Jeanson <[email protected]> + */ + +#ifndef _LTTNG_WRAPPER_KVM_X86_H +#define _LTTNG_WRAPPER_KVM_X86_H + +#include <linux/kvm_host.h> +#include <lttng/kernel-version.h> + +#if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0) + +#ifdef CONFIG_KALLSYMS_ALL +#include <linux/kallsyms.h> +#include <wrapper/kallsyms.h> + +static struct kvm_x86_ops *kvm_x86_ops_sym; + +static inline +void lttng_kvm_x86_get_exit_info( + struct kvm_vcpu *vcpu, u32 *reason, + u64 *info1, u64 *info2, + u32 *exit_int_info, u32 *exit_int_info_err_code) +{ + if (!kvm_x86_ops_sym) + kvm_x86_ops_sym = + (void *) kallsyms_lookup_dataptr("kvm_x86_ops"); + + if (kvm_x86_ops_sym) { + kvm_x86_ops_sym->get_exit_info(vcpu, reason, info1, info2, + exit_int_info, exit_int_info_err_code); + } else { + printk_once(KERN_WARNING "LTTng: kvm_x86_ops symbol lookup failed.\n"); + } +} + +static inline +u64 lttng_kvm_x86_get_segment_base(struct kvm_vcpu *vcpu, int seg) +{ + if (!kvm_x86_ops_sym) + kvm_x86_ops_sym = + (void *) kallsyms_lookup_dataptr("kvm_x86_ops"); + + if (kvm_x86_ops_sym) { + return kvm_x86_ops_sym->get_segment_base(vcpu, seg); + } else { + printk_once(KERN_WARNING "LTTng: kvm_x86_ops symbol lookup failed.\n"); + return 0; + } +} + +/* + * Canary function to check for 'kvm_x86_ops' at compile time. + * + * From 'arch/x86/include/asm/kvm_host.h': + * + * extern struct kvm_x86_ops kvm_x86_ops;; + */ +static inline +unsigned int __canary__kvm_x86_ops(void) +{ + return kvm_x86_ops.vm_size; +} + +#endif /* CONFIG_KALLSYMS_ALL */ + +#endif + +#endif /* _LTTNG_WRAPPER_KVM_X86_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.3/src/lttng-abi.c new/lttng-modules-2.13.4/src/lttng-abi.c --- old/lttng-modules-2.13.3/src/lttng-abi.c 2022-03-25 19:06:26.000000000 +0100 +++ new/lttng-modules-2.13.4/src/lttng-abi.c 2022-06-03 21:00:26.000000000 +0200 @@ -730,7 +730,6 @@ return lttng_kernel_counter_clear(counter, indexes); } default: - WARN_ON_ONCE(1); return -ENOSYS; } } @@ -1017,7 +1016,7 @@ /* Finish copy of previous record */ if (*ppos != 0) { - if (read_count < count) { + if (count != 0) { len = chan->iter.len_left; read_offset = *ppos; goto skip_get_next; @@ -1097,7 +1096,8 @@ chan->iter.len_left = 0; put_record: - lib_ring_buffer_put_current_record(buf); + if (*ppos == 0) + lib_ring_buffer_put_current_record(buf); return read_count; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.3/src/lttng-bytecode-interpreter.c new/lttng-modules-2.13.4/src/lttng-bytecode-interpreter.c --- old/lttng-modules-2.13.3/src/lttng-bytecode-interpreter.c 2022-03-25 19:06:26.000000000 +0100 +++ new/lttng-modules-2.13.4/src/lttng-bytecode-interpreter.c 2022-06-03 21:00:26.000000000 +0200 @@ -294,6 +294,7 @@ ptr->u.u64 = v.u.s64; /* Cast. */ ptr->ptr = &ptr->u.u64; } + ptr->rev_bo = lttng_kernel_get_type_integer(field->type)->reverse_byte_order; break; case lttng_kernel_type_enum: { @@ -310,6 +311,7 @@ ptr->u.u64 = v.u.s64; /* Cast. */ ptr->ptr = &ptr->u.u64; } + ptr->rev_bo = integer_type->reverse_byte_order; break; } case lttng_kernel_type_array: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.3/src/probes/Kbuild new/lttng-modules-2.13.4/src/probes/Kbuild --- old/lttng-modules-2.13.3/src/probes/Kbuild 2022-03-25 19:06:26.000000000 +0100 +++ new/lttng-modules-2.13.4/src/probes/Kbuild 2022-06-03 21:00:26.000000000 +0200 @@ -167,7 +167,22 @@ endif # $(wildcard $(btrfs_dep)) endif # CONFIG_BTRFS_FS -obj-$(CONFIG_LTTNG) += lttng-probe-compaction.o +# A dependency on internal header 'mm/internal.h' was introduced in v5.18 +compaction_dep = $(srctree)/mm/internal.h +compaction_dep_wildcard = $(wildcard $(compaction_dep)) +compaction_dep_check = $(shell \ +if [ \( $(VERSION) -ge 6 \ + -o \( $(VERSION) -eq 5 -a $(PATCHLEVEL) -ge 18 \) \) -a \ + -z "$(compaction_dep_wildcard)" ] ; then \ + echo "warn" ; \ +else \ + echo "ok" ; \ +fi ;) +ifeq ($(compaction_dep_check),ok) + obj-$(CONFIG_LTTNG) += lttng-probe-compaction.o +else + $(warning Files $(compaction_dep) not found. Probe "compaction" is disabled. Use full kernel source tree to enable it.) +endif # $(wildcard $(compaction_dep)) ifneq ($(CONFIG_EXT4_FS),) ext4_dep = $(srctree)/fs/ext4/*.h @@ -187,13 +202,11 @@ CFLAGS_lttng-probe-printk.o += -Wframe-larger-than=2200 endif -obj-$(CONFIG_LTTNG) += $(shell \ - if [ $(VERSION) -ge 4 \ - -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 6 \) \ - -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 5 -a $(SUBLEVEL) -ge 2 \) \ - -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 4 -a $(SUBLEVEL) -ge 9 \) \ - -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 0 -a $(SUBLEVEL) -ge 41 \) ] ; then \ - echo "lttng-probe-random.o" ; fi;) +# Introduced in v3.6, remove in v5.18 +random_dep = $(srctree)/include/trace/events/random.h +ifneq ($(wildcard $(random_dep)),) + obj-$(CONFIG_LTTNG) += lttng-probe-random.o +endif obj-$(CONFIG_LTTNG) += $(shell \ if [ $(VERSION) -ge 4 \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.3/src/probes/lttng-kretprobes.c new/lttng-modules-2.13.4/src/probes/lttng-kretprobes.c --- old/lttng-modules-2.13.3/src/probes/lttng-kretprobes.c 2022-03-25 19:06:26.000000000 +0100 +++ new/lttng-modules-2.13.4/src/probes/lttng-kretprobes.c 2022-06-03 21:00:26.000000000 +0200 @@ -81,7 +81,7 @@ int ret; payload.ip = (unsigned long) lttng_get_kretprobe(krpi)->kp.addr; - payload.parent_ip = (unsigned long) krpi->ret_addr; + payload.parent_ip = lttng_get_kretprobe_retaddr(krpi); lib_ring_buffer_ctx_init(&ctx, event_recorder, sizeof(payload), lttng_alignof(payload), <tng_probe_ctx); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-modules-2.13.3/src/probes/lttng-probe-compaction.c new/lttng-modules-2.13.4/src/probes/lttng-probe-compaction.c --- old/lttng-modules-2.13.3/src/probes/lttng-probe-compaction.c 2022-03-25 19:06:26.000000000 +0100 +++ new/lttng-modules-2.13.4/src/probes/lttng-probe-compaction.c 2022-06-03 21:00:26.000000000 +0200 @@ -10,6 +10,11 @@ #include <linux/module.h> #include <lttng/tracer.h> +#include <lttng/kernel-version.h> + +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0)) +#include "../mm/internal.h" +#endif /* * Create the tracepoint static inlines from the kernel to validate that our
