Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Marcelo Tosatti | 229456f | 2009-06-17 09:22:14 -0300 | [diff] [blame] | 2 | #if !defined(_TRACE_KVM_MAIN_H) || defined(TRACE_HEADER_MULTI_READ) |
| 3 | #define _TRACE_KVM_MAIN_H |
| 4 | |
| 5 | #include <linux/tracepoint.h> |
| 6 | |
| 7 | #undef TRACE_SYSTEM |
| 8 | #define TRACE_SYSTEM kvm |
Marcelo Tosatti | 229456f | 2009-06-17 09:22:14 -0300 | [diff] [blame] | 9 | |
Gleb Natapov | 64be500 | 2010-10-24 16:49:08 +0200 | [diff] [blame] | 10 | #define ERSN(x) { KVM_EXIT_##x, "KVM_EXIT_" #x } |
| 11 | |
| 12 | #define kvm_trace_exit_reason \ |
| 13 | ERSN(UNKNOWN), ERSN(EXCEPTION), ERSN(IO), ERSN(HYPERCALL), \ |
| 14 | ERSN(DEBUG), ERSN(HLT), ERSN(MMIO), ERSN(IRQ_WINDOW_OPEN), \ |
| 15 | ERSN(SHUTDOWN), ERSN(FAIL_ENTRY), ERSN(INTR), ERSN(SET_TPR), \ |
| 16 | ERSN(TPR_ACCESS), ERSN(S390_SIEIC), ERSN(S390_RESET), ERSN(DCR),\ |
Cornelia Huck | dcce048 | 2012-06-11 18:39:50 +0200 | [diff] [blame] | 17 | ERSN(NMI), ERSN(INTERNAL_ERROR), ERSN(OSI), ERSN(PAPR_HCALL), \ |
Ladi Prosek | 488e32f | 2017-09-14 11:50:07 +0200 | [diff] [blame] | 18 | ERSN(S390_UCONTROL), ERSN(WATCHDOG), ERSN(S390_TSCH), ERSN(EPR),\ |
| 19 | ERSN(SYSTEM_EVENT), ERSN(S390_STSI), ERSN(IOAPIC_EOI), \ |
| 20 | ERSN(HYPERV) |
Gleb Natapov | 64be500 | 2010-10-24 16:49:08 +0200 | [diff] [blame] | 21 | |
| 22 | TRACE_EVENT(kvm_userspace_exit, |
| 23 | TP_PROTO(__u32 reason, int errno), |
| 24 | TP_ARGS(reason, errno), |
| 25 | |
| 26 | TP_STRUCT__entry( |
| 27 | __field( __u32, reason ) |
| 28 | __field( int, errno ) |
| 29 | ), |
| 30 | |
| 31 | TP_fast_assign( |
| 32 | __entry->reason = reason; |
| 33 | __entry->errno = errno; |
| 34 | ), |
| 35 | |
| 36 | TP_printk("reason %s (%d)", |
| 37 | __entry->errno < 0 ? |
| 38 | (__entry->errno == -EINTR ? "restart" : "error") : |
| 39 | __print_symbolic(__entry->reason, kvm_trace_exit_reason), |
| 40 | __entry->errno < 0 ? -__entry->errno : __entry->reason) |
| 41 | ); |
| 42 | |
Paolo Bonzini | f781951 | 2015-02-04 18:20:58 +0100 | [diff] [blame] | 43 | TRACE_EVENT(kvm_vcpu_wakeup, |
Christian Borntraeger | 3491caf | 2016-05-13 12:16:35 +0200 | [diff] [blame] | 44 | TP_PROTO(__u64 ns, bool waited, bool valid), |
| 45 | TP_ARGS(ns, waited, valid), |
Paolo Bonzini | f781951 | 2015-02-04 18:20:58 +0100 | [diff] [blame] | 46 | |
| 47 | TP_STRUCT__entry( |
| 48 | __field( __u64, ns ) |
| 49 | __field( bool, waited ) |
Christian Borntraeger | 3491caf | 2016-05-13 12:16:35 +0200 | [diff] [blame] | 50 | __field( bool, valid ) |
Paolo Bonzini | f781951 | 2015-02-04 18:20:58 +0100 | [diff] [blame] | 51 | ), |
| 52 | |
| 53 | TP_fast_assign( |
| 54 | __entry->ns = ns; |
| 55 | __entry->waited = waited; |
Christian Borntraeger | 3491caf | 2016-05-13 12:16:35 +0200 | [diff] [blame] | 56 | __entry->valid = valid; |
Paolo Bonzini | f781951 | 2015-02-04 18:20:58 +0100 | [diff] [blame] | 57 | ), |
| 58 | |
Christian Borntraeger | 3491caf | 2016-05-13 12:16:35 +0200 | [diff] [blame] | 59 | TP_printk("%s time %lld ns, polling %s", |
Paolo Bonzini | f781951 | 2015-02-04 18:20:58 +0100 | [diff] [blame] | 60 | __entry->waited ? "wait" : "poll", |
Christian Borntraeger | 3491caf | 2016-05-13 12:16:35 +0200 | [diff] [blame] | 61 | __entry->ns, |
| 62 | __entry->valid ? "valid" : "invalid") |
Paolo Bonzini | f781951 | 2015-02-04 18:20:58 +0100 | [diff] [blame] | 63 | ); |
| 64 | |
Paolo Bonzini | c77dcac | 2014-08-06 14:24:45 +0200 | [diff] [blame] | 65 | #if defined(CONFIG_HAVE_KVM_IRQFD) |
Marcelo Tosatti | 229456f | 2009-06-17 09:22:14 -0300 | [diff] [blame] | 66 | TRACE_EVENT(kvm_set_irq, |
Avi Kivity | ae8c1c4 | 2009-07-01 12:09:41 +0300 | [diff] [blame] | 67 | TP_PROTO(unsigned int gsi, int level, int irq_source_id), |
| 68 | TP_ARGS(gsi, level, irq_source_id), |
Marcelo Tosatti | 229456f | 2009-06-17 09:22:14 -0300 | [diff] [blame] | 69 | |
| 70 | TP_STRUCT__entry( |
| 71 | __field( unsigned int, gsi ) |
Avi Kivity | ae8c1c4 | 2009-07-01 12:09:41 +0300 | [diff] [blame] | 72 | __field( int, level ) |
| 73 | __field( int, irq_source_id ) |
Marcelo Tosatti | 229456f | 2009-06-17 09:22:14 -0300 | [diff] [blame] | 74 | ), |
| 75 | |
| 76 | TP_fast_assign( |
| 77 | __entry->gsi = gsi; |
Avi Kivity | ae8c1c4 | 2009-07-01 12:09:41 +0300 | [diff] [blame] | 78 | __entry->level = level; |
| 79 | __entry->irq_source_id = irq_source_id; |
Marcelo Tosatti | 229456f | 2009-06-17 09:22:14 -0300 | [diff] [blame] | 80 | ), |
| 81 | |
Avi Kivity | ae8c1c4 | 2009-07-01 12:09:41 +0300 | [diff] [blame] | 82 | TP_printk("gsi %u level %d source %d", |
| 83 | __entry->gsi, __entry->level, __entry->irq_source_id) |
Marcelo Tosatti | 229456f | 2009-06-17 09:22:14 -0300 | [diff] [blame] | 84 | ); |
Paolo Bonzini | c77dcac | 2014-08-06 14:24:45 +0200 | [diff] [blame] | 85 | #endif /* defined(CONFIG_HAVE_KVM_IRQFD) */ |
Marcelo Tosatti | 229456f | 2009-06-17 09:22:14 -0300 | [diff] [blame] | 86 | |
Christoffer Dall | a1e4ccb | 2012-06-15 15:07:13 -0400 | [diff] [blame] | 87 | #if defined(__KVM_HAVE_IOAPIC) |
Gleb Natapov | 1000ff8 | 2009-07-07 16:00:57 +0300 | [diff] [blame] | 88 | #define kvm_deliver_mode \ |
| 89 | {0x0, "Fixed"}, \ |
| 90 | {0x1, "LowPrio"}, \ |
| 91 | {0x2, "SMI"}, \ |
| 92 | {0x3, "Res3"}, \ |
| 93 | {0x4, "NMI"}, \ |
| 94 | {0x5, "INIT"}, \ |
| 95 | {0x6, "SIPI"}, \ |
| 96 | {0x7, "ExtINT"} |
| 97 | |
| 98 | TRACE_EVENT(kvm_ioapic_set_irq, |
| 99 | TP_PROTO(__u64 e, int pin, bool coalesced), |
| 100 | TP_ARGS(e, pin, coalesced), |
| 101 | |
| 102 | TP_STRUCT__entry( |
| 103 | __field( __u64, e ) |
| 104 | __field( int, pin ) |
| 105 | __field( bool, coalesced ) |
| 106 | ), |
| 107 | |
| 108 | TP_fast_assign( |
| 109 | __entry->e = e; |
| 110 | __entry->pin = pin; |
| 111 | __entry->coalesced = coalesced; |
| 112 | ), |
| 113 | |
Jan Kiszka | cfc5abb | 2016-05-23 08:43:33 +0200 | [diff] [blame] | 114 | TP_printk("pin %u dst %x vec %u (%s|%s|%s%s)%s", |
Gleb Natapov | 1000ff8 | 2009-07-07 16:00:57 +0300 | [diff] [blame] | 115 | __entry->pin, (u8)(__entry->e >> 56), (u8)__entry->e, |
| 116 | __print_symbolic((__entry->e >> 8 & 0x7), kvm_deliver_mode), |
| 117 | (__entry->e & (1<<11)) ? "logical" : "physical", |
| 118 | (__entry->e & (1<<15)) ? "level" : "edge", |
| 119 | (__entry->e & (1<<16)) ? "|masked" : "", |
| 120 | __entry->coalesced ? " (coalesced)" : "") |
| 121 | ); |
| 122 | |
Zhang Haoyu | 184564e | 2014-09-11 16:47:04 +0800 | [diff] [blame] | 123 | TRACE_EVENT(kvm_ioapic_delayed_eoi_inj, |
| 124 | TP_PROTO(__u64 e), |
| 125 | TP_ARGS(e), |
| 126 | |
| 127 | TP_STRUCT__entry( |
| 128 | __field( __u64, e ) |
| 129 | ), |
| 130 | |
| 131 | TP_fast_assign( |
| 132 | __entry->e = e; |
| 133 | ), |
| 134 | |
Jan Kiszka | cfc5abb | 2016-05-23 08:43:33 +0200 | [diff] [blame] | 135 | TP_printk("dst %x vec %u (%s|%s|%s%s)", |
Zhang Haoyu | 184564e | 2014-09-11 16:47:04 +0800 | [diff] [blame] | 136 | (u8)(__entry->e >> 56), (u8)__entry->e, |
| 137 | __print_symbolic((__entry->e >> 8 & 0x7), kvm_deliver_mode), |
| 138 | (__entry->e & (1<<11)) ? "logical" : "physical", |
| 139 | (__entry->e & (1<<15)) ? "level" : "edge", |
| 140 | (__entry->e & (1<<16)) ? "|masked" : "") |
| 141 | ); |
| 142 | |
Gleb Natapov | 1000ff8 | 2009-07-07 16:00:57 +0300 | [diff] [blame] | 143 | TRACE_EVENT(kvm_msi_set_irq, |
| 144 | TP_PROTO(__u64 address, __u64 data), |
| 145 | TP_ARGS(address, data), |
| 146 | |
| 147 | TP_STRUCT__entry( |
| 148 | __field( __u64, address ) |
| 149 | __field( __u64, data ) |
| 150 | ), |
| 151 | |
| 152 | TP_fast_assign( |
| 153 | __entry->address = address; |
| 154 | __entry->data = data; |
| 155 | ), |
| 156 | |
Radim Krčmář | 37131313 | 2016-07-12 22:09:27 +0200 | [diff] [blame] | 157 | TP_printk("dst %llx vec %u (%s|%s|%s%s)", |
| 158 | (u8)(__entry->address >> 12) | ((__entry->address >> 32) & 0xffffff00), |
| 159 | (u8)__entry->data, |
Gleb Natapov | 1000ff8 | 2009-07-07 16:00:57 +0300 | [diff] [blame] | 160 | __print_symbolic((__entry->data >> 8 & 0x7), kvm_deliver_mode), |
| 161 | (__entry->address & (1<<2)) ? "logical" : "physical", |
| 162 | (__entry->data & (1<<15)) ? "level" : "edge", |
| 163 | (__entry->address & (1<<3)) ? "|rh" : "") |
| 164 | ); |
Marcelo Tosatti | 229456f | 2009-06-17 09:22:14 -0300 | [diff] [blame] | 165 | |
| 166 | #define kvm_irqchips \ |
| 167 | {KVM_IRQCHIP_PIC_MASTER, "PIC master"}, \ |
| 168 | {KVM_IRQCHIP_PIC_SLAVE, "PIC slave"}, \ |
| 169 | {KVM_IRQCHIP_IOAPIC, "IOAPIC"} |
| 170 | |
Alexander Graf | 1c9f852 | 2013-04-15 23:04:10 +0200 | [diff] [blame] | 171 | #endif /* defined(__KVM_HAVE_IOAPIC) */ |
| 172 | |
Paolo Bonzini | c77dcac | 2014-08-06 14:24:45 +0200 | [diff] [blame] | 173 | #if defined(CONFIG_HAVE_KVM_IRQFD) |
Alexander Graf | 1c9f852 | 2013-04-15 23:04:10 +0200 | [diff] [blame] | 174 | |
Christian Borntraeger | cdef511 | 2015-01-15 15:21:19 +0100 | [diff] [blame] | 175 | #ifdef kvm_irqchips |
| 176 | #define kvm_ack_irq_string "irqchip %s pin %u" |
| 177 | #define kvm_ack_irq_parm __print_symbolic(__entry->irqchip, kvm_irqchips), __entry->pin |
| 178 | #else |
| 179 | #define kvm_ack_irq_string "irqchip %d pin %u" |
| 180 | #define kvm_ack_irq_parm __entry->irqchip, __entry->pin |
| 181 | #endif |
| 182 | |
Marcelo Tosatti | 229456f | 2009-06-17 09:22:14 -0300 | [diff] [blame] | 183 | TRACE_EVENT(kvm_ack_irq, |
| 184 | TP_PROTO(unsigned int irqchip, unsigned int pin), |
| 185 | TP_ARGS(irqchip, pin), |
| 186 | |
| 187 | TP_STRUCT__entry( |
| 188 | __field( unsigned int, irqchip ) |
| 189 | __field( unsigned int, pin ) |
| 190 | ), |
| 191 | |
| 192 | TP_fast_assign( |
| 193 | __entry->irqchip = irqchip; |
| 194 | __entry->pin = pin; |
| 195 | ), |
| 196 | |
Christian Borntraeger | cdef511 | 2015-01-15 15:21:19 +0100 | [diff] [blame] | 197 | TP_printk(kvm_ack_irq_string, kvm_ack_irq_parm) |
Marcelo Tosatti | 229456f | 2009-06-17 09:22:14 -0300 | [diff] [blame] | 198 | ); |
| 199 | |
Paolo Bonzini | c77dcac | 2014-08-06 14:24:45 +0200 | [diff] [blame] | 200 | #endif /* defined(CONFIG_HAVE_KVM_IRQFD) */ |
Marcelo Tosatti | 229456f | 2009-06-17 09:22:14 -0300 | [diff] [blame] | 201 | |
| 202 | |
Avi Kivity | aec51dc | 2009-07-01 16:01:02 +0300 | [diff] [blame] | 203 | |
| 204 | #define KVM_TRACE_MMIO_READ_UNSATISFIED 0 |
| 205 | #define KVM_TRACE_MMIO_READ 1 |
| 206 | #define KVM_TRACE_MMIO_WRITE 2 |
| 207 | |
| 208 | #define kvm_trace_symbol_mmio \ |
| 209 | { KVM_TRACE_MMIO_READ_UNSATISFIED, "unsatisfied-read" }, \ |
| 210 | { KVM_TRACE_MMIO_READ, "read" }, \ |
| 211 | { KVM_TRACE_MMIO_WRITE, "write" } |
| 212 | |
| 213 | TRACE_EVENT(kvm_mmio, |
Wanpeng Li | e39d200f | 2017-12-14 17:40:50 -0800 | [diff] [blame] | 214 | TP_PROTO(int type, int len, u64 gpa, void *val), |
Avi Kivity | aec51dc | 2009-07-01 16:01:02 +0300 | [diff] [blame] | 215 | TP_ARGS(type, len, gpa, val), |
| 216 | |
| 217 | TP_STRUCT__entry( |
| 218 | __field( u32, type ) |
| 219 | __field( u32, len ) |
| 220 | __field( u64, gpa ) |
| 221 | __field( u64, val ) |
| 222 | ), |
| 223 | |
| 224 | TP_fast_assign( |
| 225 | __entry->type = type; |
| 226 | __entry->len = len; |
| 227 | __entry->gpa = gpa; |
Wanpeng Li | e39d200f | 2017-12-14 17:40:50 -0800 | [diff] [blame] | 228 | __entry->val = 0; |
| 229 | if (val) |
| 230 | memcpy(&__entry->val, val, |
| 231 | min_t(u32, sizeof(__entry->val), len)); |
Avi Kivity | aec51dc | 2009-07-01 16:01:02 +0300 | [diff] [blame] | 232 | ), |
| 233 | |
| 234 | TP_printk("mmio %s len %u gpa 0x%llx val 0x%llx", |
| 235 | __print_symbolic(__entry->type, kvm_trace_symbol_mmio), |
| 236 | __entry->len, __entry->gpa, __entry->val) |
| 237 | ); |
| 238 | |
Avi Kivity | 0c04851 | 2010-01-21 15:31:52 +0200 | [diff] [blame] | 239 | #define kvm_fpu_load_symbol \ |
| 240 | {0, "unload"}, \ |
| 241 | {1, "load"} |
| 242 | |
| 243 | TRACE_EVENT(kvm_fpu, |
| 244 | TP_PROTO(int load), |
| 245 | TP_ARGS(load), |
| 246 | |
| 247 | TP_STRUCT__entry( |
| 248 | __field( u32, load ) |
| 249 | ), |
| 250 | |
| 251 | TP_fast_assign( |
| 252 | __entry->load = load; |
| 253 | ), |
| 254 | |
| 255 | TP_printk("%s", __print_symbolic(__entry->load, kvm_fpu_load_symbol)) |
| 256 | ); |
| 257 | |
Avi Kivity | 90bb6fc | 2009-12-31 12:10:16 +0200 | [diff] [blame] | 258 | TRACE_EVENT(kvm_age_page, |
Andres Lagar-Cavilla | 8a9522d | 2014-09-23 12:34:54 -0700 | [diff] [blame] | 259 | TP_PROTO(ulong gfn, int level, struct kvm_memory_slot *slot, int ref), |
| 260 | TP_ARGS(gfn, level, slot, ref), |
Avi Kivity | 90bb6fc | 2009-12-31 12:10:16 +0200 | [diff] [blame] | 261 | |
| 262 | TP_STRUCT__entry( |
| 263 | __field( u64, hva ) |
| 264 | __field( u64, gfn ) |
Andres Lagar-Cavilla | 8a9522d | 2014-09-23 12:34:54 -0700 | [diff] [blame] | 265 | __field( u8, level ) |
Avi Kivity | 90bb6fc | 2009-12-31 12:10:16 +0200 | [diff] [blame] | 266 | __field( u8, referenced ) |
| 267 | ), |
| 268 | |
| 269 | TP_fast_assign( |
Andres Lagar-Cavilla | 8a9522d | 2014-09-23 12:34:54 -0700 | [diff] [blame] | 270 | __entry->gfn = gfn; |
| 271 | __entry->level = level; |
| 272 | __entry->hva = ((gfn - slot->base_gfn) << |
| 273 | PAGE_SHIFT) + slot->userspace_addr; |
Avi Kivity | 90bb6fc | 2009-12-31 12:10:16 +0200 | [diff] [blame] | 274 | __entry->referenced = ref; |
| 275 | ), |
| 276 | |
Andres Lagar-Cavilla | 8a9522d | 2014-09-23 12:34:54 -0700 | [diff] [blame] | 277 | TP_printk("hva %llx gfn %llx level %u %s", |
| 278 | __entry->hva, __entry->gfn, __entry->level, |
Avi Kivity | 90bb6fc | 2009-12-31 12:10:16 +0200 | [diff] [blame] | 279 | __entry->referenced ? "YOUNG" : "OLD") |
| 280 | ); |
| 281 | |
Gleb Natapov | af585b9 | 2010-10-14 11:22:46 +0200 | [diff] [blame] | 282 | #ifdef CONFIG_KVM_ASYNC_PF |
Xiao Guangrong | 0730388 | 2010-11-01 16:59:39 +0800 | [diff] [blame] | 283 | DECLARE_EVENT_CLASS(kvm_async_get_page_class, |
| 284 | |
Xiao Guangrong | c9b263d | 2010-11-01 16:58:43 +0800 | [diff] [blame] | 285 | TP_PROTO(u64 gva, u64 gfn), |
Xiao Guangrong | 0730388 | 2010-11-01 16:59:39 +0800 | [diff] [blame] | 286 | |
Xiao Guangrong | c9b263d | 2010-11-01 16:58:43 +0800 | [diff] [blame] | 287 | TP_ARGS(gva, gfn), |
Gleb Natapov | af585b9 | 2010-10-14 11:22:46 +0200 | [diff] [blame] | 288 | |
| 289 | TP_STRUCT__entry( |
Xiao Guangrong | 0730388 | 2010-11-01 16:59:39 +0800 | [diff] [blame] | 290 | __field(__u64, gva) |
Xiao Guangrong | c9b263d | 2010-11-01 16:58:43 +0800 | [diff] [blame] | 291 | __field(u64, gfn) |
Xiao Guangrong | 0730388 | 2010-11-01 16:59:39 +0800 | [diff] [blame] | 292 | ), |
Gleb Natapov | af585b9 | 2010-10-14 11:22:46 +0200 | [diff] [blame] | 293 | |
| 294 | TP_fast_assign( |
Xiao Guangrong | c9b263d | 2010-11-01 16:58:43 +0800 | [diff] [blame] | 295 | __entry->gva = gva; |
| 296 | __entry->gfn = gfn; |
Xiao Guangrong | 0730388 | 2010-11-01 16:59:39 +0800 | [diff] [blame] | 297 | ), |
Gleb Natapov | af585b9 | 2010-10-14 11:22:46 +0200 | [diff] [blame] | 298 | |
Xiao Guangrong | c9b263d | 2010-11-01 16:58:43 +0800 | [diff] [blame] | 299 | TP_printk("gva = %#llx, gfn = %#llx", __entry->gva, __entry->gfn) |
Gleb Natapov | af585b9 | 2010-10-14 11:22:46 +0200 | [diff] [blame] | 300 | ); |
| 301 | |
Xiao Guangrong | 0730388 | 2010-11-01 16:59:39 +0800 | [diff] [blame] | 302 | DEFINE_EVENT(kvm_async_get_page_class, kvm_try_async_get_page, |
Gleb Natapov | af585b9 | 2010-10-14 11:22:46 +0200 | [diff] [blame] | 303 | |
Xiao Guangrong | 0730388 | 2010-11-01 16:59:39 +0800 | [diff] [blame] | 304 | TP_PROTO(u64 gva, u64 gfn), |
Gleb Natapov | af585b9 | 2010-10-14 11:22:46 +0200 | [diff] [blame] | 305 | |
Xiao Guangrong | 0730388 | 2010-11-01 16:59:39 +0800 | [diff] [blame] | 306 | TP_ARGS(gva, gfn) |
Gleb Natapov | af585b9 | 2010-10-14 11:22:46 +0200 | [diff] [blame] | 307 | ); |
| 308 | |
Xiao Guangrong | 0730388 | 2010-11-01 16:59:39 +0800 | [diff] [blame] | 309 | DEFINE_EVENT(kvm_async_get_page_class, kvm_async_pf_doublefault, |
| 310 | |
| 311 | TP_PROTO(u64 gva, u64 gfn), |
| 312 | |
| 313 | TP_ARGS(gva, gfn) |
| 314 | ); |
| 315 | |
| 316 | DECLARE_EVENT_CLASS(kvm_async_pf_nopresent_ready, |
| 317 | |
Gleb Natapov | 7c90705 | 2010-10-14 11:22:53 +0200 | [diff] [blame] | 318 | TP_PROTO(u64 token, u64 gva), |
Xiao Guangrong | 0730388 | 2010-11-01 16:59:39 +0800 | [diff] [blame] | 319 | |
Gleb Natapov | 7c90705 | 2010-10-14 11:22:53 +0200 | [diff] [blame] | 320 | TP_ARGS(token, gva), |
Gleb Natapov | af585b9 | 2010-10-14 11:22:46 +0200 | [diff] [blame] | 321 | |
| 322 | TP_STRUCT__entry( |
Gleb Natapov | 7c90705 | 2010-10-14 11:22:53 +0200 | [diff] [blame] | 323 | __field(__u64, token) |
Gleb Natapov | af585b9 | 2010-10-14 11:22:46 +0200 | [diff] [blame] | 324 | __field(__u64, gva) |
Xiao Guangrong | 0730388 | 2010-11-01 16:59:39 +0800 | [diff] [blame] | 325 | ), |
Gleb Natapov | af585b9 | 2010-10-14 11:22:46 +0200 | [diff] [blame] | 326 | |
| 327 | TP_fast_assign( |
Gleb Natapov | 7c90705 | 2010-10-14 11:22:53 +0200 | [diff] [blame] | 328 | __entry->token = token; |
Gleb Natapov | af585b9 | 2010-10-14 11:22:46 +0200 | [diff] [blame] | 329 | __entry->gva = gva; |
Xiao Guangrong | 0730388 | 2010-11-01 16:59:39 +0800 | [diff] [blame] | 330 | ), |
Gleb Natapov | af585b9 | 2010-10-14 11:22:46 +0200 | [diff] [blame] | 331 | |
Xiao Guangrong | 0730388 | 2010-11-01 16:59:39 +0800 | [diff] [blame] | 332 | TP_printk("token %#llx gva %#llx", __entry->token, __entry->gva) |
| 333 | |
| 334 | ); |
| 335 | |
| 336 | DEFINE_EVENT(kvm_async_pf_nopresent_ready, kvm_async_pf_not_present, |
| 337 | |
| 338 | TP_PROTO(u64 token, u64 gva), |
| 339 | |
| 340 | TP_ARGS(token, gva) |
| 341 | ); |
| 342 | |
| 343 | DEFINE_EVENT(kvm_async_pf_nopresent_ready, kvm_async_pf_ready, |
| 344 | |
| 345 | TP_PROTO(u64 token, u64 gva), |
| 346 | |
| 347 | TP_ARGS(token, gva) |
Gleb Natapov | af585b9 | 2010-10-14 11:22:46 +0200 | [diff] [blame] | 348 | ); |
| 349 | |
| 350 | TRACE_EVENT( |
| 351 | kvm_async_pf_completed, |
chai wen | f2e1066 | 2013-10-14 22:22:33 +0800 | [diff] [blame] | 352 | TP_PROTO(unsigned long address, u64 gva), |
| 353 | TP_ARGS(address, gva), |
Gleb Natapov | af585b9 | 2010-10-14 11:22:46 +0200 | [diff] [blame] | 354 | |
| 355 | TP_STRUCT__entry( |
| 356 | __field(unsigned long, address) |
Gleb Natapov | af585b9 | 2010-10-14 11:22:46 +0200 | [diff] [blame] | 357 | __field(u64, gva) |
| 358 | ), |
| 359 | |
| 360 | TP_fast_assign( |
| 361 | __entry->address = address; |
Gleb Natapov | af585b9 | 2010-10-14 11:22:46 +0200 | [diff] [blame] | 362 | __entry->gva = gva; |
| 363 | ), |
| 364 | |
chai wen | f2e1066 | 2013-10-14 22:22:33 +0800 | [diff] [blame] | 365 | TP_printk("gva %#llx address %#lx", __entry->gva, |
| 366 | __entry->address) |
Gleb Natapov | af585b9 | 2010-10-14 11:22:46 +0200 | [diff] [blame] | 367 | ); |
| 368 | |
Wanpeng Li | 3dfe6a5 | 2015-09-08 11:14:13 +0200 | [diff] [blame] | 369 | #endif |
| 370 | |
Wanpeng Li | 2cbd782 | 2015-09-03 22:07:39 +0800 | [diff] [blame] | 371 | TRACE_EVENT(kvm_halt_poll_ns, |
Christian Borntraeger | 6b6de68 | 2016-02-09 13:47:55 +0100 | [diff] [blame] | 372 | TP_PROTO(bool grow, unsigned int vcpu_id, unsigned int new, |
| 373 | unsigned int old), |
Wanpeng Li | 2cbd782 | 2015-09-03 22:07:39 +0800 | [diff] [blame] | 374 | TP_ARGS(grow, vcpu_id, new, old), |
| 375 | |
| 376 | TP_STRUCT__entry( |
| 377 | __field(bool, grow) |
| 378 | __field(unsigned int, vcpu_id) |
Christian Borntraeger | 6b6de68 | 2016-02-09 13:47:55 +0100 | [diff] [blame] | 379 | __field(unsigned int, new) |
| 380 | __field(unsigned int, old) |
Wanpeng Li | 2cbd782 | 2015-09-03 22:07:39 +0800 | [diff] [blame] | 381 | ), |
| 382 | |
| 383 | TP_fast_assign( |
| 384 | __entry->grow = grow; |
| 385 | __entry->vcpu_id = vcpu_id; |
| 386 | __entry->new = new; |
| 387 | __entry->old = old; |
| 388 | ), |
| 389 | |
Christian Borntraeger | 6b6de68 | 2016-02-09 13:47:55 +0100 | [diff] [blame] | 390 | TP_printk("vcpu %u: halt_poll_ns %u (%s %u)", |
Wanpeng Li | 2cbd782 | 2015-09-03 22:07:39 +0800 | [diff] [blame] | 391 | __entry->vcpu_id, |
| 392 | __entry->new, |
| 393 | __entry->grow ? "grow" : "shrink", |
| 394 | __entry->old) |
| 395 | ); |
| 396 | |
| 397 | #define trace_kvm_halt_poll_ns_grow(vcpu_id, new, old) \ |
| 398 | trace_kvm_halt_poll_ns(true, vcpu_id, new, old) |
| 399 | #define trace_kvm_halt_poll_ns_shrink(vcpu_id, new, old) \ |
| 400 | trace_kvm_halt_poll_ns(false, vcpu_id, new, old) |
| 401 | |
Marcelo Tosatti | 229456f | 2009-06-17 09:22:14 -0300 | [diff] [blame] | 402 | #endif /* _TRACE_KVM_MAIN_H */ |
| 403 | |
| 404 | /* This part must be outside protection */ |
| 405 | #include <trace/define_trace.h> |