diff options
author | Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> | 2010-04-27 23:54:55 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-05-19 04:36:26 -0400 |
commit | 85f2067c3192212bce3bd2e1d6ad10153d6f2a4e (patch) | |
tree | 41f18bfd809229d93cd0c33f0e6d97d5cc049c56 /arch/x86 | |
parent | 22c9b2d166a88573a933e8d355833d36579d83be (diff) |
KVM: MMU: convert mmu tracepoints
Convert mmu tracepoints by using DECLARE_EVENT_CLASS
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kvm/mmutrace.h | 69 |
1 files changed, 26 insertions, 43 deletions
diff --git a/arch/x86/kvm/mmutrace.h b/arch/x86/kvm/mmutrace.h index 40a1786f36c7..42f07b1bfbc9 100644 --- a/arch/x86/kvm/mmutrace.h +++ b/arch/x86/kvm/mmutrace.h | |||
@@ -92,15 +92,15 @@ TRACE_EVENT( | |||
92 | TP_printk("pte %llx level %u", __entry->pte, __entry->level) | 92 | TP_printk("pte %llx level %u", __entry->pte, __entry->level) |
93 | ); | 93 | ); |
94 | 94 | ||
95 | /* We set a pte accessed bit */ | 95 | DECLARE_EVENT_CLASS(kvm_mmu_set_bit_class, |
96 | TRACE_EVENT( | 96 | |
97 | kvm_mmu_set_accessed_bit, | ||
98 | TP_PROTO(unsigned long table_gfn, unsigned index, unsigned size), | 97 | TP_PROTO(unsigned long table_gfn, unsigned index, unsigned size), |
98 | |||
99 | TP_ARGS(table_gfn, index, size), | 99 | TP_ARGS(table_gfn, index, size), |
100 | 100 | ||
101 | TP_STRUCT__entry( | 101 | TP_STRUCT__entry( |
102 | __field(__u64, gpa) | 102 | __field(__u64, gpa) |
103 | ), | 103 | ), |
104 | 104 | ||
105 | TP_fast_assign( | 105 | TP_fast_assign( |
106 | __entry->gpa = ((u64)table_gfn << PAGE_SHIFT) | 106 | __entry->gpa = ((u64)table_gfn << PAGE_SHIFT) |
@@ -110,22 +110,20 @@ TRACE_EVENT( | |||
110 | TP_printk("gpa %llx", __entry->gpa) | 110 | TP_printk("gpa %llx", __entry->gpa) |
111 | ); | 111 | ); |
112 | 112 | ||
113 | /* We set a pte dirty bit */ | 113 | /* We set a pte accessed bit */ |
114 | TRACE_EVENT( | 114 | DEFINE_EVENT(kvm_mmu_set_bit_class, kvm_mmu_set_accessed_bit, |
115 | kvm_mmu_set_dirty_bit, | 115 | |
116 | TP_PROTO(unsigned long table_gfn, unsigned index, unsigned size), | 116 | TP_PROTO(unsigned long table_gfn, unsigned index, unsigned size), |
117 | TP_ARGS(table_gfn, index, size), | ||
118 | 117 | ||
119 | TP_STRUCT__entry( | 118 | TP_ARGS(table_gfn, index, size) |
120 | __field(__u64, gpa) | 119 | ); |
121 | ), | ||
122 | 120 | ||
123 | TP_fast_assign( | 121 | /* We set a pte dirty bit */ |
124 | __entry->gpa = ((u64)table_gfn << PAGE_SHIFT) | 122 | DEFINE_EVENT(kvm_mmu_set_bit_class, kvm_mmu_set_dirty_bit, |
125 | + index * size; | ||
126 | ), | ||
127 | 123 | ||
128 | TP_printk("gpa %llx", __entry->gpa) | 124 | TP_PROTO(unsigned long table_gfn, unsigned index, unsigned size), |
125 | |||
126 | TP_ARGS(table_gfn, index, size) | ||
129 | ); | 127 | ); |
130 | 128 | ||
131 | TRACE_EVENT( | 129 | TRACE_EVENT( |
@@ -164,54 +162,39 @@ TRACE_EVENT( | |||
164 | __entry->created ? "new" : "existing") | 162 | __entry->created ? "new" : "existing") |
165 | ); | 163 | ); |
166 | 164 | ||
167 | TRACE_EVENT( | 165 | DECLARE_EVENT_CLASS(kvm_mmu_page_class, |
168 | kvm_mmu_sync_page, | 166 | |
169 | TP_PROTO(struct kvm_mmu_page *sp), | 167 | TP_PROTO(struct kvm_mmu_page *sp), |
170 | TP_ARGS(sp), | 168 | TP_ARGS(sp), |
171 | 169 | ||
172 | TP_STRUCT__entry( | 170 | TP_STRUCT__entry( |
173 | KVM_MMU_PAGE_FIELDS | 171 | KVM_MMU_PAGE_FIELDS |
174 | ), | 172 | ), |
175 | 173 | ||
176 | TP_fast_assign( | 174 | TP_fast_assign( |
177 | KVM_MMU_PAGE_ASSIGN(sp) | 175 | KVM_MMU_PAGE_ASSIGN(sp) |
178 | ), | 176 | ), |
179 | 177 | ||
180 | TP_printk("%s", KVM_MMU_PAGE_PRINTK()) | 178 | TP_printk("%s", KVM_MMU_PAGE_PRINTK()) |
181 | ); | 179 | ); |
182 | 180 | ||
183 | TRACE_EVENT( | 181 | DEFINE_EVENT(kvm_mmu_page_class, kvm_mmu_sync_page, |
184 | kvm_mmu_unsync_page, | ||
185 | TP_PROTO(struct kvm_mmu_page *sp), | 182 | TP_PROTO(struct kvm_mmu_page *sp), |
186 | TP_ARGS(sp), | ||
187 | |||
188 | TP_STRUCT__entry( | ||
189 | KVM_MMU_PAGE_FIELDS | ||
190 | ), | ||
191 | |||
192 | TP_fast_assign( | ||
193 | KVM_MMU_PAGE_ASSIGN(sp) | ||
194 | ), | ||
195 | 183 | ||
196 | TP_printk("%s", KVM_MMU_PAGE_PRINTK()) | 184 | TP_ARGS(sp) |
197 | ); | 185 | ); |
198 | 186 | ||
199 | TRACE_EVENT( | 187 | DEFINE_EVENT(kvm_mmu_page_class, kvm_mmu_unsync_page, |
200 | kvm_mmu_zap_page, | ||
201 | TP_PROTO(struct kvm_mmu_page *sp), | 188 | TP_PROTO(struct kvm_mmu_page *sp), |
202 | TP_ARGS(sp), | ||
203 | 189 | ||
204 | TP_STRUCT__entry( | 190 | TP_ARGS(sp) |
205 | KVM_MMU_PAGE_FIELDS | 191 | ); |
206 | ), | ||
207 | 192 | ||
208 | TP_fast_assign( | 193 | DEFINE_EVENT(kvm_mmu_page_class, kvm_mmu_zap_page, |
209 | KVM_MMU_PAGE_ASSIGN(sp) | 194 | TP_PROTO(struct kvm_mmu_page *sp), |
210 | ), | ||
211 | 195 | ||
212 | TP_printk("%s", KVM_MMU_PAGE_PRINTK()) | 196 | TP_ARGS(sp) |
213 | ); | 197 | ); |
214 | |||
215 | #endif /* _TRACE_KVMMMU_H */ | 198 | #endif /* _TRACE_KVMMMU_H */ |
216 | 199 | ||
217 | #undef TRACE_INCLUDE_PATH | 200 | #undef TRACE_INCLUDE_PATH |