Best way getting guest_rip from newer versions of kernel.trace("kvm_exit")?
William Cohen
wcohen@redhat.com
Fri Sep 23 16:02:00 GMT 2011
I have been working on instrumenting kvm. The arguments for one of the tracepoints has changed.In RHEL-6 kernel:
kernel.trace("kvm_exit") $exit_reason:unsigned int $guest_rip:long unsigned int
In Fedora-15 kernel:
kernel.trace("kvm_exit") $exit_reason:unsigned int $vcpu:struct kvm_vcpu* $isa:u32
The $guest_rip is used in https://github.com/wcohen/qemu_systemtap/blob/master/guest_exits.stp to point out which instructions in the guests are causing vm_exits. I would like to make this script work on Fedora without resorting to guru mode. The following link shows kvm_rip_read(vcpu) being used get the value:
http://lxr.linux.no/#linux+v3.0.4/arch/x86/kvm/trace.h#L187
The kvm_rip_read() function is not in general include file; it is in arch/x86/kvm/kvm_cache_regs.h. Another complication is that VCPU_REGS_RIP varies depending on CONFIG_X86_64:
http://lxr.linux.no/#linux+v3.0.4/arch/x86/include/asm/kvm_host.h#L120
Any suggestions on how to best handle this?
-Will
More information about the Systemtap
mailing list