From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCHv2] trace "exit to userspace" event Date: Sun, 24 Oct 2010 19:01:30 +0200 Message-ID: <4CC4666A.2030604@redhat.com> References: <20101024144908.GF2343@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: mtosatti@redhat.com, kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:3932 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758602Ab0JXRBd (ORCPT ); Sun, 24 Oct 2010 13:01:33 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9OH1XPn008006 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 24 Oct 2010 13:01:33 -0400 In-Reply-To: <20101024144908.GF2343@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 10/24/2010 04:49 PM, Gleb Natapov wrote: > Add tracepoint for userspace exit. > > > + > +TRACE_EVENT(kvm_userspace_exit, > + TP_PROTO(__u32 reason, int errno), > + TP_ARGS(reason, errno), > + > + TP_STRUCT__entry( > + __field( __u32, reason ) > + __field( int, errno ) > + ), > + > + TP_fast_assign( > + __entry->reason = reason; > + __entry->errno = errno; Shouldn't this be -errno? > + ), > + > + TP_printk("reason %s (%d)", > + __entry->errno< 0 ? > + (__entry->errno == -EINTR ? "restart" : "error") : > + __print_symbolic(__entry->reason, kvm_trace_exit_reason), > + __entry->errno< 0 ? -__entry->errno : __entry->reason) > +); > + > #if defined(__KVM_HAVE_IOAPIC) > TRACE_EVENT(kvm_set_irq, > TP_PROTO(unsigned int gsi, int level, int irq_source_id), > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index 361ad1a..88c42ae 100644 > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c > @@ -1537,6 +1537,7 @@ static long kvm_vcpu_ioctl(struct file *filp, > if (arg) > goto out; > r = kvm_arch_vcpu_ioctl_run(vcpu, vcpu->run); > + trace_kvm_userspace_exit(vcpu->run->exit_reason, r); > break; -- error compiling committee.c: too many arguments to function