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