Re: [PATCH 3/3] KVM: perf: kvm events analysis tool

2012-02-26 Thread Xiao Guangrong
On 02/21/2012 07:47 AM, David Ahern wrote: diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h index 70c2c13..c48ebf3 100644 --- a/tools/perf/util/thread.h +++ b/tools/perf/util/thread.h @@ -16,6 +16,8 @@ struct thread { boolcomm_set; char

Re: [PATCH 3/3] KVM: perf: kvm events analysis tool

2012-02-20 Thread David Ahern
Finally got back to this. Overall nicely written command. Few comments and one for Arnaldo at the bottom. On 2/9/12 2:09 AM, Xiao Guangrong wrote: Add 'perf kvm-events' support to analyze kvm vmexit/mmio/ioport smartly Usage: - trace kvm events: perf kvm-events record, or, if other

Re: [PATCH 3/3] KVM: perf: kvm events analysis tool

2012-02-20 Thread Xiao Guangrong
On 02/21/2012 07:47 AM, David Ahern wrote: - show the result: perf kvm-events report It would be nice to have example reports in this commit message. Okay. +DESCRIPTION +--- +You can analyze some crucial kvm events and statistics with this +'perf kvm-events' command.

Re: [PATCH 3/3] KVM: perf: kvm events analysis tool

2012-02-20 Thread David Ahern
On 2/20/12 8:52 PM, Xiao Guangrong wrote: +/* Both begin and end events did not get the key. */ +if (!event key-key == INVALID_KEY) +return; + Should not be able to get here with event unset, so the next 2 lines should not be needed. ie., you only want to process events where

Re: [PATCH 3/3] KVM: perf: kvm events analysis tool

2012-02-16 Thread Arnaldo Carvalho de Melo
Em Wed, Feb 15, 2012 at 10:05:08PM -0700, David Ahern escreveu: On 2/15/12 9:59 PM, Xiao Guangrong wrote: Okay, i will post the next version after collecting your new comments! Thanks for your time, David! :) I had more comments, but got sidetracked and forgot to come back to this.

Re: [PATCH 3/3] KVM: perf: kvm events analysis tool

2012-02-15 Thread Xiao Guangrong
On 02/13/2012 11:52 PM, David Ahern wrote: The first patch is only needed for code compilation, after kvm-events is compiled, you can analyse any kernels. :) understood. Now that I recall perf's way of handling out of tree builds, a couple of comments: 1. you need to add the

Re: [PATCH 3/3] KVM: perf: kvm events analysis tool

2012-02-15 Thread David Ahern
On 2/15/12 9:59 PM, Xiao Guangrong wrote: Okay, i will post the next version after collecting your new comments! Thanks for your time, David! :) I had more comments, but got sidetracked and forgot to come back to this. I still haven't looked at the code yet, but some comments from

Re: [PATCH 3/3] KVM: perf: kvm events analysis tool

2012-02-15 Thread Xiao Guangrong
On 02/16/2012 01:05 PM, David Ahern wrote: On 2/15/12 9:59 PM, Xiao Guangrong wrote: Okay, i will post the next version after collecting your new comments! Thanks for your time, David! :) I had more comments, but got sidetracked and forgot to come back to this. I still haven't looked

Re: [PATCH 3/3] KVM: perf: kvm events analysis tool

2012-02-13 Thread Xiao Guangrong
On 02/13/2012 01:32 PM, David Ahern wrote: [sorry for the top post - you would think Android would have a better mail client] If the first patch is needed then kvm-events will not work with older, unpatched kernels. That's a big limitation from a perf perpective. The first patch is

Re: [PATCH 3/3] KVM: perf: kvm events analysis tool

2012-02-13 Thread David Ahern
On 02/13/2012 03:06 AM, Xiao Guangrong wrote: On 02/13/2012 01:32 PM, David Ahern wrote: [sorry for the top post - you would think Android would have a better mail client] If the first patch is needed then kvm-events will not work with older, unpatched kernels. That's a big limitation

Re: [PATCH 3/3] KVM: perf: kvm events analysis tool

2012-02-12 Thread David Ahern
Compile fails on Fedora 16, x86_64 with latest tip-perf-core branch: In file included from builtin-kvm-events.c:19:0: ../../arch/x86/include/asm/svm.h:133:1: error: packed attribute is unnecessary for ‘vmcb_seg’ [-Werror=packed] ../../arch/x86/include/asm/svm.h:178:1: error: packed attribute is

Re: [PATCH 3/3] KVM: perf: kvm events analysis tool

2012-02-12 Thread Xiao Guangrong
On 02/13/2012 11:04 AM, David Ahern wrote: Compile fails on Fedora 16, x86_64 with latest tip-perf-core branch: In file included from builtin-kvm-events.c:19:0: ../../arch/x86/include/asm/svm.h:133:1: error: packed attribute is unnecessary for ‘vmcb_seg’ [-Werror=packed]

Re: [PATCH 3/3] KVM: perf: kvm events analysis tool

2012-02-12 Thread David Ahern
[sorry for the top post - you would think Android would have a better mail client] If the first patch is needed then kvm-events will not work with older, unpatched kernels. That's a big limitation from a perf perpective. David Sent from my ASUS Eee Pad Xiao Guangrong

Re: [PATCH 3/3] KVM: perf: kvm events analysis tool

2012-01-24 Thread Avi Kivity
On 01/17/2012 04:30 AM, Xiao Guangrong wrote: On 01/16/2012 06:04 PM, Avi Kivity wrote: On 01/16/2012 11:32 AM, Xiao Guangrong wrote: Add 'perf kvm-events' support to analyze kvm vmexit/mmio/ioport smartly Usage: perf kvm-events record Why not 'perf record -e kvm'? It works,

Re: [PATCH 3/3] KVM: perf: kvm events analysis tool

2012-01-24 Thread Avi Kivity
On 01/17/2012 01:59 PM, Marcelo Tosatti wrote: All this copy-paste could be avoided by sharing this stuff with the arch/x86/kvm/ code. Yes, same for KVM_MAX_VCPUS. This is an internal define. perf kvm should work with different kernel versions, so it needs to query the value

Re: [PATCH 3/3] KVM: perf: kvm events analysis tool

2012-01-17 Thread Marcelo Tosatti
On Mon, Jan 16, 2012 at 10:08:40AM +, Stefan Hajnoczi wrote: On Mon, Jan 16, 2012 at 9:32 AM, Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com wrote: +DESCRIPTION +--- +You can analyze some crucial events and statistics with this +'perf kvm-events' command. This line is

Re: [PATCH 3/3] KVM: perf: kvm events analysis tool

2012-01-16 Thread Avi Kivity
On 01/16/2012 11:32 AM, Xiao Guangrong wrote: Add 'perf kvm-events' support to analyze kvm vmexit/mmio/ioport smartly Usage: perf kvm-events record Why not 'perf record -e kvm'? perf kvm-events report +static const char *get_exit_reason(long isa, u64 exit_code) +{ +

Re: [PATCH 3/3] KVM: perf: kvm events analysis tool

2012-01-16 Thread Stefan Hajnoczi
On Mon, Jan 16, 2012 at 9:32 AM, Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com wrote: +DESCRIPTION +--- +You can analyze some crucial events and statistics with this +'perf kvm-events' command. This line is very general and does not explain which events/statistics can be collected

Re: [PATCH 3/3] KVM: perf: kvm events analysis tool

2012-01-16 Thread Xiao Guangrong
On 01/16/2012 06:04 PM, Avi Kivity wrote: On 01/16/2012 11:32 AM, Xiao Guangrong wrote: Add 'perf kvm-events' support to analyze kvm vmexit/mmio/ioport smartly Usage: perf kvm-events record Why not 'perf record -e kvm'? It works, many perf tools have this style, like: perf lock

Re: [PATCH 3/3] KVM: perf: kvm events analysis tool

2012-01-16 Thread Xiao Guangrong
On 01/16/2012 06:08 PM, Stefan Hajnoczi wrote: On Mon, Jan 16, 2012 at 9:32 AM, Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com wrote: +DESCRIPTION +--- +You can analyze some crucial events and statistics with this +'perf kvm-events' command. This line is very general and does