diff options
author | Gleb Natapov <gleb@redhat.com> | 2010-10-24 14:49:08 (GMT) |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-01-12 09:28:44 (GMT) |
commit | 64be5007066173d11a4635eedd57d41a3b3a7027 (patch) | |
tree | d2d7e085b63a1f2160b04d1b6fcd5994592e5c80 /include/trace/events/kvm.h | |
parent | 612819c3c6e67bac8fceaa7cc402f13b1b63f7e4 (diff) | |
download | linux-64be5007066173d11a4635eedd57d41a3b3a7027.tar.xz |
KVM: x86: trace "exit to userspace" event
Add tracepoint for userspace exit.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'include/trace/events/kvm.h')
-rw-r--r-- | include/trace/events/kvm.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h index 9c2cc6a..c86f4e8 100644 --- a/include/trace/events/kvm.h +++ b/include/trace/events/kvm.h @@ -6,6 +6,36 @@ #undef TRACE_SYSTEM #define TRACE_SYSTEM kvm +#define ERSN(x) { KVM_EXIT_##x, "KVM_EXIT_" #x } + +#define kvm_trace_exit_reason \ + ERSN(UNKNOWN), ERSN(EXCEPTION), ERSN(IO), ERSN(HYPERCALL), \ + ERSN(DEBUG), ERSN(HLT), ERSN(MMIO), ERSN(IRQ_WINDOW_OPEN), \ + ERSN(SHUTDOWN), ERSN(FAIL_ENTRY), ERSN(INTR), ERSN(SET_TPR), \ + ERSN(TPR_ACCESS), ERSN(S390_SIEIC), ERSN(S390_RESET), ERSN(DCR),\ + ERSN(NMI), ERSN(INTERNAL_ERROR), ERSN(OSI) + +TRACE_EVENT(kvm_userspace_exit, + TP_PROTO(__u32 reason, int errno), + TP_ARGS(reason, errno), + + TP_STRUCT__entry( + __field( __u32, reason ) + __field( int, errno ) + ), + + TP_fast_assign( + __entry->reason = reason; + __entry->errno = errno; + ), + + TP_printk("reason %s (%d)", + __entry->errno < 0 ? + (__entry->errno == -EINTR ? "restart" : "error") : + __print_symbolic(__entry->reason, kvm_trace_exit_reason), + __entry->errno < 0 ? -__entry->errno : __entry->reason) +); + #if defined(__KVM_HAVE_IOAPIC) TRACE_EVENT(kvm_set_irq, TP_PROTO(unsigned int gsi, int level, int irq_source_id), |