KVM: arm/arm64: Output Guest cntvoff value
PATCH 1/1 KVM: arm/arm64: Output Guest cntvoff value
From: Amit Tomar <[email protected]>
This provides an easy access to guest's CVTVOFF value, somewhat similar to how x86 outputs TSC offset value.
--- virt/kvm/arm/arch_timer.c | 1 + virt/kvm/arm/trace.h | 15 +++++++++++++++ 2 files changed, 16 insertions(+)
virt/kvm/arm/arch_timer.c +1 -0
@@ -466,4 +466,5 @@ void kvm_timer_enable(struct kvm *kvm)void kvm_timer_init (struct kvm *kvm) { kvm->arch.timer.cntvoff =kvm_phys_timer_read (); +trace_kvm_timer_init (kvm->arch.timer.cntvoff); }
virt/kvm/arm/trace.h +15 -0
@@ -52,6 +52,21 @@ TRACE_EVENT(kvm_timer_update_irq, __entry->vcpu_id, __entry->irq, __entry->level) ); +TRACE_EVENT (kvm_timer_init, + TP_PROTO(unsigned long long cntvoff), +TP_ARGS (cntvoff), + +TP_STRUCT__entry ( + __field( unsigned long long, cntvoff) + ), + +TP_fast_assign ( + __entry->cntvoff = cntvoff; + ), + +TP_printk ("CNTVOFF: %llx" , __entry->cntvoff) +); +#endif /* _TRACE_KVM_H */ #undef TRACE_INCLUDE_PATH
Signature · 1 line
1.7.9.5
Quoted 6 lines · On Sat, Jan 02, 2016 at 12:28:29AM +0530, [email protected] wrote:
From: Amit Tomar <[email protected]>
This provides an easy access to guest's CVTVOFF value, somewhat similar to how x86 outputs TSC offset value.
Signed-off-by Amit Singh Tomar <[email protected]>
Out of curiosity, what is the value of having this?
Thanks,
-Christoffer
Quoted 1 line
Out of curiosity, what is the value of having this?
As we know that host and guest clocks are not in sync(Running at a difference of CNTVOFF value initialized in guest). This value can be used to correlate the trace event between host and guest.
Thanks,
Amit.
Quoted 6 lines · Amit Tomer
Quoted 1 line
Out of curiosity, what is the value of having this?
As we know that host and guest clocks are not in sync(Running at a difference of CNTVOFF value initialized in guest). This value can be used to correlate the trace event between host and guest.
ok, I'm fine with this patch.
-Christoffer
Quoted 1 line
ok, I'm fine with this patch.
ok, Thanks.