提交 fb11420d 编写于 作者: Y Ying Fang 提交者: Yang Yingliang

KVM: arm/arm64: use esr_ec as trace field of kvm_exit tracepoint

euleros inclusion
category: bugfix

-------------------------------------------------

The filter name 'exit_reason' is only applicable to x86, however kvm_stat use
this trace fileld to filter Guest trap info. It will fail to call
ioctl(fd, SET_FILTER, fileld_name) on a different architecture other than x86.

This patch makes arm64 use 'esr_ec' as the trace fileld of kvm_exit
tracepoint, so that kvm_stat will work.
Signed-off-by: NYing Fang <fangying1@huawei.com>
Reviewed-by: NHailiang Zhang <zhang.zhanghailiang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 6ab519b7
......@@ -853,7 +853,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run)
* guest time.
*/
guest_exit();
trace_kvm_exit(vcpu->vcpu_id, ret, *vcpu_pc(vcpu));
trace_kvm_exit(ret, kvm_vcpu_trap_get_class(vcpu), *vcpu_pc(vcpu));
/* Exit types that need handling before we can be preempted */
handle_exit_early(vcpu, run, ret);
......
......@@ -28,24 +28,24 @@ TRACE_EVENT(kvm_entry,
);
TRACE_EVENT(kvm_exit,
TP_PROTO(unsigned int vcpu_id, int ret, unsigned long vcpu_pc),
TP_ARGS(vcpu_id, ret, vcpu_pc),
TP_PROTO(int ret, unsigned int esr_ec, unsigned long vcpu_pc),
TP_ARGS(ret, esr_ec, vcpu_pc),
TP_STRUCT__entry(
__field( unsigned int, vcpu_id )
__field( int, ret )
__field( unsigned int, esr_ec )
__field( unsigned long, vcpu_pc )
),
TP_fast_assign(
__entry->vcpu_id = vcpu_id;
__entry->ret = ARM_EXCEPTION_CODE(ret);
__entry->esr_ec = ARM_EXCEPTION_IS_TRAP(ret) ? esr_ec : 0;
__entry->vcpu_pc = vcpu_pc;
),
TP_printk("VCPU %u: exit_type=%s, PC=0x%08lx",
__entry->vcpu_id,
TP_printk("%s: HSR_EC: 0x%04x (%s), PC: 0x%08lx",
__print_symbolic(__entry->ret, kvm_arm_exception_type),
__entry->esr_ec,
__print_symbolic(__entry->esr_ec, kvm_arm_exception_class),
__entry->vcpu_pc)
);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册