diff options
author | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2010-12-16 17:33:27 -0500 |
---|---|---|
committer | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2011-07-18 18:43:26 -0400 |
commit | c796f213a6934712ede728d9b53ef0e5066db23a (patch) | |
tree | 30fffcabfad42297b2d4b1f455a5f88ccf91091b /arch/x86/include | |
parent | f04e2ee41d3dbeb6eeb3685d1b4c208b898e278f (diff) |
xen/trace: add multicall tracing
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'arch/x86/include')
-rw-r--r-- | arch/x86/include/asm/xen/hypercall.h | 22 | ||||
-rw-r--r-- | arch/x86/include/asm/xen/trace_types.h | 18 |
2 files changed, 40 insertions, 0 deletions
diff --git a/arch/x86/include/asm/xen/hypercall.h b/arch/x86/include/asm/xen/hypercall.h index d240ea95051..417777de5a4 100644 --- a/arch/x86/include/asm/xen/hypercall.h +++ b/arch/x86/include/asm/xen/hypercall.h | |||
@@ -39,6 +39,8 @@ | |||
39 | #include <linux/string.h> | 39 | #include <linux/string.h> |
40 | #include <linux/types.h> | 40 | #include <linux/types.h> |
41 | 41 | ||
42 | #include <trace/events/xen.h> | ||
43 | |||
42 | #include <asm/page.h> | 44 | #include <asm/page.h> |
43 | #include <asm/pgtable.h> | 45 | #include <asm/pgtable.h> |
44 | 46 | ||
@@ -459,6 +461,8 @@ MULTI_fpu_taskswitch(struct multicall_entry *mcl, int set) | |||
459 | { | 461 | { |
460 | mcl->op = __HYPERVISOR_fpu_taskswitch; | 462 | mcl->op = __HYPERVISOR_fpu_taskswitch; |
461 | mcl->args[0] = set; | 463 | mcl->args[0] = set; |
464 | |||
465 | trace_xen_mc_entry(mcl, 1); | ||
462 | } | 466 | } |
463 | 467 | ||
464 | static inline void | 468 | static inline void |
@@ -475,6 +479,8 @@ MULTI_update_va_mapping(struct multicall_entry *mcl, unsigned long va, | |||
475 | mcl->args[2] = new_val.pte >> 32; | 479 | mcl->args[2] = new_val.pte >> 32; |
476 | mcl->args[3] = flags; | 480 | mcl->args[3] = flags; |
477 | } | 481 | } |
482 | |||
483 | trace_xen_mc_entry(mcl, sizeof(new_val) == sizeof(long) ? 3 : 4); | ||
478 | } | 484 | } |
479 | 485 | ||
480 | static inline void | 486 | static inline void |
@@ -485,6 +491,8 @@ MULTI_grant_table_op(struct multicall_entry *mcl, unsigned int cmd, | |||
485 | mcl->args[0] = cmd; | 491 | mcl->args[0] = cmd; |
486 | mcl->args[1] = (unsigned long)uop; | 492 | mcl->args[1] = (unsigned long)uop; |
487 | mcl->args[2] = count; | 493 | mcl->args[2] = count; |
494 | |||
495 | trace_xen_mc_entry(mcl, 3); | ||
488 | } | 496 | } |
489 | 497 | ||
490 | static inline void | 498 | static inline void |
@@ -504,6 +512,8 @@ MULTI_update_va_mapping_otherdomain(struct multicall_entry *mcl, unsigned long v | |||
504 | mcl->args[3] = flags; | 512 | mcl->args[3] = flags; |
505 | mcl->args[4] = domid; | 513 | mcl->args[4] = domid; |
506 | } | 514 | } |
515 | |||
516 | trace_xen_mc_entry(mcl, sizeof(new_val) == sizeof(long) ? 4 : 5); | ||
507 | } | 517 | } |
508 | 518 | ||
509 | static inline void | 519 | static inline void |
@@ -520,6 +530,8 @@ MULTI_update_descriptor(struct multicall_entry *mcl, u64 maddr, | |||
520 | mcl->args[2] = desc.a; | 530 | mcl->args[2] = desc.a; |
521 | mcl->args[3] = desc.b; | 531 | mcl->args[3] = desc.b; |
522 | } | 532 | } |
533 | |||
534 | trace_xen_mc_entry(mcl, sizeof(maddr) == sizeof(long) ? 2 : 4); | ||
523 | } | 535 | } |
524 | 536 | ||
525 | static inline void | 537 | static inline void |
@@ -528,6 +540,8 @@ MULTI_memory_op(struct multicall_entry *mcl, unsigned int cmd, void *arg) | |||
528 | mcl->op = __HYPERVISOR_memory_op; | 540 | mcl->op = __HYPERVISOR_memory_op; |
529 | mcl->args[0] = cmd; | 541 | mcl->args[0] = cmd; |
530 | mcl->args[1] = (unsigned long)arg; | 542 | mcl->args[1] = (unsigned long)arg; |
543 | |||
544 | trace_xen_mc_entry(mcl, 2); | ||
531 | } | 545 | } |
532 | 546 | ||
533 | static inline void | 547 | static inline void |
@@ -539,6 +553,8 @@ MULTI_mmu_update(struct multicall_entry *mcl, struct mmu_update *req, | |||
539 | mcl->args[1] = count; | 553 | mcl->args[1] = count; |
540 | mcl->args[2] = (unsigned long)success_count; | 554 | mcl->args[2] = (unsigned long)success_count; |
541 | mcl->args[3] = domid; | 555 | mcl->args[3] = domid; |
556 | |||
557 | trace_xen_mc_entry(mcl, 4); | ||
542 | } | 558 | } |
543 | 559 | ||
544 | static inline void | 560 | static inline void |
@@ -550,6 +566,8 @@ MULTI_mmuext_op(struct multicall_entry *mcl, struct mmuext_op *op, int count, | |||
550 | mcl->args[1] = count; | 566 | mcl->args[1] = count; |
551 | mcl->args[2] = (unsigned long)success_count; | 567 | mcl->args[2] = (unsigned long)success_count; |
552 | mcl->args[3] = domid; | 568 | mcl->args[3] = domid; |
569 | |||
570 | trace_xen_mc_entry(mcl, 4); | ||
553 | } | 571 | } |
554 | 572 | ||
555 | static inline void | 573 | static inline void |
@@ -558,6 +576,8 @@ MULTI_set_gdt(struct multicall_entry *mcl, unsigned long *frames, int entries) | |||
558 | mcl->op = __HYPERVISOR_set_gdt; | 576 | mcl->op = __HYPERVISOR_set_gdt; |
559 | mcl->args[0] = (unsigned long)frames; | 577 | mcl->args[0] = (unsigned long)frames; |
560 | mcl->args[1] = entries; | 578 | mcl->args[1] = entries; |
579 | |||
580 | trace_xen_mc_entry(mcl, 2); | ||
561 | } | 581 | } |
562 | 582 | ||
563 | static inline void | 583 | static inline void |
@@ -567,6 +587,8 @@ MULTI_stack_switch(struct multicall_entry *mcl, | |||
567 | mcl->op = __HYPERVISOR_stack_switch; | 587 | mcl->op = __HYPERVISOR_stack_switch; |
568 | mcl->args[0] = ss; | 588 | mcl->args[0] = ss; |
569 | mcl->args[1] = esp; | 589 | mcl->args[1] = esp; |
590 | |||
591 | trace_xen_mc_entry(mcl, 2); | ||
570 | } | 592 | } |
571 | 593 | ||
572 | #endif /* _ASM_X86_XEN_HYPERCALL_H */ | 594 | #endif /* _ASM_X86_XEN_HYPERCALL_H */ |
diff --git a/arch/x86/include/asm/xen/trace_types.h b/arch/x86/include/asm/xen/trace_types.h new file mode 100644 index 00000000000..21e1874c0a0 --- /dev/null +++ b/arch/x86/include/asm/xen/trace_types.h | |||
@@ -0,0 +1,18 @@ | |||
1 | #ifndef _ASM_XEN_TRACE_TYPES_H | ||
2 | #define _ASM_XEN_TRACE_TYPES_H | ||
3 | |||
4 | enum xen_mc_flush_reason { | ||
5 | XEN_MC_FL_NONE, /* explicit flush */ | ||
6 | XEN_MC_FL_BATCH, /* out of hypercall space */ | ||
7 | XEN_MC_FL_ARGS, /* out of argument space */ | ||
8 | XEN_MC_FL_CALLBACK, /* out of callback space */ | ||
9 | }; | ||
10 | |||
11 | enum xen_mc_extend_args { | ||
12 | XEN_MC_XE_OK, | ||
13 | XEN_MC_XE_BAD_OP, | ||
14 | XEN_MC_XE_NO_SPACE | ||
15 | }; | ||
16 | typedef void (*xen_mc_callback_fn_t)(void *); | ||
17 | |||
18 | #endif /* _ASM_XEN_TRACE_TYPES_H */ | ||