Commit 924de80d authored by Andre Przywara's avatar Andre Przywara Committed by Christoffer Dall

ARM: KVM: extend WFI tracepoint to differentiate between wfi and wfe

Currently the trace printk talks about "wfi" only, though the trace
point triggers both on wfi and wfe traps.
Add a parameter to differentiate between the two.
Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
Reviewed-by: default avatarWei Huang <wei@redhat.com>
Signed-off-by: default avatarChristoffer Dall <christoffer.dall@linaro.org>
parent 0d97f884
...@@ -87,11 +87,13 @@ static int handle_dabt_hyp(struct kvm_vcpu *vcpu, struct kvm_run *run) ...@@ -87,11 +87,13 @@ static int handle_dabt_hyp(struct kvm_vcpu *vcpu, struct kvm_run *run)
*/ */
static int kvm_handle_wfx(struct kvm_vcpu *vcpu, struct kvm_run *run) static int kvm_handle_wfx(struct kvm_vcpu *vcpu, struct kvm_run *run)
{ {
trace_kvm_wfi(*vcpu_pc(vcpu)); if (kvm_vcpu_get_hsr(vcpu) & HSR_WFI_IS_WFE) {
if (kvm_vcpu_get_hsr(vcpu) & HSR_WFI_IS_WFE) trace_kvm_wfx(*vcpu_pc(vcpu), true);
kvm_vcpu_on_spin(vcpu); kvm_vcpu_on_spin(vcpu);
else } else {
trace_kvm_wfx(*vcpu_pc(vcpu), false);
kvm_vcpu_block(vcpu); kvm_vcpu_block(vcpu);
}
kvm_skip_instr(vcpu, kvm_vcpu_trap_il_is32bit(vcpu)); kvm_skip_instr(vcpu, kvm_vcpu_trap_il_is32bit(vcpu));
......
...@@ -140,19 +140,22 @@ TRACE_EVENT(kvm_emulate_cp15_imp, ...@@ -140,19 +140,22 @@ TRACE_EVENT(kvm_emulate_cp15_imp,
__entry->CRm, __entry->Op2) __entry->CRm, __entry->Op2)
); );
TRACE_EVENT(kvm_wfi, TRACE_EVENT(kvm_wfx,
TP_PROTO(unsigned long vcpu_pc), TP_PROTO(unsigned long vcpu_pc, bool is_wfe),
TP_ARGS(vcpu_pc), TP_ARGS(vcpu_pc, is_wfe),
TP_STRUCT__entry( TP_STRUCT__entry(
__field( unsigned long, vcpu_pc ) __field( unsigned long, vcpu_pc )
__field( bool, is_wfe )
), ),
TP_fast_assign( TP_fast_assign(
__entry->vcpu_pc = vcpu_pc; __entry->vcpu_pc = vcpu_pc;
__entry->is_wfe = is_wfe;
), ),
TP_printk("guest executed wfi at: 0x%08lx", __entry->vcpu_pc) TP_printk("guest executed wf%c at: 0x%08lx",
__entry->is_wfe ? 'e' : 'i', __entry->vcpu_pc)
); );
TRACE_EVENT(kvm_unmap_hva, TRACE_EVENT(kvm_unmap_hva,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment