aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHollis Blanchard <hollisb@us.ibm.com>2008-07-01 17:23:49 -0400
committerAvi Kivity <avi@qumranet.com>2008-10-15 04:15:12 -0400
commitd98e6346350ac909f095768beb28b82368bd126f (patch)
treee0d1c78c08f0305f514ad69011a7b8701faf6f12
parent5fdbf9765b7ba6a45100851154768de703d51e76 (diff)
KVM: Move KVM TRACE DEFINITIONS to common header
Move KVM trace definitions from x86 specific kvm headers to common kvm headers to create a cross-architecture numbering scheme for trace events. This means the kvmtrace_format userspace tool won't need to know which architecture produced the log file being processed. Signed-off-by: Jerone Young <jyoung5@us.ibm.com> Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
-rw-r--r--include/asm-x86/kvm.h22
-rw-r--r--include/asm-x86/kvm_host.h18
-rw-r--r--include/linux/kvm.h21
-rw-r--r--include/linux/kvm_host.h19
4 files changed, 40 insertions, 40 deletions
diff --git a/include/asm-x86/kvm.h b/include/asm-x86/kvm.h
index 78e954db1e7f..ba0dd791fadf 100644
--- a/include/asm-x86/kvm.h
+++ b/include/asm-x86/kvm.h
@@ -208,26 +208,4 @@ struct kvm_pit_channel_state {
208struct kvm_pit_state { 208struct kvm_pit_state {
209 struct kvm_pit_channel_state channels[3]; 209 struct kvm_pit_channel_state channels[3];
210}; 210};
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#define KVM_TRC_TDP_FAULT (KVM_TRC_HANDLER + 0x15)
232
233#endif /* ASM_X86__KVM_H */ 211#endif /* ASM_X86__KVM_H */
diff --git a/include/asm-x86/kvm_host.h b/include/asm-x86/kvm_host.h
index 8c886be0103f..4f2bd884fd3a 100644
--- a/include/asm-x86/kvm_host.h
+++ b/include/asm-x86/kvm_host.h
@@ -691,24 +691,6 @@ enum {
691 TASK_SWITCH_GATE = 3, 691 TASK_SWITCH_GATE = 3,
692}; 692};
693 693
694#define KVMTRACE_5D(evt, vcpu, d1, d2, d3, d4, d5, name) \
695 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
696 vcpu, 5, d1, d2, d3, d4, d5)
697#define KVMTRACE_4D(evt, vcpu, d1, d2, d3, d4, name) \
698 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
699 vcpu, 4, d1, d2, d3, d4, 0)
700#define KVMTRACE_3D(evt, vcpu, d1, d2, d3, name) \
701 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
702 vcpu, 3, d1, d2, d3, 0, 0)
703#define KVMTRACE_2D(evt, vcpu, d1, d2, name) \
704 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
705 vcpu, 2, d1, d2, 0, 0, 0)
706#define KVMTRACE_1D(evt, vcpu, d1, name) \
707 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
708 vcpu, 1, d1, 0, 0, 0, 0)
709#define KVMTRACE_0D(evt, vcpu, name) \
710 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
711 vcpu, 0, 0, 0, 0, 0, 0)
712 694
713#ifdef CONFIG_64BIT 695#ifdef CONFIG_64BIT
714# define KVM_EX_ENTRY ".quad" 696# define KVM_EX_ENTRY ".quad"
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 70a30651cd12..8a3ceadb1366 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -440,4 +440,25 @@ struct kvm_trace_rec {
440#define KVM_GET_MP_STATE _IOR(KVMIO, 0x98, struct kvm_mp_state) 440#define KVM_GET_MP_STATE _IOR(KVMIO, 0x98, struct kvm_mp_state)
441#define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state) 441#define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state)
442 442
443#define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02)
444#define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03)
445#define KVM_TRC_PEND_INTR (KVM_TRC_HANDLER + 0x04)
446#define KVM_TRC_IO_READ (KVM_TRC_HANDLER + 0x05)
447#define KVM_TRC_IO_WRITE (KVM_TRC_HANDLER + 0x06)
448#define KVM_TRC_CR_READ (KVM_TRC_HANDLER + 0x07)
449#define KVM_TRC_CR_WRITE (KVM_TRC_HANDLER + 0x08)
450#define KVM_TRC_DR_READ (KVM_TRC_HANDLER + 0x09)
451#define KVM_TRC_DR_WRITE (KVM_TRC_HANDLER + 0x0A)
452#define KVM_TRC_MSR_READ (KVM_TRC_HANDLER + 0x0B)
453#define KVM_TRC_MSR_WRITE (KVM_TRC_HANDLER + 0x0C)
454#define KVM_TRC_CPUID (KVM_TRC_HANDLER + 0x0D)
455#define KVM_TRC_INTR (KVM_TRC_HANDLER + 0x0E)
456#define KVM_TRC_NMI (KVM_TRC_HANDLER + 0x0F)
457#define KVM_TRC_VMMCALL (KVM_TRC_HANDLER + 0x10)
458#define KVM_TRC_HLT (KVM_TRC_HANDLER + 0x11)
459#define KVM_TRC_CLTS (KVM_TRC_HANDLER + 0x12)
460#define KVM_TRC_LMSW (KVM_TRC_HANDLER + 0x13)
461#define KVM_TRC_APIC_ACCESS (KVM_TRC_HANDLER + 0x14)
462#define KVM_TRC_TDP_FAULT (KVM_TRC_HANDLER + 0x15)
463
443#endif 464#endif
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 8525afc53107..a18aaad2ab79 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -326,6 +326,25 @@ struct kvm_stats_debugfs_item {
326extern struct kvm_stats_debugfs_item debugfs_entries[]; 326extern struct kvm_stats_debugfs_item debugfs_entries[];
327extern struct dentry *kvm_debugfs_dir; 327extern struct dentry *kvm_debugfs_dir;
328 328
329#define KVMTRACE_5D(evt, vcpu, d1, d2, d3, d4, d5, name) \
330 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
331 vcpu, 5, d1, d2, d3, d4, d5)
332#define KVMTRACE_4D(evt, vcpu, d1, d2, d3, d4, name) \
333 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
334 vcpu, 4, d1, d2, d3, d4, 0)
335#define KVMTRACE_3D(evt, vcpu, d1, d2, d3, name) \
336 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
337 vcpu, 3, d1, d2, d3, 0, 0)
338#define KVMTRACE_2D(evt, vcpu, d1, d2, name) \
339 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
340 vcpu, 2, d1, d2, 0, 0, 0)
341#define KVMTRACE_1D(evt, vcpu, d1, name) \
342 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
343 vcpu, 1, d1, 0, 0, 0, 0)
344#define KVMTRACE_0D(evt, vcpu, name) \
345 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
346 vcpu, 0, 0, 0, 0, 0, 0)
347
329#ifdef CONFIG_KVM_TRACE 348#ifdef CONFIG_KVM_TRACE
330int kvm_trace_ioctl(unsigned int ioctl, unsigned long arg); 349int kvm_trace_ioctl(unsigned int ioctl, unsigned long arg);
331void kvm_trace_cleanup(void); 350void kvm_trace_cleanup(void);