From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH] trace "exit to userspace" event Date: Thu, 14 Oct 2010 13:28:43 +0200 Message-ID: <20101014112843.GJ19207@redhat.com> References: <20101005131432.GO11145@redhat.com> <20101007161839.GA31784@amt.cnet> <20101007175655.GG2397@redhat.com> <20101008004917.GA11600@amt.cnet> <20101008164447.GC393@redhat.com> <4CB17D39.7020007@redhat.com> <20101010154625.GR2397@redhat.com> <4CB6DB03.8060408@redhat.com> <20101014102904.GG19207@redhat.com> <4CB6E558.6010009@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Marcelo Tosatti , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:10346 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753046Ab0JNL2p (ORCPT ); Thu, 14 Oct 2010 07:28:45 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9EBSjbG029327 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 14 Oct 2010 07:28:45 -0400 Content-Disposition: inline In-Reply-To: <4CB6E558.6010009@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Oct 14, 2010 at 01:11:20PM +0200, Avi Kivity wrote: > On 10/14/2010 12:29 PM, Gleb Natapov wrote: > >On Thu, Oct 14, 2010 at 12:27:15PM +0200, Avi Kivity wrote: > >> On 10/10/2010 05:46 PM, Gleb Natapov wrote: > >> >> > >> >> We should log both errno and exit_reason. If we want to be clever, > >> >> we can display strerror(errno) if it's nonzero, and exit_reason > >> >> otherwise (easy to do in a trace-cmd plugin). > >> >> > >> >For starters we should remove KVM_EXIT_INTR exit reason. Looking into > >> >qemu-kvm history it was never used and there is at least one code path > >> >that returns -EINTR and does not set KVM_EXIT_INTR, so exit_reason field > >> >contains stale info on exit. > >> > > >> > >> The two issues are unrelated. > >> > >So what do you propose? I see no issue with my original patch. > > Record both errno and exit_reason. While they're never both valid > at the same time, they're both necessary. > If they can't be valid at the same time, why not record one of them? The one that happened? Also any error other then -EINTR will cause qemu to stop, so it is not very interesting. And ioctl return value can be traced by strace anyway. -- Gleb.