From: Mathieu Desnoyers Date: Mon, 13 Apr 2020 15:44:23 +0000 (-0400) Subject: instrumentation: update x86 kvm instrumentation for kernel >= 5.7.0 X-Git-Tag: for-upstreaming-review-1~109 X-Git-Url: http://git.liburcu.org/?a=commitdiff_plain;h=9f587ab3f8fabe874b644851dd5b74e64b978aa3;p=lttng-modules.git instrumentation: update x86 kvm instrumentation for kernel >= 5.7.0 Signed-off-by: Mathieu Desnoyers --- diff --git a/instrumentation/events/lttng-module/arch/x86/kvm/trace.h b/instrumentation/events/lttng-module/arch/x86/kvm/trace.h index 7af9e1e1..6b744585 100644 --- a/instrumentation/events/lttng-module/arch/x86/kvm/trace.h +++ b/instrumentation/events/lttng-module/arch/x86/kvm/trace.h @@ -436,7 +436,7 @@ LTTNG_TRACEPOINT_EVENT_MAP(kvm_emulate_insn, kvm_x86_emulate_insn, ctf_integer(__u8, len, vcpu->arch.emulate_ctxt._eip - vcpu->arch.emulate_ctxt.fetch.start) ctf_array(__u8, insn, vcpu->arch.emulate_ctxt.fetch.data, 15) -#else +#elif (LINUX_VERSION_CODE < KERNEL_VERSION(5,7,0)) ctf_integer(__u64, rip, vcpu->arch.emulate_ctxt._eip - (vcpu->arch.emulate_ctxt.fetch.ptr - vcpu->arch.emulate_ctxt.fetch.data)) @@ -444,6 +444,14 @@ LTTNG_TRACEPOINT_EVENT_MAP(kvm_emulate_insn, kvm_x86_emulate_insn, 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) +#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, kvm_x86_ops->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) #endif ctf_integer(__u8, flags, kei_decode_mode(vcpu->arch.emulate_ctxt.mode)) ctf_integer(__u8, failed, failed)