From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756189Ab3KWJ2U (ORCPT ); Sat, 23 Nov 2013 04:28:20 -0500 Received: from cdptpa-outbound-snat.email.rr.com ([107.14.166.225]:11208 "EHLO cdptpa-oedge-vip.email.rr.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754878Ab3KWJ2Q convert rfc822-to-8bit (ORCPT ); Sat, 23 Nov 2013 04:28:16 -0500 Date: Sat, 23 Nov 2013 04:28:15 -0500 From: Steven Rostedt To: Namhyung Kim Cc: Jiri Olsa , linux-kernel@vger.kernel.org, Corey Ashford , Frederic Weisbecker , Ingo Molnar , Paul Mackerras , Peter Zijlstra , Arnaldo Carvalho de Melo , David Ahern Subject: Re: [PATCH 14/22] tools lib traceevent: Update kvm plugin with is_writable_pte helper Message-ID: <20131123042815.0e03ca96@gandalf.local.home> In-Reply-To: <1385133588.1747.91.camel@leonhard> References: <1385031680-9014-1-git-send-email-jolsa@redhat.com> <1385031680-9014-15-git-send-email-jolsa@redhat.com> <1385133588.1747.91.camel@leonhard> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.20; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-RR-Connecting-IP: 107.14.168.118:25 X-Cloudmark-Score: 0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 23 Nov 2013 00:19:48 +0900 Namhyung Kim wrote: > 2013-11-21 (목), 12:01 +0100, Jiri Olsa: > > Adding is_writable_pte print helper function, so the > > kvmmmu:fast_page_fault print format gets resolved properly. > > > > The diff of 'perf script' output generated by old and new code: > > (data was generated by 'perf record -e 'kvm:*,kvmmmu:*' -a') > > > > --- script.kvm.old > > +++ script.kvm.new > > - qemu-system-x86 3290 [002] 10708.755312: kvmmmu:fast_page_fault: [FAILED TO PARSE] vcpu_id=0 gva=4094486080 error_code=3 sptep=0xffff88019f1e3670 old_spte=336391285 new_spte=336391287 retry=1 > > + qemu-system-x86 3290 [002] 10708.755312: kvmmmu:fast_page_fault: vcpu 0 gva f40ce640 error_code P|W sptep 0xffff88019f1e3670 old 0x140cec75 new 140cec77 spurious 0 fixed 1 > > [SNIP] > > +unsigned long long process_is_writable_pte(struct trace_seq *s, > > + unsigned long long *args) > > +{ > > + unsigned long pte = args[0]; > > + return pte & PT_WRITABLE_MASK; > > +} > > + > > int PEVENT_PLUGIN_LOADER(struct pevent *pevent) > > { > > init_disassembler(); > > @@ -415,5 +425,12 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent) > > pevent_register_event_handler(pevent, -1, "kvmmmu", > > "kvm_mmu_prepare_zap_page", kvm_mmu_print_role, > > NULL); > > + > > + pevent_register_print_function(pevent, > > + process_is_writable_pte, > > + PEVENT_FUNC_ARG_INT, > > Same as the previous reply - return type of the function is > inconsistent. Actually it's not. > > And please also consider making the function static. Agreed. -- Steve > > Thanks, > Namhyung > > > > + "is_writable_pte", > > + PEVENT_FUNC_ARG_LONG, > > + PEVENT_FUNC_ARG_VOID); > > return 0; > > } > >