diff options
author | Feng (Eric) Liu <eric.e.liu@intel.com> | 2008-04-10 15:31:10 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-04-27 05:01:19 -0400 |
commit | 2714d1d3d6be882b97cd0125140fccf9976a460a (patch) | |
tree | 57b654cafff076ae95b62b7763113b1ef8511eb5 /include/asm-x86 | |
parent | 53371b5098543ab09dcb0c7ce31da887dbe58c62 (diff) |
KVM: Add trace markers
Trace markers allow userspace to trace execution of a virtual machine
in order to monitor its performance.
Signed-off-by: Feng (Eric) Liu <eric.e.liu@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'include/asm-x86')
-rw-r--r-- | include/asm-x86/kvm.h | 20 | ||||
-rw-r--r-- | include/asm-x86/kvm_host.h | 19 |
2 files changed, 39 insertions, 0 deletions
diff --git a/include/asm-x86/kvm.h b/include/asm-x86/kvm.h index 12b4b25371d5..80eefef2cc76 100644 --- a/include/asm-x86/kvm.h +++ b/include/asm-x86/kvm.h | |||
@@ -209,4 +209,24 @@ struct kvm_pit_state { | |||
209 | struct kvm_pit_channel_state channels[3]; | 209 | struct kvm_pit_channel_state channels[3]; |
210 | }; | 210 | }; |
211 | 211 | ||
212 | #define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02) | ||
213 | #define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03) | ||
214 | #define KVM_TRC_PEND_INTR (KVM_TRC_HANDLER + 0x04) | ||
215 | #define KVM_TRC_IO_READ (KVM_TRC_HANDLER + 0x05) | ||
216 | #define KVM_TRC_IO_WRITE (KVM_TRC_HANDLER + 0x06) | ||
217 | #define KVM_TRC_CR_READ (KVM_TRC_HANDLER + 0x07) | ||
218 | #define KVM_TRC_CR_WRITE (KVM_TRC_HANDLER + 0x08) | ||
219 | #define KVM_TRC_DR_READ (KVM_TRC_HANDLER + 0x09) | ||
220 | #define KVM_TRC_DR_WRITE (KVM_TRC_HANDLER + 0x0A) | ||
221 | #define KVM_TRC_MSR_READ (KVM_TRC_HANDLER + 0x0B) | ||
222 | #define KVM_TRC_MSR_WRITE (KVM_TRC_HANDLER + 0x0C) | ||
223 | #define KVM_TRC_CPUID (KVM_TRC_HANDLER + 0x0D) | ||
224 | #define KVM_TRC_INTR (KVM_TRC_HANDLER + 0x0E) | ||
225 | #define KVM_TRC_NMI (KVM_TRC_HANDLER + 0x0F) | ||
226 | #define KVM_TRC_VMMCALL (KVM_TRC_HANDLER + 0x10) | ||
227 | #define KVM_TRC_HLT (KVM_TRC_HANDLER + 0x11) | ||
228 | #define KVM_TRC_CLTS (KVM_TRC_HANDLER + 0x12) | ||
229 | #define KVM_TRC_LMSW (KVM_TRC_HANDLER + 0x13) | ||
230 | #define KVM_TRC_APIC_ACCESS (KVM_TRC_HANDLER + 0x14) | ||
231 | |||
212 | #endif | 232 | #endif |
diff --git a/include/asm-x86/kvm_host.h b/include/asm-x86/kvm_host.h index 286117878ce2..15169cb71c83 100644 --- a/include/asm-x86/kvm_host.h +++ b/include/asm-x86/kvm_host.h | |||
@@ -667,4 +667,23 @@ enum { | |||
667 | TASK_SWITCH_GATE = 3, | 667 | TASK_SWITCH_GATE = 3, |
668 | }; | 668 | }; |
669 | 669 | ||
670 | #define KVMTRACE_5D(evt, vcpu, d1, d2, d3, d4, d5, name) \ | ||
671 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
672 | vcpu, 5, d1, d2, d3, d4, d5) | ||
673 | #define KVMTRACE_4D(evt, vcpu, d1, d2, d3, d4, name) \ | ||
674 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
675 | vcpu, 4, d1, d2, d3, d4, 0) | ||
676 | #define KVMTRACE_3D(evt, vcpu, d1, d2, d3, name) \ | ||
677 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
678 | vcpu, 3, d1, d2, d3, 0, 0) | ||
679 | #define KVMTRACE_2D(evt, vcpu, d1, d2, name) \ | ||
680 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
681 | vcpu, 2, d1, d2, 0, 0, 0) | ||
682 | #define KVMTRACE_1D(evt, vcpu, d1, name) \ | ||
683 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
684 | vcpu, 1, d1, 0, 0, 0, 0) | ||
685 | #define KVMTRACE_0D(evt, vcpu, name) \ | ||
686 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
687 | vcpu, 0, 0, 0, 0, 0, 0) | ||
688 | |||
670 | #endif | 689 | #endif |