OMAP3: PM: Implement locking for any scratchpad access
[linux-ginger.git] / include / trace / events / kvm.h
blobdbe1084552757da03d47a8ee64e98581974a14a3
1 #if !defined(_TRACE_KVM_MAIN_H) || defined(TRACE_HEADER_MULTI_READ)
2 #define _TRACE_KVM_MAIN_H
4 #include <linux/tracepoint.h>
6 #undef TRACE_SYSTEM
7 #define TRACE_SYSTEM kvm
8 #define TRACE_INCLUDE_FILE kvm
10 #if defined(__KVM_HAVE_IOAPIC)
11 TRACE_EVENT(kvm_set_irq,
12 TP_PROTO(unsigned int gsi, int level, int irq_source_id),
13 TP_ARGS(gsi, level, irq_source_id),
15 TP_STRUCT__entry(
16 __field( unsigned int, gsi )
17 __field( int, level )
18 __field( int, irq_source_id )
21 TP_fast_assign(
22 __entry->gsi = gsi;
23 __entry->level = level;
24 __entry->irq_source_id = irq_source_id;
27 TP_printk("gsi %u level %d source %d",
28 __entry->gsi, __entry->level, __entry->irq_source_id)
31 #define kvm_deliver_mode \
32 {0x0, "Fixed"}, \
33 {0x1, "LowPrio"}, \
34 {0x2, "SMI"}, \
35 {0x3, "Res3"}, \
36 {0x4, "NMI"}, \
37 {0x5, "INIT"}, \
38 {0x6, "SIPI"}, \
39 {0x7, "ExtINT"}
41 TRACE_EVENT(kvm_ioapic_set_irq,
42 TP_PROTO(__u64 e, int pin, bool coalesced),
43 TP_ARGS(e, pin, coalesced),
45 TP_STRUCT__entry(
46 __field( __u64, e )
47 __field( int, pin )
48 __field( bool, coalesced )
51 TP_fast_assign(
52 __entry->e = e;
53 __entry->pin = pin;
54 __entry->coalesced = coalesced;
57 TP_printk("pin %u dst %x vec=%u (%s|%s|%s%s)%s",
58 __entry->pin, (u8)(__entry->e >> 56), (u8)__entry->e,
59 __print_symbolic((__entry->e >> 8 & 0x7), kvm_deliver_mode),
60 (__entry->e & (1<<11)) ? "logical" : "physical",
61 (__entry->e & (1<<15)) ? "level" : "edge",
62 (__entry->e & (1<<16)) ? "|masked" : "",
63 __entry->coalesced ? " (coalesced)" : "")
66 TRACE_EVENT(kvm_msi_set_irq,
67 TP_PROTO(__u64 address, __u64 data),
68 TP_ARGS(address, data),
70 TP_STRUCT__entry(
71 __field( __u64, address )
72 __field( __u64, data )
75 TP_fast_assign(
76 __entry->address = address;
77 __entry->data = data;
80 TP_printk("dst %u vec %x (%s|%s|%s%s)",
81 (u8)(__entry->address >> 12), (u8)__entry->data,
82 __print_symbolic((__entry->data >> 8 & 0x7), kvm_deliver_mode),
83 (__entry->address & (1<<2)) ? "logical" : "physical",
84 (__entry->data & (1<<15)) ? "level" : "edge",
85 (__entry->address & (1<<3)) ? "|rh" : "")
88 #define kvm_irqchips \
89 {KVM_IRQCHIP_PIC_MASTER, "PIC master"}, \
90 {KVM_IRQCHIP_PIC_SLAVE, "PIC slave"}, \
91 {KVM_IRQCHIP_IOAPIC, "IOAPIC"}
93 TRACE_EVENT(kvm_ack_irq,
94 TP_PROTO(unsigned int irqchip, unsigned int pin),
95 TP_ARGS(irqchip, pin),
97 TP_STRUCT__entry(
98 __field( unsigned int, irqchip )
99 __field( unsigned int, pin )
102 TP_fast_assign(
103 __entry->irqchip = irqchip;
104 __entry->pin = pin;
107 TP_printk("irqchip %s pin %u",
108 __print_symbolic(__entry->irqchip, kvm_irqchips),
109 __entry->pin)
114 #endif /* defined(__KVM_HAVE_IOAPIC) */
116 #define KVM_TRACE_MMIO_READ_UNSATISFIED 0
117 #define KVM_TRACE_MMIO_READ 1
118 #define KVM_TRACE_MMIO_WRITE 2
120 #define kvm_trace_symbol_mmio \
121 { KVM_TRACE_MMIO_READ_UNSATISFIED, "unsatisfied-read" }, \
122 { KVM_TRACE_MMIO_READ, "read" }, \
123 { KVM_TRACE_MMIO_WRITE, "write" }
125 TRACE_EVENT(kvm_mmio,
126 TP_PROTO(int type, int len, u64 gpa, u64 val),
127 TP_ARGS(type, len, gpa, val),
129 TP_STRUCT__entry(
130 __field( u32, type )
131 __field( u32, len )
132 __field( u64, gpa )
133 __field( u64, val )
136 TP_fast_assign(
137 __entry->type = type;
138 __entry->len = len;
139 __entry->gpa = gpa;
140 __entry->val = val;
143 TP_printk("mmio %s len %u gpa 0x%llx val 0x%llx",
144 __print_symbolic(__entry->type, kvm_trace_symbol_mmio),
145 __entry->len, __entry->gpa, __entry->val)
148 #endif /* _TRACE_KVM_MAIN_H */
150 /* This part must be outside protection */
151 #include <trace/define_trace.h>