Re: [PATCH V2 3/5] ara virt interface of perf to support kvm guest os statistics collection in guest os

2010-06-23 Thread Zhang, Yanmin
On Wed, 2010-06-23 at 08:51 +0300, Avi Kivity wrote: On 06/23/2010 06:12 AM, Zhang, Yanmin wrote: This design is to deal with a task context perf collection in guest os. Scenario 1: 1) guest os starts to collect statistics of process A on vcpu 0; 2) process A is scheduled to vcpu 1

Re: [PATCH V2 3/5] ara virt interface of perf to support kvm guest os statistics collection in guest os

2010-06-22 Thread Zhang, Yanmin
On Mon, 2010-06-21 at 16:56 +0300, Gleb Natapov wrote: On Mon, Jun 21, 2010 at 05:31:43PM +0800, Zhang, Yanmin wrote: The 3rd patch is to implement para virt perf at host kernel. Signed-off-by: Zhang Yanmin yanmin_zh...@linux.intel.com snip + +static void kvm_copy_event_to_guest

Re: [PATCH V2 1/5] ara virt interface of perf to support kvm guest os statistics collection in guest os

2010-06-22 Thread Zhang, Yanmin
On Tue, 2010-06-22 at 09:14 +0200, Jes Sorensen wrote: On 06/22/10 03:49, Zhang, Yanmin wrote: On Mon, 2010-06-21 at 14:45 +0300, Avi Kivity wrote: Since the guest can use NMI to read the counter, it should have the highest possible priority, and thus it shouldn't see any overflow

Re: [PATCH V2 4/5] ara virt interface of perf to support kvm guest os statistics collection in guest os

2010-06-22 Thread Zhang, Yanmin
On Tue, 2010-06-22 at 10:24 +0200, Jes Sorensen wrote: On 06/21/10 11:31, Zhang, Yanmin wrote: @@ -583,10 +584,20 @@ static void x86_pmu_disable_all(void) } } +#ifdef CONFIG_KVM_PERF +static int kvm_hw_perf_enable(void); +static int kvm_hw_perf_disable(void); +#endif

Re: [PATCH V2 2/5] ara virt interface of perf to support kvm guest os statistics collection in guest os

2010-06-22 Thread Zhang, Yanmin
On Tue, 2010-06-22 at 12:12 +0300, Avi Kivity wrote: On 06/22/2010 05:08 AM, Zhang, Yanmin wrote: Something that is worrying is that we don't expose group information. perf will multiplex the events for us, but there will be a loss in accuracy. #ifdef

Re: [PATCH V2 1/5] ara virt interface of perf to support kvm guest os statistics collection in guest os

2010-06-22 Thread Zhang, Yanmin
On Tue, 2010-06-22 at 10:00 +0200, Jes Sorensen wrote: On 06/22/10 09:55, Peter Zijlstra wrote: On Tue, 2010-06-22 at 15:47 +0800, Zhang, Yanmin wrote: Besides the para virt perf interface, I'm also considering the direct exposition of PMU hardware to guest os. NAK NAK NAK NAK

Re: [PATCH V2 1/5] ara virt interface of perf to support kvm guest os statistics collection in guest os

2010-06-22 Thread Zhang, Yanmin
On Tue, 2010-06-22 at 09:58 +0200, Jes Sorensen wrote: On 06/22/10 09:47, Zhang, Yanmin wrote: On Tue, 2010-06-22 at 09:14 +0200, Jes Sorensen wrote: On 06/22/10 03:49, Zhang, Yanmin wrote: On Mon, 2010-06-21 at 14:45 +0300, Avi Kivity wrote: So I think above discussion is around how

Re: [PATCH V2 3/5] ara virt interface of perf to support kvm guest os statistics collection in guest os

2010-06-22 Thread Zhang, Yanmin
On Tue, 2010-06-22 at 11:04 +0300, Avi Kivity wrote: On 06/22/2010 08:47 AM, Zhang, Yanmin wrote: On Mon, 2010-06-21 at 16:56 +0300, Gleb Natapov wrote: On Mon, Jun 21, 2010 at 05:31:43PM +0800, Zhang, Yanmin wrote: The 3rd patch is to implement para virt perf at host kernel

Re: [PATCH V2 3/5] ara virt interface of perf to support kvm guest os statistics collection in guest os

2010-06-22 Thread Zhang, Yanmin
On Tue, 2010-06-22 at 11:29 +0300, Avi Kivity wrote: On 06/22/2010 06:12 AM, Zhang, Yanmin wrote: On Mon, 2010-06-21 at 15:33 +0300, Avi Kivity wrote: On 06/21/2010 12:31 PM, Zhang, Yanmin wrote: The 3rd patch is to implement para virt perf at host kernel. @@ -64,6

[PATCH V2 1/5] ara virt interface of perf to support kvm guest os statistics collection in guest os

2010-06-21 Thread Zhang, Yanmin
tip/master tree of June 20st. Signed-off-by: Zhang Yanmin yanmin_zh...@linux.intel.com --- --- linux-2.6_tip0620/Documentation/kvm/paravirt-perf.txt 1970-01-01 08:00:00.0 +0800 +++ linux-2.6_tip0620perfkvm/Documentation/kvm/paravirt-perf.txt 2010-06-21 15:21:39.312999849

[PATCH V2 2/5] ara virt interface of perf to support kvm guest os statistics collection in guest os

2010-06-21 Thread Zhang, Yanmin
The 2nd patch is to change the definition of perf_event to facilitate perf attr copy when a hypercall happens. Signed-off-by: Zhang Yanmin yanmin_zh...@linux.intel.com --- --- linux-2.6_tip0620/include/linux/perf_event.h2010-06-21 15:19:52.821999849 +0800 +++ linux-2.6_tip0620perfkvm

[PATCH V2 3/5] ara virt interface of perf to support kvm guest os statistics collection in guest os

2010-06-21 Thread Zhang, Yanmin
The 3rd patch is to implement para virt perf at host kernel. Signed-off-by: Zhang Yanmin yanmin_zh...@linux.intel.com --- --- linux-2.6_tip0620/arch/x86/include/asm/kvm_para.h 2010-06-21 15:19:38.992999849 +0800 +++ linux-2.6_tip0620perfkvm/arch/x86/include/asm/kvm_para.h2010-06-21 15

[PATCH V2 5/5] ara virt interface of perf to support kvm guest os statistics collection in guest os

2010-06-21 Thread Zhang, Yanmin
The 5th patch is applied to the latest qemu-kvm tree. Signed-off-by: Zhang Yanmin yanmin_zh...@linux.intel.com --- diff -Nraup qemu-kvm_0621/kvm/include/linux/kvm.h qemu-kvm_0621_perf/kvm/include/linux/kvm.h --- qemu-kvm_0621/kvm/include/linux/kvm.h 2010-06-21 11:00:28.0 +0800

[PATCH V2 4/5] ara virt interface of perf to support kvm guest os statistics collection in guest os

2010-06-21 Thread Zhang, Yanmin
The 4th patch is to implement para virt perf at guest side. Signed-off-by: Zhang Yanmin yanmin_zh...@linux.intel.com --- --- linux-2.6_tip0620/arch/x86/Kconfig 2010-06-21 15:19:39.180999849 +0800 +++ linux-2.6_tip0620perfkvm/arch/x86/Kconfig 2010-06-21 15:21:39.30849 +0800 @@ -552,6

Re: [PATCH V2 1/5] ara virt interface of perf to support kvm guest os statistics collection in guest os

2010-06-21 Thread Zhang, Yanmin
On Mon, 2010-06-21 at 14:45 +0300, Avi Kivity wrote: On 06/21/2010 12:31 PM, Zhang, Yanmin wrote: Here is the version 2. ChangeLog since V1: Mostly changes based on Avi's suggestions. 1) Use a id to identify the perf_event between host and guest; 2) Changes lots of codes to deal

Re: [PATCH V2 2/5] ara virt interface of perf to support kvm guest os statistics collection in guest os

2010-06-21 Thread Zhang, Yanmin
On Mon, 2010-06-21 at 15:00 +0300, Avi Kivity wrote: On 06/21/2010 12:31 PM, Zhang, Yanmin wrote: The 2nd patch is to change the definition of perf_event to facilitate perf attr copy when a hypercall happens. Signed-off-by: Zhang Yanminyanmin_zh...@linux.intel.com --- --- linux

Re: [PATCH V2 3/5] ara virt interface of perf to support kvm guest os statistics collection in guest os

2010-06-21 Thread Zhang, Yanmin
On Mon, 2010-06-21 at 15:33 +0300, Avi Kivity wrote: On 06/21/2010 12:31 PM, Zhang, Yanmin wrote: The 3rd patch is to implement para virt perf at host kernel. @@ -64,6 +73,85 @@ struct kvm_mmu_op_release_pt { #ifdef __KERNEL__ #includeasm/processor.h +/* + * In host kernel

Re: [PATCH V2 5/5] ara virt interface of perf to support kvm guest os statistics collection in guest os

2010-06-21 Thread Zhang, Yanmin
On Mon, 2010-06-21 at 15:37 +0300, Avi Kivity wrote: On 06/21/2010 12:31 PM, Zhang, Yanmin wrote: The 5th patch is applied to the latest qemu-kvm tree. --- qemu-kvm_0621/target-i386/kvm.c 2010-06-21 11:00:29.0 +0800 +++ qemu-kvm_0621_perf/target-i386/kvm.c2010-06-21 13:00

Re: [RFC] para virt interface of perf to support kvm guest os statistics collection in guest os

2010-06-10 Thread Zhang, Yanmin
On Thu, 2010-06-10 at 11:50 +0200, Peter Zijlstra wrote: On Thu, 2010-06-10 at 10:21 +0800, Zhang, Yanmin wrote: . The ABI mostly includes the definition of struct perf_event_attr, guest_perf_counter, and hypercalls. Note that perf_event_attr isn't guaranteed to be stable between

Re: [RFC] para virt interface of perf to support kvm guest os statistics collection in guest os

2010-06-09 Thread Zhang, Yanmin
On Wed, 2010-06-09 at 11:33 +0300, Avi Kivity wrote: On 06/09/2010 06:30 AM, Zhang, Yanmin wrote: From: Zhang, Yanminyanmin_zh...@linux.intel.com Based on Ingo's idea, I implement a para virt interface for perf to support statistics collection in guest os. That means we could run tool

Re: [RFC] para virt interface of perf to support kvm guest os statistics collection in guest os

2010-06-09 Thread Zhang, Yanmin
On Wed, 2010-06-09 at 11:59 +0300, Avi Kivity wrote: On 06/09/2010 06:30 AM, Zhang, Yanmin wrote: From: Zhang, Yanminyanmin_zh...@linux.intel.com Based on Ingo's idea, I implement a para virt interface for perf to support statistics collection in guest os. That means we could run tool

Re: [RFC] para virt interface of perf to support kvm guest os statistics collection in guest os

2010-06-09 Thread Zhang, Yanmin
On Wed, 2010-06-09 at 12:41 +0300, Avi Kivity wrote: On 06/09/2010 12:21 PM, Zhang, Yanmin wrote: One thing that's missing is documentation of the guest/host ABI. It will be a requirement for inclusion, but it will also be a great help for review, so please provide it ASAP. I

Re: [RFC] para virt interface of perf to support kvm guest os statistics collection in guest os

2010-06-09 Thread Zhang, Yanmin
On Thu, 2010-06-10 at 06:06 +0300, Avi Kivity wrote: On 06/10/2010 05:21 AM, Zhang, Yanmin wrote: I see. So put it in a union. Or perhaps not even in a union - what if a kvm guest is also acting as a kvm host? My patch has consideration on it. I compiled kernel with host

[RFC] para virt interface of perf to support kvm guest os statistics collection in guest os

2010-06-08 Thread Zhang, Yanmin
From: Zhang, Yanmin yanmin_zh...@linux.intel.com Based on Ingo's idea, I implement a para virt interface for perf to support statistics collection in guest os. That means we could run tool perf in guest os directly. Great thanks to Peter Zijlstra. He is really the architect and gave me

Re: [PATCH V5 1/3] perf kvm: Enhance perf to collect KVM guest os statistics from host side

2010-04-26 Thread Zhang, Yanmin
On Fri, 2010-04-23 at 13:50 +0300, Avi Kivity wrote: On 04/22/2010 01:27 PM, Liu Yu-B13201 wrote: I met this error when built kernel. Anything wrong? CC init/main.o In file included from include/linux/ftrace_event.h:8, from include/trace/syscall.h:6,

Re: [PATCH V5 1/3] perf kvm: Enhance perf to collect KVM guest os statistics from host side

2010-04-20 Thread Zhang, Yanmin
On Tue, 2010-04-20 at 08:09 +0200, Ingo Molnar wrote: * Ingo Molnar mi...@elte.hu wrote: * Zhang, Yanmin yanmin_zh...@linux.intel.com wrote: unsigned long perf_misc_flags(struct pt_regs *regs) { int misc = 0; + if (perf_guest_cbs perf_guest_cbs-is_in_guest

Re: [PATCH V5 1/3] perf kvm: Enhance perf to collect KVM guest os statistics from host side

2010-04-19 Thread Zhang, Yanmin
On Mon, 2010-04-19 at 11:37 +0300, Avi Kivity wrote: On 04/19/2010 08:32 AM, Zhang, Yanmin wrote: Below patch introduces perf_guest_info_callbacks and related register/unregister functions. Add more PERF_RECORD_MISC_XXX bits meaning guest kernel and guest user space

Re: [PATCH V5 1/3] perf kvm: Enhance perf to collect KVM guest os statistics from host side

2010-04-19 Thread Zhang, Yanmin
On Mon, 2010-04-19 at 11:59 +0300, Avi Kivity wrote: On 04/19/2010 11:55 AM, Zhang, Yanmin wrote: On Mon, 2010-04-19 at 11:37 +0300, Avi Kivity wrote: On 04/19/2010 08:32 AM, Zhang, Yanmin wrote: Below patch introduces perf_guest_info_callbacks and related register

Re: [PATCH V5 1/3] perf kvm: Enhance perf to collect KVM guest os statistics from host side

2010-04-19 Thread Zhang, Yanmin
parameter needs name even if unused - missing space after opening curly brace Please provide delta fixes. Here is the fix on the top of the prior 3 patches of V5. From: Zhang, Yanmin yanmin_zh...@linux.intel.com Fix some programming style issues on the top of perf kvm enhancement V5. Signed-off

[PATCH V5 0/3] perf kvm: Enhance perf to collect KVM guest os statistics from host side

2010-04-18 Thread Zhang, Yanmin
kvm stat'. From: Zhang, Yanmin yanmin_zh...@linux.intel.com Based on the discussion in KVM community, I worked out the patch to support perf to collect guest os statistics from host side. This patch is implemented with Ingo, Peter and some other guys' kind help. Yang Sheng pointed out a critical

[PATCH V5 1/3] perf kvm: Enhance perf to collect KVM guest os statistics from host side

2010-04-18 Thread Zhang, Yanmin
Below patch introduces perf_guest_info_callbacks and related register/unregister functions. Add more PERF_RECORD_MISC_XXX bits meaning guest kernel and guest user space. Signed-off-by: Zhang Yanmin yanmin_zh...@linux.intel.com --- diff -Nraup --exclude-from=exclude.diff linux-2.6_tip0417/arch

[PATCH V5 2/3] perf kvm: Enhance perf to collect KVM guest os statistics from host side

2010-04-18 Thread Zhang, Yanmin
Below patch implements the perf_guest_info_callbacks on kvm. Signed-off-by: Zhang Yanmin yanmin_zh...@linux.intel.com --- diff -Nraup linux-2.6_tip0417/arch/x86/kvm/vmx.c linux-2.6_tip0417_perfkvm/arch/x86/kvm/vmx.c --- linux-2.6_tip0417/arch/x86/kvm/vmx.c2010-04-19 09:51:47.908673911

[PATCH V4 0/2] perf kvm: Enhance perf to collect KVM guest os statistics from host side

2010-04-16 Thread Zhang, Yanmin
parameter -p to collect specific guest os instance statistics. ChangeLog V2: 1) Based on Avi's suggestion, I moved callback functions to generic code area. So the kernel part of the patch is clearer. 2) Add 'perf kvm stat'. From: Zhang, Yanmin yanmin_zh

[PATCH V4 1/2] perf kvm: Enhance perf to collect KVM guest os statistics from host side

2010-04-16 Thread Zhang, Yanmin
); + kvm_after_handle_nmi(vmx-vcpu); Signed-off-by: Zhang Yanmin yanmin_zh...@linux.intel.com --- diff -Nraup --exclude=tools linux-2.6_tip0413/arch/x86/include/asm/perf_event.h linux-2.6_tip0413_perfkvm/arch/x86/include/asm/perf_event.h --- linux-2.6_tip0413/arch/x86/include/asm/perf_event.h

Re: [PATCH V3] perf kvm: Enhance perf to collect KVM guest os statistics from host side

2010-04-15 Thread Zhang, Yanmin
On Thu, 2010-04-15 at 11:05 +0300, Avi Kivity wrote: On 04/15/2030 04:04 AM, Zhang, Yanmin wrote: An even more accurate way to determine this is to check whether the interrupt frame points back at the 'int $2' instruction. However we plan to switch to a self-IPI method to inject the NMI

Re: [PATCH V3] perf kvm: Enhance perf to collect KVM guest os statistics from host side

2010-04-14 Thread Zhang, Yanmin
On Wed, 2010-04-14 at 12:20 +0300, Avi Kivity wrote: On 04/14/2030 12:05 PM, Zhang, Yanmin wrote: Here is the new patch of V3 against tip/master of April 13th if anyone wants to try it. Thanks for persisting despite the flames. Can you please separate arch/x86/kvm part

Re: [PATCH 3/3] perf events: Change perf parameter --pid to process-wide collection instead of thread-wide

2010-03-25 Thread Zhang, Yanmin
On Thu, 2010-03-25 at 16:02 +0800, Li Zefan wrote: Zhang, Yanmin wrote: From: Zhang, Yanmin yanmin_zh...@linux.intel.com Parameter --pid (or -p) of perf currently means a thread-wide collection. For exmaple, if a process whose id is has 10 threads, 'perf top -p ' just

Re: [RFC] Unify KVM kernel-space and user-space code into a single project

2010-03-25 Thread Zhang, Yanmin
On Wed, 2010-03-24 at 20:20 +0200, Avi Kivity wrote: On 03/24/2010 07:47 PM, Arnaldo Carvalho de Melo wrote: Em Wed, Mar 24, 2010 at 06:09:30PM +0200, Avi Kivity escreveu: Doesn't perf already has a dependency on naming conventions for finding debug information? It looks at

Re: [PATCH] Enhance perf to collect KVM guest os statistics from host side

2010-03-23 Thread Zhang, Yanmin
On Tue, 2010-03-23 at 10:15 -0300, Arnaldo Carvalho de Melo wrote: Em Tue, Mar 23, 2010 at 11:14:41AM +0800, Zhang, Yanmin escreveu: On Mon, 2010-03-22 at 13:44 -0300, Arnaldo Carvalho de Melo wrote: Em Mon, Mar 22, 2010 at 03:24:47PM +0800, Zhang, Yanmin escreveu: On Fri, 2010-03-19

Re: [RFC] Unify KVM kernel-space and user-space code into a single project

2010-03-22 Thread Zhang, Yanmin
On Sun, 2010-03-21 at 22:20 +0100, Ingo Molnar wrote: * Avi Kivity a...@redhat.com wrote: Well, for what it's worth, I rarely ever use anything else. My virtual disks are raw so I can loop mount them easily, and I can also switch my guest kernels from outside... without ever needing

Re: [PATCH] Enhance perf to collect KVM guest os statistics from host side

2010-03-22 Thread Zhang, Yanmin
On Fri, 2010-03-19 at 09:21 +0100, Ingo Molnar wrote: Nice progress! This bit: 1) perf kvm top [r...@lkp-ne01 norm]# perf kvm --host --guest --guestkallsyms=/home/ymzhang/guest/kallsyms --guestmodules=/home/ymzhang/guest/modules top Will be really be painful to developers - to

Re: [PATCH] Enhance perf to collect KVM guest os statistics from host side

2010-03-22 Thread Zhang, Yanmin
On Mon, 2010-03-22 at 13:44 -0300, Arnaldo Carvalho de Melo wrote: Em Mon, Mar 22, 2010 at 03:24:47PM +0800, Zhang, Yanmin escreveu: On Fri, 2010-03-19 at 09:21 +0100, Ingo Molnar wrote: So some sort of --guestmount option would be the natural solution, which points to the guest system's

Re: [PATCH] Enhance perf to collect KVM guest os statistics from host side

2010-03-18 Thread Zhang, Yanmin
On Thu, 2010-03-18 at 10:45 +0800, Zhang, Yanmin wrote: On Wed, 2010-03-17 at 17:26 +0800, Zhang, Yanmin wrote: On Tue, 2010-03-16 at 10:47 +0100, Ingo Molnar wrote: * Zhang, Yanmin yanmin_zh...@linux.intel.com wrote: On Tue, 2010-03-16 at 15:48 +0800, Zhang, Yanmin wrote

[PATCH 1/3] perf events: Enable counters when collecting process-wide or system-wide data by 'perf stat'

2010-03-18 Thread Zhang, Yanmin
and enhance perf to be more user-friendly. Subject: [PATCH 1/3] perf events: Enable counters when collecting process-wide or system-wide data by 'perf stat' From: Zhang, Yanmin yanmin_zh...@linux.intel.com Command 'perf stat' doesn't enable counters when collecting an existing (by -p) process or a system

[PATCH 2/3] perf events: Enable counters only when kernel is execing the subcommand of 'perf record'

2010-03-18 Thread Zhang, Yanmin
From: Zhang, Yanmin yanmin_zh...@linux.intel.com 'perf record' starts counters before subcommand is execed, so the statistics is not precise because it includes data of some preparation steps. I fix it with the patch. In addition, Change the condition to fork/exec subcommand

[PATCH 3/3] perf events: Change perf parameter --pid to process-wide collection instead of thread-wide

2010-03-18 Thread Zhang, Yanmin
From: Zhang, Yanmin yanmin_zh...@linux.intel.com Parameter --pid (or -p) of perf currently means a thread-wide collection. For exmaple, if a process whose id is has 10 threads, 'perf top -p ' just collects the main thread statistics. That's misleading. Users are used to attach a whole

Re: [PATCH] Enhance perf to collect KVM guest os statistics from host side

2010-03-17 Thread Zhang, Yanmin
On Tue, 2010-03-16 at 10:47 +0100, Ingo Molnar wrote: * Zhang, Yanmin yanmin_zh...@linux.intel.com wrote: On Tue, 2010-03-16 at 15:48 +0800, Zhang, Yanmin wrote: On Tue, 2010-03-16 at 07:41 +0200, Avi Kivity wrote: On 03/16/2010 07:27 AM, Zhang, Yanmin wrote: From: Zhang

Re: [PATCH] Enhance perf to collect KVM guest os statistics from host side

2010-03-17 Thread Zhang, Yanmin
On Wed, 2010-03-17 at 17:26 +0800, Zhang, Yanmin wrote: On Tue, 2010-03-16 at 10:47 +0100, Ingo Molnar wrote: * Zhang, Yanmin yanmin_zh...@linux.intel.com wrote: On Tue, 2010-03-16 at 15:48 +0800, Zhang, Yanmin wrote: On Tue, 2010-03-16 at 07:41 +0200, Avi Kivity wrote: On 03/16

Re: [PATCH] Enhance perf to collect KVM guest os statistics from host side

2010-03-16 Thread Zhang, Yanmin
On Tue, 2010-03-16 at 07:41 +0200, Avi Kivity wrote: On 03/16/2010 07:27 AM, Zhang, Yanmin wrote: From: Zhang, Yanminyanmin_zh...@linux.intel.com Based on the discussion in KVM community, I worked out the patch to support perf to collect guest os statistics from host side. This patch

Re: [PATCH] Enhance perf to collect KVM guest os statistics from host side

2010-03-16 Thread Zhang, Yanmin
On Tue, 2010-03-16 at 15:48 +0800, Zhang, Yanmin wrote: On Tue, 2010-03-16 at 07:41 +0200, Avi Kivity wrote: On 03/16/2010 07:27 AM, Zhang, Yanmin wrote: From: Zhang, Yanminyanmin_zh...@linux.intel.com Based on the discussion in KVM community, I worked out the patch to support

Re: [PATCH] Enhance perf to collect KVM guest os statistics from host side

2010-03-16 Thread Zhang, Yanmin
On Tue, 2010-03-16 at 11:32 +0200, Avi Kivity wrote: On 03/16/2010 09:48 AM, Zhang, Yanmin wrote: Excellent, support for guest kernel != host kernel is critical (I can't remember the last time I ran same kernels). How would we support multiple guests with different kernels

Re: [PATCH] x86/kvm: Show guest system/user cputime in cpustat

2010-03-11 Thread Zhang, Yanmin
On Thu, 2010-03-11 at 09:50 +0200, Avi Kivity wrote: On 03/11/2010 09:46 AM, Sheng Yang wrote: On Thursday 11 March 2010 15:36:01 Avi Kivity wrote: On 03/11/2010 09:20 AM, Sheng Yang wrote: Currently we can only get the cpu_stat of whole guest as one. This patch enhanced

Re: KVM PMU virtualization

2010-03-10 Thread Zhang, Yanmin
On Thu, 2010-03-04 at 09:00 +0800, Zhang, Yanmin wrote: On Wed, 2010-03-03 at 11:15 +0100, Peter Zijlstra wrote: On Wed, 2010-03-03 at 17:27 +0800, Zhang, Yanmin wrote: -#ifndef perf_misc_flags -#define perf_misc_flags(regs) (user_mode(regs) ? PERF_RECORD_MISC_USER

Re: KVM PMU virtualization

2010-03-03 Thread Zhang, Yanmin
On Wed, 2010-03-03 at 11:32 +0800, Zhang, Yanmin wrote: On Tue, 2010-03-02 at 10:36 +0100, Ingo Molnar wrote: * Zhang, Yanmin yanmin_zh...@linux.intel.com wrote: On Fri, 2010-02-26 at 10:17 +0100, Ingo Molnar wrote: My suggestion, as always, would be to start very simple and very

Re: KVM PMU virtualization

2010-03-03 Thread Zhang, Yanmin
On Wed, 2010-03-03 at 11:13 +0100, Peter Zijlstra wrote: On Wed, 2010-03-03 at 17:27 +0800, Zhang, Yanmin wrote: +static inline u64 perf_instruction_pointer(struct pt_regs *regs) +{ + u64 ip; + ip = percpu_read(perf_virt_ip.ip); + if (!ip) + ip

Re: KVM PMU virtualization

2010-03-03 Thread Zhang, Yanmin
On Wed, 2010-03-03 at 11:15 +0100, Peter Zijlstra wrote: On Wed, 2010-03-03 at 17:27 +0800, Zhang, Yanmin wrote: -#ifndef perf_misc_flags -#define perf_misc_flags(regs) (user_mode(regs) ? PERF_RECORD_MISC_USER : \ -PERF_RECORD_MISC_KERNEL) -#define

Re: KVM PMU virtualization

2010-03-02 Thread Zhang, Yanmin
On Tue, 2010-03-02 at 10:36 +0100, Ingo Molnar wrote: * Zhang, Yanmin yanmin_zh...@linux.intel.com wrote: On Fri, 2010-02-26 at 10:17 +0100, Ingo Molnar wrote: My suggestion, as always, would be to start very simple and very minimal: Enable 'perf kvm top' to show guest overhead

Re: KVM PMU virtualization

2010-03-01 Thread Zhang, Yanmin
On Fri, 2010-02-26 at 10:17 +0100, Ingo Molnar wrote: * Joerg Roedel j...@8bytes.org wrote: On Fri, Feb 26, 2010 at 10:55:17AM +0800, Zhang, Yanmin wrote: On Thu, 2010-02-25 at 18:34 +0100, Joerg Roedel wrote: On Thu, Feb 25, 2010 at 04:04:28PM +0100, Jes Sorensen wrote: 1

Re: Enhance perf to support KVM

2010-02-25 Thread Zhang, Yanmin
On Thu, 2010-02-25 at 10:20 +0100, Peter Zijlstra wrote: On Thu, 2010-02-25 at 11:27 +0800, Zhang, Yanmin wrote: Ingo, I did some testing with KVM virtualization. perf shows vmx_vcpu_run consumes more than 50% cpu time. Actually, the info is incorrect because when perf counter

Re: KVM PMU virtualization

2010-02-25 Thread Zhang, Yanmin
On Thu, 2010-02-25 at 17:26 +0100, Ingo Molnar wrote: * Jan Kiszka jan.kis...@siemens.com wrote: Jes Sorensen wrote: Hi, It looks like several of us have been looking at how to use the PMU for virtualization. Rather than continuing to have discussions in smaller groups, I

Re: KVM PMU virtualization

2010-02-25 Thread Zhang, Yanmin
On Thu, 2010-02-25 at 18:34 +0100, Joerg Roedel wrote: On Thu, Feb 25, 2010 at 04:04:28PM +0100, Jes Sorensen wrote: 1) Add support to perf to allow it to monitor a KVM guest from the host. This shouldn't be a big problem. The PMU of AMD Fam10 processors can be configured to count