On Wed, Dec 26, 2012 at 08:58:30AM -0500, Steven Rostedt wrote: > On Tue, 2012-12-25 at 13:46 +0200, Gleb Natapov wrote: > > kvm_mmu_zap_page even was renamed to kvm_mmu_prepare_zap_page. > > Print out created field for kvm_mmu_get_page event. > > trace-cmd needs to be backward compatible with older kernels. If older > kernels used kvm_mmu_zap_page, then please add a check for that and have > the plugin cope with either one. > Something like this? if (pevent_find_event_by_name(pevent, "kvmmmu", "kvm_mmu_prepare_zap_page")) pevent_register_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_prepare_zap_page", kvm_mmu_print_role, NULL); else pevent_register_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_zap_page", kvm_mmu_print_role, NULL); Also when trace-cmd encounters an event it does not recognize it prints mysterious message: trace-cmd: No such file or directory bad op token { Is this a bug? > Thanks, > > -- Steve > > > > > Signed-off-by: Gleb Natapov <gleb@xxxxxxxxxx> > > diff --git a/plugin_kvm.c b/plugin_kvm.c > > index 55812ef..adc5694 100644 > > --- a/plugin_kvm.c > > +++ b/plugin_kvm.c > > @@ -382,7 +382,7 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct pevent_record *record, > > } else > > trace_seq_printf(s, "WORD: %08x", role.word); > > > > - pevent_print_num_field(s, " root %u", event, > > + pevent_print_num_field(s, " root %u ", event, > > "root_count", record, 1); > > > > if (pevent_get_field_val(s, event, "unsync", record, &val, 1) < 0) > > @@ -397,6 +397,11 @@ static int kvm_mmu_get_page_handler(struct trace_seq *s, struct pevent_record *r > > { > > unsigned long long val; > > > > + if (pevent_get_field_val(s, event, "created", record, &val, 1) < 0) > > + return -1; > > + > > + trace_seq_printf(s, "%s ", val ? "new" : "existing"); > > + > > if (pevent_get_field_val(s, event, "gfn", record, &val, 1) < 0) > > return -1; > > > > @@ -430,7 +435,7 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent) > > pevent_register_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_unsync_page", > > kvm_mmu_print_role, NULL); > > > > - pevent_register_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_zap_page", > > + pevent_register_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_prepare_zap_page", > > kvm_mmu_print_role, NULL); > > > > return 0; > > -- > > Gleb. > -- Gleb. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html