instrumentation: update x86 kvm instrumentation for kernel >= 5.7.0
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 13 Apr 2020 15:44:23 +0000 (11:44 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 13 Apr 2020 16:17:47 +0000 (12:17 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
instrumentation/events/lttng-module/arch/x86/kvm/trace.h

index 7af9e1e185f085d349720c8441ca29f8c0968bd6..6b744585da7ad560b5311ebad66da4419569033c 100644 (file)
@@ -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)
This page took 0.027433 seconds and 4 git commands to generate.