diff options
author | Andre Przywara <andre.przywara@arm.com> | 2015-01-12 11:56:16 -0500 |
---|---|---|
committer | Christoffer Dall <christoffer.dall@linaro.org> | 2015-01-15 07:12:27 -0500 |
commit | 924de80db9cab3e2ee53933deee7945e81808151 (patch) | |
tree | a4ee7faee0a6f3f66c5e0df260be6afcfde5404f /arch/arm/kvm | |
parent | 0d97f884810410b2e0515e29424fe1ec5357176f (diff) |
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: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Wei Huang <wei@redhat.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'arch/arm/kvm')
-rw-r--r-- | arch/arm/kvm/handle_exit.c | 8 | ||||
-rw-r--r-- | arch/arm/kvm/trace.h | 11 |
2 files changed, 12 insertions, 7 deletions
diff --git a/arch/arm/kvm/handle_exit.c b/arch/arm/kvm/handle_exit.c index a96a8043277c..95f12b2ccdcb 100644 --- a/arch/arm/kvm/handle_exit.c +++ b/arch/arm/kvm/handle_exit.c | |||
@@ -87,11 +87,13 @@ static int handle_dabt_hyp(struct kvm_vcpu *vcpu, struct kvm_run *run) | |||
87 | */ | 87 | */ |
88 | static int kvm_handle_wfx(struct kvm_vcpu *vcpu, struct kvm_run *run) | 88 | static int kvm_handle_wfx(struct kvm_vcpu *vcpu, struct kvm_run *run) |
89 | { | 89 | { |
90 | trace_kvm_wfi(*vcpu_pc(vcpu)); | 90 | if (kvm_vcpu_get_hsr(vcpu) & HSR_WFI_IS_WFE) { |
91 | if (kvm_vcpu_get_hsr(vcpu) & HSR_WFI_IS_WFE) | 91 | trace_kvm_wfx(*vcpu_pc(vcpu), true); |
92 | kvm_vcpu_on_spin(vcpu); | 92 | kvm_vcpu_on_spin(vcpu); |
93 | else | 93 | } else { |
94 | trace_kvm_wfx(*vcpu_pc(vcpu), false); | ||
94 | kvm_vcpu_block(vcpu); | 95 | kvm_vcpu_block(vcpu); |
96 | } | ||
95 | 97 | ||
96 | kvm_skip_instr(vcpu, kvm_vcpu_trap_il_is32bit(vcpu)); | 98 | kvm_skip_instr(vcpu, kvm_vcpu_trap_il_is32bit(vcpu)); |
97 | 99 | ||
diff --git a/arch/arm/kvm/trace.h b/arch/arm/kvm/trace.h index b1d640f78623..f741449121f3 100644 --- a/arch/arm/kvm/trace.h +++ b/arch/arm/kvm/trace.h | |||
@@ -140,19 +140,22 @@ TRACE_EVENT(kvm_emulate_cp15_imp, | |||
140 | __entry->CRm, __entry->Op2) | 140 | __entry->CRm, __entry->Op2) |
141 | ); | 141 | ); |
142 | 142 | ||
143 | TRACE_EVENT(kvm_wfi, | 143 | TRACE_EVENT(kvm_wfx, |
144 | TP_PROTO(unsigned long vcpu_pc), | 144 | TP_PROTO(unsigned long vcpu_pc, bool is_wfe), |
145 | TP_ARGS(vcpu_pc), | 145 | TP_ARGS(vcpu_pc, is_wfe), |
146 | 146 | ||
147 | TP_STRUCT__entry( | 147 | TP_STRUCT__entry( |
148 | __field( unsigned long, vcpu_pc ) | 148 | __field( unsigned long, vcpu_pc ) |
149 | __field( bool, is_wfe ) | ||
149 | ), | 150 | ), |
150 | 151 | ||
151 | TP_fast_assign( | 152 | TP_fast_assign( |
152 | __entry->vcpu_pc = vcpu_pc; | 153 | __entry->vcpu_pc = vcpu_pc; |
154 | __entry->is_wfe = is_wfe; | ||
153 | ), | 155 | ), |
154 | 156 | ||
155 | TP_printk("guest executed wfi at: 0x%08lx", __entry->vcpu_pc) | 157 | TP_printk("guest executed wf%c at: 0x%08lx", |
158 | __entry->is_wfe ? 'e' : 'i', __entry->vcpu_pc) | ||
156 | ); | 159 | ); |
157 | 160 | ||
158 | TRACE_EVENT(kvm_unmap_hva, | 161 | TRACE_EVENT(kvm_unmap_hva, |