diff options
author | James Hogan <james.hogan@imgtec.com> | 2016-06-17 13:19:40 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-06-23 13:17:30 -0400 |
commit | fb6cec1492d6a693d33224487061e92d0275c6e2 (patch) | |
tree | 0af21b7dede236587610e54d5a5190ef60756766 | |
parent | 87aeb54f1b9891cf08b84b3f0c34f220a4977c4f (diff) |
MIPS: KVM: Combine entry trace events into class
Combine the kvm_enter, kvm_reenter and kvm_out trace events into a
single kvm_transition event class to reduce duplication and bloat.
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Fixes: 93258604ab6d ("MIPS: KVM: Add guest mode switch trace events")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim KrÄmář <rkrcmar@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | arch/mips/kvm/trace.h | 62 |
1 files changed, 22 insertions, 40 deletions
diff --git a/arch/mips/kvm/trace.h b/arch/mips/kvm/trace.h index a38bdab68574..c858cf168078 100644 --- a/arch/mips/kvm/trace.h +++ b/arch/mips/kvm/trace.h | |||
@@ -20,50 +20,32 @@ | |||
20 | /* | 20 | /* |
21 | * Tracepoints for VM enters | 21 | * Tracepoints for VM enters |
22 | */ | 22 | */ |
23 | TRACE_EVENT(kvm_enter, | 23 | DECLARE_EVENT_CLASS(kvm_transition, |
24 | TP_PROTO(struct kvm_vcpu *vcpu), | 24 | TP_PROTO(struct kvm_vcpu *vcpu), |
25 | TP_ARGS(vcpu), | 25 | TP_ARGS(vcpu), |
26 | TP_STRUCT__entry( | 26 | TP_STRUCT__entry( |
27 | __field(unsigned long, pc) | 27 | __field(unsigned long, pc) |
28 | ), | 28 | ), |
29 | 29 | ||
30 | TP_fast_assign( | 30 | TP_fast_assign( |
31 | __entry->pc = vcpu->arch.pc; | 31 | __entry->pc = vcpu->arch.pc; |
32 | ), | 32 | ), |
33 | 33 | ||
34 | TP_printk("PC: 0x%08lx", | 34 | TP_printk("PC: 0x%08lx", |
35 | __entry->pc) | 35 | __entry->pc) |
36 | ); | ||
37 | |||
38 | TRACE_EVENT(kvm_reenter, | ||
39 | TP_PROTO(struct kvm_vcpu *vcpu), | ||
40 | TP_ARGS(vcpu), | ||
41 | TP_STRUCT__entry( | ||
42 | __field(unsigned long, pc) | ||
43 | ), | ||
44 | |||
45 | TP_fast_assign( | ||
46 | __entry->pc = vcpu->arch.pc; | ||
47 | ), | ||
48 | |||
49 | TP_printk("PC: 0x%08lx", | ||
50 | __entry->pc) | ||
51 | ); | 36 | ); |
52 | 37 | ||
53 | TRACE_EVENT(kvm_out, | 38 | DEFINE_EVENT(kvm_transition, kvm_enter, |
54 | TP_PROTO(struct kvm_vcpu *vcpu), | 39 | TP_PROTO(struct kvm_vcpu *vcpu), |
55 | TP_ARGS(vcpu), | 40 | TP_ARGS(vcpu)); |
56 | TP_STRUCT__entry( | ||
57 | __field(unsigned long, pc) | ||
58 | ), | ||
59 | 41 | ||
60 | TP_fast_assign( | 42 | DEFINE_EVENT(kvm_transition, kvm_reenter, |
61 | __entry->pc = vcpu->arch.pc; | 43 | TP_PROTO(struct kvm_vcpu *vcpu), |
62 | ), | 44 | TP_ARGS(vcpu)); |
63 | 45 | ||
64 | TP_printk("PC: 0x%08lx", | 46 | DEFINE_EVENT(kvm_transition, kvm_out, |
65 | __entry->pc) | 47 | TP_PROTO(struct kvm_vcpu *vcpu), |
66 | ); | 48 | TP_ARGS(vcpu)); |
67 | 49 | ||
68 | /* The first 32 exit reasons correspond to Cause.ExcCode */ | 50 | /* The first 32 exit reasons correspond to Cause.ExcCode */ |
69 | #define KVM_TRACE_EXIT_INT 0 | 51 | #define KVM_TRACE_EXIT_INT 0 |