diff options
Diffstat (limited to 'tools/lib/traceevent/plugin_kvm.c')
| -rw-r--r-- | tools/lib/traceevent/plugin_kvm.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/lib/traceevent/plugin_kvm.c b/tools/lib/traceevent/plugin_kvm.c index be9d9c6a49e6..a0e282c6b967 100644 --- a/tools/lib/traceevent/plugin_kvm.c +++ b/tools/lib/traceevent/plugin_kvm.c | |||
| @@ -389,6 +389,16 @@ static int kvm_mmu_get_page_handler(struct trace_seq *s, | |||
| 389 | return kvm_mmu_print_role(s, record, event, context); | 389 | return kvm_mmu_print_role(s, record, event, context); |
| 390 | } | 390 | } |
| 391 | 391 | ||
| 392 | #define PT_WRITABLE_SHIFT 1 | ||
| 393 | #define PT_WRITABLE_MASK (1ULL << PT_WRITABLE_SHIFT) | ||
| 394 | |||
| 395 | static unsigned long long | ||
| 396 | process_is_writable_pte(struct trace_seq *s, unsigned long long *args) | ||
| 397 | { | ||
| 398 | unsigned long pte = args[0]; | ||
| 399 | return pte & PT_WRITABLE_MASK; | ||
| 400 | } | ||
| 401 | |||
| 392 | int PEVENT_PLUGIN_LOADER(struct pevent *pevent) | 402 | int PEVENT_PLUGIN_LOADER(struct pevent *pevent) |
| 393 | { | 403 | { |
| 394 | init_disassembler(); | 404 | init_disassembler(); |
| @@ -415,5 +425,12 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent) | |||
| 415 | pevent_register_event_handler(pevent, -1, "kvmmmu", | 425 | pevent_register_event_handler(pevent, -1, "kvmmmu", |
| 416 | "kvm_mmu_prepare_zap_page", kvm_mmu_print_role, | 426 | "kvm_mmu_prepare_zap_page", kvm_mmu_print_role, |
| 417 | NULL); | 427 | NULL); |
| 428 | |||
| 429 | pevent_register_print_function(pevent, | ||
| 430 | process_is_writable_pte, | ||
| 431 | PEVENT_FUNC_ARG_INT, | ||
| 432 | "is_writable_pte", | ||
| 433 | PEVENT_FUNC_ARG_LONG, | ||
| 434 | PEVENT_FUNC_ARG_VOID); | ||
| 418 | return 0; | 435 | return 0; |
| 419 | } | 436 | } |
