From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: [PATCH 2/3] KVM: improve trace events of vmexit/mmio/ioport Date: Wed, 18 Jan 2012 10:32:08 +0800 Message-ID: <4F162F28.4010001@linux.vnet.ibm.com> References: <4F13EE3D.2070602@linux.vnet.ibm.com> <4F13EE9B.9020901@linux.vnet.ibm.com> <4F13EFFB.90706@redhat.com> <4F14DCBB.3060207@linux.vnet.ibm.com> <20120117115558.GB17420@amt.cnet> <4F15B08D.5090000@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , Avi Kivity , LKML , KVM To: David Ahern Return-path: In-Reply-To: <4F15B08D.5090000@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 01/18/2012 01:31 AM, David Ahern wrote: >>>> >>>> Relying on the existing tracepoints will make the tool work on older >>>> kernels. >>>> >>> >>> >>> We can drop all new events, but unfortunately, the information of the origin >>> tracepoints is not enough, at least vcpu_id need be traced in theses events >>> to match its events. Yes? >> >> Yes, and if you don't add completed events, you'll have to use kvm_entry >> whose collection adds a lot of overhead. > > > vcpus run as threads and hence have their own tid which is available in > the perf samples. > Nice, thanks for your information, David! > There is an ongoing 'discussion' about modifying existing tracepoints > which your proposed patch violates. This is the start of it: > Hmm, i think we can still add completed tracepoints in the new version kernel, if old version kernel is used, we can fall back to use kvm_entry instead? And there is a exception for mmio read, in current code, the mmio read event is actually used to trace the time when then read emulation is completed, i think we can add a tracepoint like mmio_read_begin to trace the start time of mmio read. So: - for the new kernel, we use mmio_read_begion and kvm_mmio(READ...) to calculate start time and end time. - for the old kernel, we use kvm_exit and kvm_mmio(READ...) to calculate start time and end time. Your idea?