From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH RFC 1/4]Porting Xentrace to kvm Date: Sun, 16 Mar 2008 17:43:17 +0200 Message-ID: <47DD4015.9020600@qumranet.com> References: <9D7649D18729DE4BB2BD7B494F7FEDC201084D2E@pdsmsx415.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel To: "Liu, Eric E" Return-path: In-Reply-To: <9D7649D18729DE4BB2BD7B494F7FEDC201084D2E@pdsmsx415.ccr.corp.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org Liu, Eric E wrote: > >From 0d7f1ee470fe907e00ac6246bfa11e5322bc64fb Mon Sep 17 00:00:00 2001 > From: Feng (Eric) Liu > Date: Sat, 15 Mar 2008 06:07:33 -0400 > Subject: [PATCH] KVM: Add some trace entries in current code, when the > KVM_TRACE > compilation option is enabled, it outputs the data info thrace > buffer. Define some interfaces for userspace tools to use the > buffer and analyze the trace data. > > > +#ifdef CONFIG_KVM_TRACE > +#define KVMTRACE_ND(evt, vcpu, cycles, count, d1, d2, d3, d4) > \ > + do { > \ > + if (unlikely(kvm_trace_enable_flag)) { > \ > + if (KVM_TRC_##evt == KVM_TRC_VMEXIT || > \ > + KVM_TRC_##evt == KVM_TRC_PAGE_FAULT) { > \ > + struct { > \ > + u32 pid:16, vid:16; > pids can be 32-bit, I think... > \ > + u32 data1; > \ > + unsigned long data2; > \ > + } _d; > \ > + _d.pid = (u16)current->tgid; > \ > + _d.vid = (vcpu)->vcpu_id; > \ > + _d.data1 = d1; > \ > + _d.data2 = d2; > \ > + kvm_trace_var(KVM_TRC_ ## evt, cycles, > \ > + sizeof(_d), (unsigned char *)&_d); > \ > + } else { > \ > This special-casing of exits and page faults is probably unnecessary. Zeroing a couple of variables in a developer-only environment isn't worth it. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/