Jeremy Fitzhardinge | 634355d | 2010-12-16 13:39:18 -0800 | [diff] [blame] | 1 | #undef TRACE_SYSTEM |
| 2 | #define TRACE_SYSTEM xen |
| 3 | |
| 4 | #if !defined(_TRACE_XEN_H) || defined(TRACE_HEADER_MULTI_READ) |
| 5 | #define _TRACE_XEN_H |
| 6 | |
| 7 | #include <linux/tracepoint.h> |
| 8 | #include <asm/paravirt_types.h> |
Jeremy Fitzhardinge | c796f21 | 2010-12-16 14:33:27 -0800 | [diff] [blame] | 9 | #include <asm/xen/trace_types.h> |
Jeremy Fitzhardinge | 634355d | 2010-12-16 13:39:18 -0800 | [diff] [blame] | 10 | |
Jeremy Fitzhardinge | c796f21 | 2010-12-16 14:33:27 -0800 | [diff] [blame] | 11 | /* Multicalls */ |
| 12 | |
| 13 | TRACE_EVENT(xen_mc_batch, |
| 14 | TP_PROTO(enum paravirt_lazy_mode mode), |
| 15 | TP_ARGS(mode), |
| 16 | TP_STRUCT__entry( |
| 17 | __field(enum paravirt_lazy_mode, mode) |
| 18 | ), |
| 19 | TP_fast_assign(__entry->mode = mode), |
| 20 | TP_printk("start batch LAZY_%s", |
| 21 | (__entry->mode == PARAVIRT_LAZY_MMU) ? "MMU" : |
| 22 | (__entry->mode == PARAVIRT_LAZY_CPU) ? "CPU" : "NONE") |
| 23 | ); |
| 24 | |
| 25 | TRACE_EVENT(xen_mc_issue, |
| 26 | TP_PROTO(enum paravirt_lazy_mode mode), |
| 27 | TP_ARGS(mode), |
| 28 | TP_STRUCT__entry( |
| 29 | __field(enum paravirt_lazy_mode, mode) |
| 30 | ), |
| 31 | TP_fast_assign(__entry->mode = mode), |
| 32 | TP_printk("issue mode LAZY_%s", |
| 33 | (__entry->mode == PARAVIRT_LAZY_MMU) ? "MMU" : |
| 34 | (__entry->mode == PARAVIRT_LAZY_CPU) ? "CPU" : "NONE") |
| 35 | ); |
| 36 | |
| 37 | TRACE_EVENT(xen_mc_entry, |
| 38 | TP_PROTO(struct multicall_entry *mc, unsigned nargs), |
| 39 | TP_ARGS(mc, nargs), |
| 40 | TP_STRUCT__entry( |
| 41 | __field(unsigned int, op) |
| 42 | __field(unsigned int, nargs) |
| 43 | __array(unsigned long, args, 6) |
| 44 | ), |
| 45 | TP_fast_assign(__entry->op = mc->op; |
| 46 | __entry->nargs = nargs; |
| 47 | memcpy(__entry->args, mc->args, sizeof(unsigned long) * nargs); |
| 48 | memset(__entry->args + nargs, 0, sizeof(unsigned long) * (6 - nargs)); |
| 49 | ), |
| 50 | TP_printk("op %u%s args [%lx, %lx, %lx, %lx, %lx, %lx]", |
| 51 | __entry->op, xen_hypercall_name(__entry->op), |
| 52 | __entry->args[0], __entry->args[1], __entry->args[2], |
| 53 | __entry->args[3], __entry->args[4], __entry->args[5]) |
| 54 | ); |
| 55 | |
| 56 | TRACE_EVENT(xen_mc_entry_alloc, |
| 57 | TP_PROTO(size_t args), |
| 58 | TP_ARGS(args), |
| 59 | TP_STRUCT__entry( |
| 60 | __field(size_t, args) |
| 61 | ), |
| 62 | TP_fast_assign(__entry->args = args), |
| 63 | TP_printk("alloc entry %zu arg bytes", __entry->args) |
| 64 | ); |
| 65 | |
| 66 | TRACE_EVENT(xen_mc_callback, |
| 67 | TP_PROTO(xen_mc_callback_fn_t fn, void *data), |
| 68 | TP_ARGS(fn, data), |
| 69 | TP_STRUCT__entry( |
| 70 | __field(xen_mc_callback_fn_t, fn) |
| 71 | __field(void *, data) |
| 72 | ), |
| 73 | TP_fast_assign( |
| 74 | __entry->fn = fn; |
| 75 | __entry->data = data; |
| 76 | ), |
| 77 | TP_printk("callback %pf, data %p", |
| 78 | __entry->fn, __entry->data) |
| 79 | ); |
| 80 | |
| 81 | TRACE_EVENT(xen_mc_flush_reason, |
| 82 | TP_PROTO(enum xen_mc_flush_reason reason), |
| 83 | TP_ARGS(reason), |
| 84 | TP_STRUCT__entry( |
| 85 | __field(enum xen_mc_flush_reason, reason) |
| 86 | ), |
| 87 | TP_fast_assign(__entry->reason = reason), |
| 88 | TP_printk("flush reason %s", |
| 89 | (__entry->reason == XEN_MC_FL_NONE) ? "NONE" : |
| 90 | (__entry->reason == XEN_MC_FL_BATCH) ? "BATCH" : |
| 91 | (__entry->reason == XEN_MC_FL_ARGS) ? "ARGS" : |
| 92 | (__entry->reason == XEN_MC_FL_CALLBACK) ? "CALLBACK" : "??") |
| 93 | ); |
| 94 | |
| 95 | TRACE_EVENT(xen_mc_flush, |
| 96 | TP_PROTO(unsigned mcidx, unsigned argidx, unsigned cbidx), |
| 97 | TP_ARGS(mcidx, argidx, cbidx), |
| 98 | TP_STRUCT__entry( |
| 99 | __field(unsigned, mcidx) |
| 100 | __field(unsigned, argidx) |
| 101 | __field(unsigned, cbidx) |
| 102 | ), |
| 103 | TP_fast_assign(__entry->mcidx = mcidx; |
| 104 | __entry->argidx = argidx; |
| 105 | __entry->cbidx = cbidx), |
| 106 | TP_printk("flushing %u hypercalls, %u arg bytes, %u callbacks", |
| 107 | __entry->mcidx, __entry->argidx, __entry->cbidx) |
| 108 | ); |
| 109 | |
| 110 | TRACE_EVENT(xen_mc_extend_args, |
| 111 | TP_PROTO(unsigned long op, size_t args, enum xen_mc_extend_args res), |
| 112 | TP_ARGS(op, args, res), |
| 113 | TP_STRUCT__entry( |
| 114 | __field(unsigned int, op) |
| 115 | __field(size_t, args) |
| 116 | __field(enum xen_mc_extend_args, res) |
| 117 | ), |
| 118 | TP_fast_assign(__entry->op = op; |
| 119 | __entry->args = args; |
| 120 | __entry->res = res), |
| 121 | TP_printk("extending op %u%s by %zu bytes res %s", |
| 122 | __entry->op, xen_hypercall_name(__entry->op), |
| 123 | __entry->args, |
| 124 | __entry->res == XEN_MC_XE_OK ? "OK" : |
| 125 | __entry->res == XEN_MC_XE_BAD_OP ? "BAD_OP" : |
| 126 | __entry->res == XEN_MC_XE_NO_SPACE ? "NO_SPACE" : "???") |
| 127 | ); |
Jeremy Fitzhardinge | 8470880 | 2010-12-16 17:02:35 -0800 | [diff] [blame^] | 128 | |
| 129 | /* mmu */ |
| 130 | TRACE_EVENT(xen_mmu_set_pte, |
| 131 | TP_PROTO(pte_t *ptep, pte_t pteval), |
| 132 | TP_ARGS(ptep, pteval), |
| 133 | TP_STRUCT__entry( |
| 134 | __field(pte_t *, ptep) |
| 135 | __field(pteval_t, pteval) |
| 136 | ), |
| 137 | TP_fast_assign(__entry->ptep = ptep; |
| 138 | __entry->pteval = pteval.pte), |
| 139 | TP_printk("ptep %p pteval %0*llx (raw %0*llx)", |
| 140 | __entry->ptep, |
| 141 | (int)sizeof(pteval_t) * 2, (unsigned long long)pte_val(native_make_pte(__entry->pteval)), |
| 142 | (int)sizeof(pteval_t) * 2, (unsigned long long)__entry->pteval) |
| 143 | ); |
| 144 | |
| 145 | TRACE_EVENT(xen_mmu_set_pte_atomic, |
| 146 | TP_PROTO(pte_t *ptep, pte_t pteval), |
| 147 | TP_ARGS(ptep, pteval), |
| 148 | TP_STRUCT__entry( |
| 149 | __field(pte_t *, ptep) |
| 150 | __field(pteval_t, pteval) |
| 151 | ), |
| 152 | TP_fast_assign(__entry->ptep = ptep; |
| 153 | __entry->pteval = pteval.pte), |
| 154 | TP_printk("ptep %p pteval %0*llx (raw %0*llx)", |
| 155 | __entry->ptep, |
| 156 | (int)sizeof(pteval_t) * 2, (unsigned long long)pte_val(native_make_pte(__entry->pteval)), |
| 157 | (int)sizeof(pteval_t) * 2, (unsigned long long)__entry->pteval) |
| 158 | ); |
| 159 | |
| 160 | TRACE_EVENT(xen_mmu_set_domain_pte, |
| 161 | TP_PROTO(pte_t *ptep, pte_t pteval, unsigned domid), |
| 162 | TP_ARGS(ptep, pteval, domid), |
| 163 | TP_STRUCT__entry( |
| 164 | __field(pte_t *, ptep) |
| 165 | __field(pteval_t, pteval) |
| 166 | __field(unsigned, domid) |
| 167 | ), |
| 168 | TP_fast_assign(__entry->ptep = ptep; |
| 169 | __entry->pteval = pteval.pte; |
| 170 | __entry->domid = domid), |
| 171 | TP_printk("ptep %p pteval %0*llx (raw %0*llx) domid %u", |
| 172 | __entry->ptep, |
| 173 | (int)sizeof(pteval_t) * 2, (unsigned long long)pte_val(native_make_pte(__entry->pteval)), |
| 174 | (int)sizeof(pteval_t) * 2, (unsigned long long)__entry->pteval, |
| 175 | __entry->domid) |
| 176 | ); |
| 177 | |
| 178 | TRACE_EVENT(xen_mmu_set_pte_at, |
| 179 | TP_PROTO(struct mm_struct *mm, unsigned long addr, |
| 180 | pte_t *ptep, pte_t pteval), |
| 181 | TP_ARGS(mm, addr, ptep, pteval), |
| 182 | TP_STRUCT__entry( |
| 183 | __field(struct mm_struct *, mm) |
| 184 | __field(unsigned long, addr) |
| 185 | __field(pte_t *, ptep) |
| 186 | __field(pteval_t, pteval) |
| 187 | ), |
| 188 | TP_fast_assign(__entry->mm = mm; |
| 189 | __entry->addr = addr; |
| 190 | __entry->ptep = ptep; |
| 191 | __entry->pteval = pteval.pte), |
| 192 | TP_printk("mm %p addr %lx ptep %p pteval %0*llx (raw %0*llx)", |
| 193 | __entry->mm, __entry->addr, __entry->ptep, |
| 194 | (int)sizeof(pteval_t) * 2, (unsigned long long)pte_val(native_make_pte(__entry->pteval)), |
| 195 | (int)sizeof(pteval_t) * 2, (unsigned long long)__entry->pteval) |
| 196 | ); |
| 197 | |
| 198 | TRACE_EVENT(xen_mmu_pte_clear, |
| 199 | TP_PROTO(struct mm_struct *mm, unsigned long addr, pte_t *ptep), |
| 200 | TP_ARGS(mm, addr, ptep), |
| 201 | TP_STRUCT__entry( |
| 202 | __field(struct mm_struct *, mm) |
| 203 | __field(unsigned long, addr) |
| 204 | __field(pte_t *, ptep) |
| 205 | ), |
| 206 | TP_fast_assign(__entry->mm = mm; |
| 207 | __entry->addr = addr; |
| 208 | __entry->ptep = ptep), |
| 209 | TP_printk("mm %p addr %lx ptep %p", |
| 210 | __entry->mm, __entry->addr, __entry->ptep) |
| 211 | ); |
| 212 | |
| 213 | TRACE_EVENT(xen_mmu_set_pmd, |
| 214 | TP_PROTO(pmd_t *pmdp, pmd_t pmdval), |
| 215 | TP_ARGS(pmdp, pmdval), |
| 216 | TP_STRUCT__entry( |
| 217 | __field(pmd_t *, pmdp) |
| 218 | __field(pmdval_t, pmdval) |
| 219 | ), |
| 220 | TP_fast_assign(__entry->pmdp = pmdp; |
| 221 | __entry->pmdval = pmdval.pmd), |
| 222 | TP_printk("pmdp %p pmdval %0*llx (raw %0*llx)", |
| 223 | __entry->pmdp, |
| 224 | (int)sizeof(pmdval_t) * 2, (unsigned long long)pmd_val(native_make_pmd(__entry->pmdval)), |
| 225 | (int)sizeof(pmdval_t) * 2, (unsigned long long)__entry->pmdval) |
| 226 | ); |
| 227 | |
| 228 | TRACE_EVENT(xen_mmu_pmd_clear, |
| 229 | TP_PROTO(pmd_t *pmdp), |
| 230 | TP_ARGS(pmdp), |
| 231 | TP_STRUCT__entry( |
| 232 | __field(pmd_t *, pmdp) |
| 233 | ), |
| 234 | TP_fast_assign(__entry->pmdp = pmdp), |
| 235 | TP_printk("pmdp %p", __entry->pmdp) |
| 236 | ); |
| 237 | |
| 238 | #if PAGETABLE_LEVELS >= 4 |
| 239 | |
| 240 | TRACE_EVENT(xen_mmu_set_pud, |
| 241 | TP_PROTO(pud_t *pudp, pud_t pudval), |
| 242 | TP_ARGS(pudp, pudval), |
| 243 | TP_STRUCT__entry( |
| 244 | __field(pud_t *, pudp) |
| 245 | __field(pudval_t, pudval) |
| 246 | ), |
| 247 | TP_fast_assign(__entry->pudp = pudp; |
| 248 | __entry->pudval = native_pud_val(pudval)), |
| 249 | TP_printk("pudp %p pudval %0*llx (raw %0*llx)", |
| 250 | __entry->pudp, |
| 251 | (int)sizeof(pudval_t) * 2, (unsigned long long)pud_val(native_make_pud(__entry->pudval)), |
| 252 | (int)sizeof(pudval_t) * 2, (unsigned long long)__entry->pudval) |
| 253 | ); |
| 254 | |
| 255 | TRACE_EVENT(xen_mmu_set_pgd, |
| 256 | TP_PROTO(pgd_t *pgdp, pgd_t *user_pgdp, pgd_t pgdval), |
| 257 | TP_ARGS(pgdp, user_pgdp, pgdval), |
| 258 | TP_STRUCT__entry( |
| 259 | __field(pgd_t *, pgdp) |
| 260 | __field(pgd_t *, user_pgdp) |
| 261 | __field(pgdval_t, pgdval) |
| 262 | ), |
| 263 | TP_fast_assign(__entry->pgdp = pgdp; |
| 264 | __entry->user_pgdp = user_pgdp; |
| 265 | __entry->pgdval = pgdval.pgd), |
| 266 | TP_printk("pgdp %p user_pgdp %p pgdval %0*llx (raw %0*llx)", |
| 267 | __entry->pgdp, __entry->user_pgdp, |
| 268 | (int)sizeof(pgdval_t) * 2, (unsigned long long)pgd_val(native_make_pgd(__entry->pgdval)), |
| 269 | (int)sizeof(pgdval_t) * 2, (unsigned long long)__entry->pgdval) |
| 270 | ); |
| 271 | |
| 272 | TRACE_EVENT(xen_mmu_pud_clear, |
| 273 | TP_PROTO(pud_t *pudp), |
| 274 | TP_ARGS(pudp), |
| 275 | TP_STRUCT__entry( |
| 276 | __field(pud_t *, pudp) |
| 277 | ), |
| 278 | TP_fast_assign(__entry->pudp = pudp), |
| 279 | TP_printk("pudp %p", __entry->pudp) |
| 280 | ); |
| 281 | #else |
| 282 | |
| 283 | TRACE_EVENT(xen_mmu_set_pud, |
| 284 | TP_PROTO(pud_t *pudp, pud_t pudval), |
| 285 | TP_ARGS(pudp, pudval), |
| 286 | TP_STRUCT__entry( |
| 287 | __field(pud_t *, pudp) |
| 288 | __field(pudval_t, pudval) |
| 289 | ), |
| 290 | TP_fast_assign(__entry->pudp = pudp; |
| 291 | __entry->pudval = native_pud_val(pudval)), |
| 292 | TP_printk("pudp %p pudval %0*llx (raw %0*llx)", |
| 293 | __entry->pudp, |
| 294 | (int)sizeof(pudval_t) * 2, (unsigned long long)pgd_val(native_make_pgd(__entry->pudval)), |
| 295 | (int)sizeof(pudval_t) * 2, (unsigned long long)__entry->pudval) |
| 296 | ); |
| 297 | |
| 298 | #endif |
| 299 | |
| 300 | TRACE_EVENT(xen_mmu_pgd_clear, |
| 301 | TP_PROTO(pgd_t *pgdp), |
| 302 | TP_ARGS(pgdp), |
| 303 | TP_STRUCT__entry( |
| 304 | __field(pgd_t *, pgdp) |
| 305 | ), |
| 306 | TP_fast_assign(__entry->pgdp = pgdp), |
| 307 | TP_printk("pgdp %p", __entry->pgdp) |
| 308 | ); |
| 309 | |
| 310 | TRACE_EVENT(xen_mmu_ptep_modify_prot_start, |
| 311 | TP_PROTO(struct mm_struct *mm, unsigned long addr, |
| 312 | pte_t *ptep, pte_t pteval), |
| 313 | TP_ARGS(mm, addr, ptep, pteval), |
| 314 | TP_STRUCT__entry( |
| 315 | __field(struct mm_struct *, mm) |
| 316 | __field(unsigned long, addr) |
| 317 | __field(pte_t *, ptep) |
| 318 | __field(pteval_t, pteval) |
| 319 | ), |
| 320 | TP_fast_assign(__entry->mm = mm; |
| 321 | __entry->addr = addr; |
| 322 | __entry->ptep = ptep; |
| 323 | __entry->pteval = pteval.pte), |
| 324 | TP_printk("mm %p addr %lx ptep %p pteval %0*llx (raw %0*llx)", |
| 325 | __entry->mm, __entry->addr, __entry->ptep, |
| 326 | (int)sizeof(pteval_t) * 2, (unsigned long long)pte_val(native_make_pte(__entry->pteval)), |
| 327 | (int)sizeof(pteval_t) * 2, (unsigned long long)__entry->pteval) |
| 328 | ); |
| 329 | |
| 330 | TRACE_EVENT(xen_mmu_ptep_modify_prot_commit, |
| 331 | TP_PROTO(struct mm_struct *mm, unsigned long addr, |
| 332 | pte_t *ptep, pte_t pteval), |
| 333 | TP_ARGS(mm, addr, ptep, pteval), |
| 334 | TP_STRUCT__entry( |
| 335 | __field(struct mm_struct *, mm) |
| 336 | __field(unsigned long, addr) |
| 337 | __field(pte_t *, ptep) |
| 338 | __field(pteval_t, pteval) |
| 339 | ), |
| 340 | TP_fast_assign(__entry->mm = mm; |
| 341 | __entry->addr = addr; |
| 342 | __entry->ptep = ptep; |
| 343 | __entry->pteval = pteval.pte), |
| 344 | TP_printk("mm %p addr %lx ptep %p pteval %0*llx (raw %0*llx)", |
| 345 | __entry->mm, __entry->addr, __entry->ptep, |
| 346 | (int)sizeof(pteval_t) * 2, (unsigned long long)pte_val(native_make_pte(__entry->pteval)), |
| 347 | (int)sizeof(pteval_t) * 2, (unsigned long long)__entry->pteval) |
| 348 | ); |
| 349 | |
| 350 | |
Jeremy Fitzhardinge | 634355d | 2010-12-16 13:39:18 -0800 | [diff] [blame] | 351 | #endif /* _TRACE_XEN_H */ |
| 352 | |
| 353 | /* This part must be outside protection */ |
| 354 | #include <trace/define_trace.h> |