Skip to content

Commit

Permalink
KVM: x86: Introduce trace_kvm_hv_hypercall_done()
Browse files Browse the repository at this point in the history
Hypercall failures are unusual with potentially far going consequences
so it would be useful to see their results when tracing.

Signed-off-by: Vitaly Kuznetsov <[email protected]>
Reviewed-by: Siddharth Chandrasekaran <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
vittyvk authored and bonzini committed Aug 3, 2021
1 parent 2e2f1e8 commit f5714bb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/x86/kvm/hyperv.c
Original file line number Diff line number Diff line change
Expand Up @@ -2016,6 +2016,7 @@ static void kvm_hv_hypercall_set_result(struct kvm_vcpu *vcpu, u64 result)

static int kvm_hv_hypercall_complete(struct kvm_vcpu *vcpu, u64 result)
{
trace_kvm_hv_hypercall_done(result);
kvm_hv_hypercall_set_result(vcpu, result);
++vcpu->stat.hypercalls;
return kvm_skip_emulated_instruction(vcpu);
Expand Down
15 changes: 15 additions & 0 deletions arch/x86/kvm/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,21 @@ TRACE_EVENT(kvm_hv_hypercall,
__entry->outgpa)
);

TRACE_EVENT(kvm_hv_hypercall_done,
TP_PROTO(u64 result),
TP_ARGS(result),

TP_STRUCT__entry(
__field(__u64, result)
),

TP_fast_assign(
__entry->result = result;
),

TP_printk("result 0x%llx", __entry->result)
);

/*
* Tracepoint for Xen hypercall.
*/
Expand Down

0 comments on commit f5714bb

Please sign in to comment.